I have a form that prints some reports created with Crystal Report (13.030) and Visual Studio 2019. The printing of each report takes about 5/8 seconds. I have tried all the suggestions found on google, but have not solved anything. Since the reports are about 10m, the customer has to wait a long time before being able to continue.
I have read that it is a known problem, but I don't know how to fix it. I've been thinking about doing the prints in a BackgroundWorker, but I'm not sure if that's a good idea.
I checked the No printer in report box. This is one of my reports, which are all very similar. Am I wrong something?
ReportDocument myReport = new ReportDocument();
myReport.Load("myreport.rpt");
PrintLayoutSettings PrintLayout = new PrintLayoutSettings();
PrinterSettings printerSettings = new PrinterSettings();
printerSettings.PrinterName = "PDF Creator"; // Any;
PageSettings pSettings = new PageSettings(printerSettings);
myReport.SetParameterValue("var1", "123");
myReport.SetParameterValue("var2", "ABC");
myReport.SetParameterValue("var3", "DEF");
myReport.PrintToPrinter(printerSettings, pSettings, false, PrintLayout);
myReport.Close();
CodePudding user response:
I moved the prints to as many BackgroundWorkers, obviously everything is very fast, even if I don't know if it's the best solution.