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

Reporting from Win Forms

1 Answer 62 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Роберт
Top achievements
Rank 1
Роберт asked on 10 Dec 2014, 06:45 PM
Hi, here is the simple code:

        
void ReportToDefault(Report report)
        {
            if (report == null) return;
 
            System.Drawing.Printing.PrintController standardPrintController =
                                    new System.Drawing.Printing.StandardPrintController();
            Telerik.Reporting.Processing.ReportProcessor reportProcessor
                                                = new Telerik.Reporting.Processing.ReportProcessor();
            reportProcessor.PrintController = standardPrintController;
            try
            {
                reportProcessor.PrintReport(report, Properties.Settings.Default.defaultPrinter);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }

What is the best practice: to create the report processor and controller each time a doc is printed in background (for instance if it's kinda printing manager, and it receives requests to print from different apps), or better to instantiate the both classes once on the app start up and then just call Print Report?
Is it ok if several Print controllers and processors are active and several threads?
The idea is simple.. if we have the intensive doc-to-print feedback, then what's the better way to be sure the general App is not hanging on while printing is not over?

Thank you!

1 Answer, 1 is accepted

Sort by
0
KS
Top achievements
Rank 1
answered on 13 Dec 2014, 09:38 AM
Hi,

Sounds like threading question and I suppose it is better to have a new report object for each print operation... Or print at the client, and avoid the server overload - Print a report directly at client-side without displaying it in an ASP.NET ReportViewer

-KS
Tags
General Discussions
Asked by
Роберт
Top achievements
Rank 1
Answers by
KS
Top achievements
Rank 1
Share this question
or