The primary means by which report output is generated is via a call to the Print method of the report object.
1. Print to Screen
The following code would cause the Print Preview form to be displayed and the first page of the report to be presented in this form:
uses ppTypes;
ppReport1.DeviceType := dtScreen;
ppReport1.Print;
2. Print to Printer
This code would cause the Print dialog to be displayed. The report would then be sent to the printer:
uses ppTypes;
ppReport1.DeviceType := dtPrinter;
ppReport1.Print;
As you can see, it is quite easy to generate report output using ReportBuilder. In order to use some of the more advanced features related to report output, you will need to understand a little bit more about what is happening behind the scenes to make all of this simplicity possible.
As you may already know, report output is one of the elements of the reporting equation. The reporting equation was described in the introduction to ReportBuilder and is as follows:
The native report output in ReportBuilder takes the form of page objects. Page objects contain draw commands, which describe what the page contains. Page objects are sent to devices, which then convert them to a format appropriate for the device. The following diagram shows page objects sent to the ScreenDevice that are then converted to a bitmap for display in the Print Preview form.