Previewing a query

To preview a query, follow the steps below:

  1. In the Query Editor window, click the Preview button on the toolbar. The Preview Option dialog will then appear. See the dialog.
  2. Specify the options in the dialog to suit your requirements.

    Tip: The values shown in the text boxes as soon as the Preview Option dialog appears are the default values. These values can be specified in the Query Editor category in the Options dialog.

  3. Click OK. The Preview window will then appear. See the window.

    Note: If the query has parameters, when you click the OK button, the Enter Parameter Values dialog will be displayed. After you enter the parameter value, the Preview window will appear showing the corresponding records.

  4. Click , , and to browse the records. If the type of the result set is TYPE_FORWARD_ONLY, the last page button will be disabled until you have browsed the last page.
  5. To refetch the result set, click the Refetch button on the toolbar. Click the Stop button to stop JReport from refetching the result set is required.
  6. To print the result set, click the Print button . If you want to preview the result set before printing, click the Print Preview button .
  7. If you want to set up the page parameters, click File > Page Setup.
  8. Click File > Close, or the close button of the window to close the Preview window.

Note: In the Preview window, JTable is used to display the result set. When you open the window, the result set is cached, and when you close the window, the result set is released.