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

Reporting from Win Forms

1 Answer 29 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, 07:23 PM
tried to post it in Reporting forum, but unsuccessfully, doesn't show 

Hi,

here is the code for background printing.

        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); }
        }

The question is:

If the high intensive printing is needed, then what is the best practice to use the code? 
Is it better to instantiate the controller and processor only once, on the App start up, and then just pass arguments to PrintReport? 
What if it's using im multithreading mode, when Docs come ech time while the processor maybe is still busy in printing?
Thanks you!

1 Answer, 1 is accepted

Sort by
0
Роберт
Top achievements
Rank 1
answered on 10 Dec 2014, 09:56 PM
Yo, mates, I did several mistakes in the text.
Sorry, just wildly wanted to sleep, wrote it while my eyes almost closed.
Tags
General Discussions
Asked by
Роберт
Top achievements
Rank 1
Answers by
Роберт
Top achievements
Rank 1
Share this question
or