reportProcessor.PrintReport only prints first page of document.

1 Answer 126 Views
.NET Framework Report Designer (standalone) Report Viewer - WPF
Andriamitantsoa
Top achievements
Rank 1
Andriamitantsoa asked on 21 Oct 2022, 02:06 PM

Hi, 

I am trying to print a 2 page document. However, only the first page is printed.

When I render the report with reportProcessor.RenderReport and write the rendered report to a PDF. This PDF has two pages, as expected . (However, the printed document is only 1 page long... )

I use the following code to print:

           PrinterSettings printerSettings = new PrinterSettings
            {
                PrinterName = printerName,
                PrintRange = PrintRange.AllPages,
                MinimumPage = 0,
                MaximumPage = 1000,
                FromPage = 0,
                PrintToFile = false
            };
            PrintController standardPrintController = new StandardPrintController();
            ReportProcessor reportProcessor = new ReportProcessor
            {
                PrintController = standardPrintController
            };
            reportProcessor.PrintReport(reportSource, printerSettings, Globals.OutputFormat);

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 26 Oct 2022, 09:28 AM

Hi Andriamitantsoa,

I noticed that you have opened a Support ticket for the same issue. I will summarize my reply also here so that other users may benefit from it.

The code related to the ReportProcessor seems fine to me. I noticed that you have specified multiple PrinterSettings. Can you try to set only the PrinterName?

Can you specify the value of 'Globals.OutputFormat'? The default third argument of the PrintReport method is 'EMF'. What is the value that you use as a rendering format when printing? You may try to export the report in the same format with the RenderReport method to check whether the document will be correctly produced. For details I suggest the article Generating Reports Locally.

Regards,
Todor
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
.NET Framework Report Designer (standalone) Report Viewer - WPF
Asked by
Andriamitantsoa
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or