You can generate output reports and labels by performing the following:
Some of the actions discussed in this topic have different results, depending on the setting of REPORTBEHAVIOR. When you use the command |
You can change printer settings before you print the report or print the report programmatically.
To print a report or label
Choose the PrintвЂ¦ option on the File menu, and select Report or Label as the Type of output to print in the Print dialog box. Click the ellipsis (...) button to choose the report or label file (.frx or .lbx) to print. Alternatively, open the report or label in the appropriate designer and click Run Report on the Report menu.
The Print dialog box opens so you can make changes to printer settings.
In the Print dialog box, click Print.
To print reports and labels programmatically
Option 1: Use the REPORT FORM or LABEL command with the TO PRINTER clause.
Option 2: Use REPORT FORM or LABEL command with the clause OBJECT TYPE 0.
Option 3: Use REPORT FORM or LABEL command with the clause OBJECT<oReference>, where <oReference> is an instance of a ReportListener-derived class with its ListenerType property value set to
0. For more information, see ListenerType Property.
When using these commands, you can also display or suppress display of the Print dialog box and print status message. You can set many other options, such as which records to print.
Sending Reports to the Screen
You can send report or label output to the main Visual FoxPro screen or currently active window.
To send report or label output to the screen or currently active window
When using the REPORT FORM and LABEL commands, omit all clauses that direct output other than to the screen or currently active window.
Visual FoxPro 9's GDI+ reporting rendering mechanism does not echo the contents of the report or label directly to the current output window, so ensure that SET REPORTBEHAVIOR is set to |
Sending Reports to a File
Sending reports to a file makes it possible for you to create an electronic version of the report and print them as a batch file on your printer at a later time.
To send a report to a file
Saving Reports as HTML
You can save a report in Hypertext Markup Language (HTML) format.
|You must first save the report and any changes to disk before saving it as HTML.|
To save a report as HTML
Open the report or label in the appropriate designer.
On the File menu, click Save As HTML.
In the Save As HTML dialog box, select the options you want.
To save the HTML (.htm) file with a different name, click the ellipsis (...) button to open the Save As dialog box so you can specify a different name. When you are finished in the Save As dialog box, click Save.
In the Save As HTML dialog box, click OK.
For more information, see Save As HTML Dialog Box.
Without opening the Report or Label Designer, you can also generate HTML from your report form by using the command |