### Creating a table report

Assume that you have already opened a page report, to create a table report within it:

1. Do either of the following:
   - Click File > New > Page Report Tab on the menu bar.
   - On the report tab bar, right-click an existing report tab in the report and click Insert on the shortcut menu.
2. In the New Page Report Tab dialog, specify the title of the report tab, select the required table type: Group Above, Group Left, Group Left Above, or Summary Table, then click OK. The Table Wizard appears.
3. In the Data screen of the wizard, specify the dataset on which the table will be built.
   - To build the table on a new dataset created from the catalog resources, check the New radio button, and then select the data source of the dataset. If the given data resources are not what you want, click the <Add xxx...> item to create one. In addition, if you choose to create the dataset from a query, you can click the Modify button to further modify the query if required.
   - To build the table on an existing dataset in the report, check the Existing radio button, and then select the dataset as required (click the Modify button to modify the selected dataset in the Dataset Editor if necessary). You can also click the <Add Dataset...> item to create one as required.

   Note: When you want to create a table report on a hierarchical data source, pay attention to the unique features of HDS. For details, refer to Developing reports from HDS.

4. In the Display screen, add the required fields from the Resources box to be displayed in the table. Modify the display name of any added field if necessary by double-clicking its Display Name column. If required, click the Sort Fields By button to specify how to sort data in the table.
5. In the Group screen, add the fields as the grouping criteria, and then specify the sorting direction of each group in the Sort column.
6. To add summaries, go to the Summary screen. In the sum on box (the box on the right), specify the group to which the summary will be applied (if you select Table, the summary will be based on the whole dataset), add a field from the Resources box as the summary field, and then select the function for the summary from the Aggregate Function column. From the Position and Column columns, specify where to place the added sum on field in the table.
7. If you want to create a chart together with the table in the report body, go to the Chart screen. Select the chart type you like. From the Category drop-down list, select the field you want to display on the category (X) axis of the chart. You can choose from the group by fields of the table on which some summaries are added. Choose the field to be displayed on the series (Z) axis of the chart from the Series drop-down list, where all the group by fields of the table are listed. From the Show Values drop-down list, select the field you want to display on the value (Y) axis of the chart. You can choose from the summary fields which are calculated based on the field you specify to display on the category axis of the chart.
8. To apply some filters to the table so as to reduce the data displayed in the table, go to the Filter screen and define the filter conditions.
9. In the Style screen, specify the style of the table, and if required, click the Page Setup button to set the page settings.
10. When done, click Finish to create the report tab.

See also:

- Tables for details about the table component.
- An example: The SampleComponents catalog, included with JReport Designer, contains reports that have examples of report layout types. For the table report layout example, open `<install_root>\Demo\Reports\SampleComponents\TableReport.cls`.