Printing or physical rendering of report on a paper with dynamically modified properties
|Product||Progress® Telerik® Reporting|
Printer settings and Device Info settings passed to the ReportProcessor have lower priority than report PageSettings. Here we suggest two approaches when it is necessary to print the same report on different paper types/sizes.
The PageSettings of the Report will be respected upon rendering in physical format and printing.
Create a copy of the report for each specific paper type/size. The difference between the reports will be the Report.PageSettings property, i.e in the corresponding PaperKind, PaperSize, Margins, etc.
Instantiate the report, change its PageSettings accordingly and wrap it in an InstanceReportSource to pass it to the ReportProcessor / Reporting Engine for rendering.
report = new MyReport(); // Modify report PageSettings report.PageSettings.PaperKind = "A3"; report.PageSettings.Landscape = True; InstanceReportSource instanceReportSource = new InstanceReportSource(); instanceReportSource.ReportDocument = report; Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor(); System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable(); Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo);