Printing or physical rendering of report on a paper with dynamically modified properties
Environment
Product | Progress® Telerik® Reporting |
Description
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.
Solution
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);