This is a migrated thread and some comments may be shown as answers.

ReportProcessor.PrintReport() extremly slow

1 Answer 289 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Roman
Top achievements
Rank 1
Iron
Roman asked on 22 Apr 2021, 03:45 PM

Hi there

I'm trying to print labels with a label printer using Telerik Reporting. I just updated it to the latest version to make sure that I don't have any version conflicts. In my application I created a report by designer with just one textbox to make sure it's not my data which causes the problem.

I then use this code on button click:

01.// prepare report
02.Telerik.Reporting.Report report = new TestLabel();
03.report.PageSettings.Margins = new TelerikDrawing.MarginsU(new TelerikDrawing.Unit(0), new TelerikDrawing.Unit(0), new TelerikDrawing.Unit(0), new TelerikDrawing.Unit(0));
04.report.PageSettings.PaperKind = PaperKind.Custom;
05.report.PageSettings.PaperSize = new TelerikDrawing.SizeU(new TelerikDrawing.Unit(97, TelerikDrawing.UnitType.Mm), new TelerikDrawing.Unit(97, TelerikDrawing.UnitType.Mm));
06. 
07.// set printer settings
08.PrinterSettings printSet = new PrinterSettings();
09.printSet.Copies = 1;
10.printSet.PrinterName = LabelPrinterName;
11. 
12.// create report processor
13.ReportProcessor repProc = new ReportProcessor();
14.repProc.PrintController = new StandardPrintController();
15. 
16.InstanceReportSource repSrc = new InstanceReportSource();
17.repSrc.ReportDocument = report;
18. 
19.// print report
20.repProc.PrintReport(repSrc, printSet);

 

I set a breakpoint on line 20 on the PrintReport method. When I continue the code, it takes about three minutes to finally print the report and the code to continue. I'm wondering why this is taking so long. Is there anything wrong with my code during preparation, is there a setting missing or causing problems?

Cheers,
Roman

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 27 Apr 2021, 10:33 AM

Hi Roman,

The provided code seems fine to me. I don't see anything that may be causing the observed delay. If I understood correctly, it occurs when executing the ReportProcessor > PrintReport method.

Generally, our code sends the report rendered for printing to the printer spooler and leaves the rest to the latter.

The problem may be in report processing or rendering, including data fetching. Unfortunately, based on the available information this is not clear.

You may attach a Trace Listener to your application. Our code should log information on how much time it takes for report processing and rendering.

If you use a database to deliver the data, you may also use a database profiler to check the data requests and how much time they take.

Does the issue occur with other printers? Or when you export the same report to PDF?

Can you open a support ticket and send us the report with sample data so that we may test to reproduce the issue locally?

Regards,
Todor
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Roman
Top achievements
Rank 1
Iron
Answers by
Todor
Telerik team
Share this question
or