## Previewing a page report

In the process of designing a page report, you can preview the report tabs in it at any time in the following two ways:

- Previewing a report tab in JReport format
- Previewing a report tab in other formats

Moreover, when previewing a report tab, if it is developed with National Language Support, you can specify the language in which you want the report tab to display; if it contains parameters, you will be prompted to specify values for the parameters in the Enter Parameter Values dialog.

### Previewing a report tab in JReport format

To preview a report tab in JReport format when designing it at any time, just click the View tab, which then causes JReport Engine to run the report tab. The result is then shown in the viewer. To optimize performance, JReport Designer displays report pages before they have been completely generated. For details about the options in the View tab, see Design/View area.

In addition, when previewing a banded object, you are enabled to dynamically sort the records and show details of aggregate level fields.

#### Dynamic sort

You can sort the records in a banded object dynamically in the View area. To do this:

1. Point to the field you want to sort.
2. Right-click the field and select the option Sort Ascending or Sort Descending from the shortcut menu.

#### Showing aggregation detail

You can show details of aggregate level fields in a banded object. Showing detail is made possible where there is a summary for a group. For example, if a banded object has been grouped by Customer City, and the group summary is on Annual Sales. When previewing the banded object, if you point the mouse at the total annual sales for a city, it will turn into a small hand. Click on the total, and the detail report for the selected city will be displayed.

By default, in cases like the above, JReport's convention is to hide the detail panel of each group and only show it in a detail report. To do this, select the detail panel, go to the Report Inspector and set its Invisible property to true (make sure the Suppress property is false). Then view the banded object again, and it will be shown without details. If you want to see the details of a certain city, point the mouse at the city's total annual sales, when the mouse turns into a small hand, click on the total, and the detail report for the city will be displayed.

Note: After some modifications in the design area, if you find the report tab is shown very quickly and the changes are not applied in view mode, this means you need to click the Refresh Data button on the toolbar to re-run your report tab.

### Previewing a report tab in other formats

JReport also allows you to preview your report tab in the following formats: Page Report Result, HTML, PDF, Excel, Text, RTF, XML and PostScript.

To preview a report tab in other formats, take one of the following:

- On the View menu, select the specific format from the Preview As submenu.
- Click the Preview As button on the Standard toolbar and select the required item from the drop-down list.
- On the File menu, select Export To and select the format you want to use.

By selecting one of the formats in the View > Preview As menu, the report tab will be exported to a temporary file which will automatically be opened in the format with the appropriate application. The temporary file will be removed when you exit JReport Designer.

By selecting one of the formats in the File > Export To menu, the report tab will be exported to a file in the same directory as the catalog but will not be opened automatically. The exported file can be used to e-mail or share with other members of your team for review purposes and will not be removed automatically.

Notes:

- The function of previewing a report tab in Page Report Result format is enabled only if you have checked the option Server for Previewing Reports when installing JReport Designer.
- The preview server is a web ad hoc disabled server, and it supports only one user and one report concurrently. Therefore, when you close the report you are previewing, you should use the exit button of Page Report Studio instead of the browser's. In this way, you can release the user session you occupy at the same time, so that you are able to previewing another report later.
- JReport Designer and the preview server are running in two separated JVMs. The preview server applies `-Djreport.url.encoding=UTF-8` in the startup batch file and this setting covers URL encoding/decoding. Therefore, when you preview a report tab in Page Report Result format, if the name of the report tab or its report or catalog file contains non-Latin characters, you need add `-Djreport.url.encoding=UTF-8` into the startup batch file of JReport Designer as well; otherwise the preview will fail.
- When previewing a report tab in Page Report Result format,
  - Make sure the JDBC driver's class path has been appended to setenv.bat in `<install_root>\server\bin.`
  - If the report tab contains some user defined objects (UDO), to have them work correctly in the preview server, you need to compile your Java files again using report.jar and JREngine.jar in the `<install_root>\server\lib` directory, modify the udo.ini file in `<install_root>\server\lib` and append the classes to the class path of JRServer.bat in `<install_root>\server\bin`. For details, see Creating a UDO manually.
  - If the report tab contains some user defined data sources (UDS) or user defined formulas (UDF), you can use the classes you have compiled for using in Designer, but remember to append the classes to the class path of JRServer.bat in `<install_root>\server\bin`.