MindFusion.Reporting for Silverlight Programmer's Guide
Printing

To print a report, you can use the built-in ReportPrinter class. The class provides several methods, which perform the necessary tasks. The following code prints a report identified by the report variable using the Print method.

C#  Copy Code

ReportPrinter reportPrinter = new ReportPrinter(report);
reportPrinter.Print();

Visual Basic  Copy Code

Dim reportPrinter As New ReportPrinter(report)
reportPrinter.Print()

Keep in mind that the report should have been processed by a call to its Run method before it is printed.

In addition to the Print method, the ReportPrinter class provides several more methods. The PreparePrint and PrintPrepared methods can be used in conjunction to print a report. The PreparePrint method is invoked first to layout and render the report. The PrintPrepared method is invoked at some later point to actually print the report. The advantage of using these methods over the Print method is that the report is not laid out and rendered during the actual printing. This can be crucial for big reports because Silverlight raises an exception if the print dialog is not displayed within certain amount of time after printing is initiated by the user.

Another way to print a report is through the PrintRendered method, which accepts an IRenderTargetWithPages object as an argument. This method is usually very fast as well, although its performance depends on the implementation of the Pages property of the supplied IRenderTargetWithPages.