Reporting from Win Forms

2 posts, 0 answers
  1. Robert
    Robert avatar
    53 posts
    Member since:
    Feb 2010

    Posted 10 Dec 2014 Link to this post

    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!
  2. Robert
    Robert avatar
    53 posts
    Member since:
    Feb 2010

    Posted 10 Dec 2014 in reply to Robert Link to this post

    Yo, mates, I did several mistakes in the text.
    Sorry, just wildly wanted to sleep, wrote it while my eyes almost closed.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top