Report building is an iterative process and most developers periodically display the in-progress report to review their most recent changes. If your report uses an internal query and you established default web-root settings, preview functionality is enabled automatically. If your report uses a passed query, you must define an associated CFM page and associate that page with the report. The Report Builder invokes this page when you request Report Preview.
Preview a report that uses an internal query
- (Optional) Define default server connection information using the Preferences dialog box, if you did not define these settings previously:
- Default RDS server configuration (used for Query Builder and Chart Wizard only; not required for report preview).
- Fully qualified path for the local web root directory; for example, C:\ColdFusion\wwwroot or C:\Inetpub\wwwroot.
- URL for the local web root, for example, http://localhost:8500 or http://localhost.
- (Optional) Specify the output format in the Report Properties dialog box (the default format is FlashPaper).
- (Optional) If your report is designed to be invoked by a CFM page, specify the URL of the CFM page in the Report Properties dialog box.
- Save your report.
- Select File > Preview from the menu bar to display the report.
Note: If the Report Builder displays the Edit Preview Report URL dialog box instead of displaying the Preview window, select Edit > Preferences from the menu bar and insure that the web root file and URL settings are correct on the Server Connection pane.
- Close the preview window by pressing F12.
If your report is designed to accept a query object from a cfreport tag, you must associate a URL with the report. If necessary, the Report Builder prompts for this URL when you preview the report. Otherwise, you can open the Report Properties dialog box, and specify the URL of the CFM page in the Report Preview URL field.
You can use the
cfreport tag to invoke a report, regardless of whether the report has an internal query or is passed a query.
Preview with an associated CFM file
- Select Report > Report Properties from the menu bar.
- Specify the URL of the associated CFM page in the Report Preview URL field. This CFM page must contain a cfreport tag whose template attribute specifies the current CFR file and, if necessary, passes a query in the query attribute.
- Save your report.
- Press F12. Depending on the output format that you have chosen, the Preview Report window displays your report in PDF, FlashPaper, RTF, XML, HTML, or Excel format.