To print or preview a report, you can use the built-in ReportPrinter class. The class provides only two methods - Print and Preview, which perform the necessary tasks. The following code prints a report identified by the report variable.
C# Copy Code |
---|
ReportPrinter reportPrinter = new ReportPrinter(report); |
Visual Basic Copy Code |
---|
Dim reportPrinter As New ReportPrinter(report) |
Keep in mind that the report should have been processed by a call to its Run method before it is printed or previewed.