You can view a report in a preview window before sending it to an output destination.
The actions discussed in this topic have different results, depending on the setting of REPORTBEHAVIOR. When you use the command |
To preview a report
Open the report or label in the appropriate designer.
On the View menu, click Preview.
The preview window and Print Preview toolbar open so you can navigate the report.
To navigate the preview window, you can perform the following using the Print Preview toolbar:
To browse the report, click First Page, Previous Page, Go to Page, Next Page, or Last Page.
To change the size of view, choose a zoom level.
To print the report, click Print.
To return to design mode, click Close Preview.
Caution: When you close the preview window, you might be prompted to save your changes to a file. If you receive this prompt, the selection you made not only closes the preview window but also the report layout file. To return to preview mode, click Cancel. To save your changes, and close the preview window and report layout file, click Save. To leave the changes to the layout unsaved, click No.
- To browse the report, click First Page, Previous Page, Go to Page, Next Page, or Last Page.
To preview a report programmatically
Use the REPORT FORM or LABEL FORM command with the PREVIEW clause.
For example, the following code displays the report in a modal preview window:
REPORT FORM MyReport.FRX PREVIEW
Use the REPORT FORM or LABEL FORM command with the OBJECT TYPE 1 clause to explicitly request object-assisted preview. You can also use an OBJECT reference on the command with a reference to a ReportListener object, and set the object's ListenerType property value to
REPORT FORM MyReport.FRX OBJECT TYPE 1 && preview * - OR - LOCAL loReportListener loReportListener = CREATEOBJECT("ReportListener") loReportListener.ListenerType = 1 REPORT FORM MyReport.FRX OBJECT loReportListener
For more information, see ListenerType Property.