JavaScript Editor js editor     Web development 

Main Page

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 SET REPORTBEHAVIOR 90, Visual FoxPro uses a ReportListener object to generate your results through GDI+ instead of GDI. The results of the generation process are sent through a different previewing interface. For more information, see SET REPORTBEHAVIOR Command and _REPORTPREVIEW System Variable.

To preview a report

  1. Open the report or label in the appropriate designer.

  2. On the View menu, click Preview.

    The preview window and Print Preview toolbar open so you can navigate the report.

  3. 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.

      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 preview a report programmatically

  • Use the REPORT FORM or LABEL FORM command with the PREVIEW clause.

For more information, see REPORT FORM Command and LABEL Command.

For example, the following code displays the report in a modal preview window:

В Copy Code
  • 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 1:

В Copy Code
* - OR - 
LOCAL loReportListener
loReportListener = CREATEOBJECT("ReportListener")
loReportListener.ListenerType = 1
REPORT FORM MyReport.FRX OBJECT loReportListener

For more information, see ListenerType Property.

See Also

JavaScript Editor js editor     Web development