### Creating a table report

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

1. Do either of the following to open the New Report dialog.
   - Click File > New > Report on the menu bar.
   - On the report tab bar, right-click the tab of an existing report in the report set and click Insert on the shortcut menu.
2. In the dialog, specify the title of the report, select the Table Report layout and click OK. The Table Report Wizard will then be displayed.
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 according to your requirements.
   - To build the table on an existing dataset in the report set, check the Existing radio button, and then select the dataset as required (click the Modify button to modify the selected dataset if necessary). You can also click the <Add Dataset...> item to create one as required.

   Notes:

   - After choosing the dataset, you can click Finish directly in the report wizard to create a report with a blank table in it. After which, you can drag the required data fields, which are contained in the created/specified dataset, from the Resource View panel to the report.
   - If you want to create the table on an HDS, 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 panel to be displayed in the table. Modify the display name of any added field if necessary by double-clicking its Display Name column. And if required, click the Sort Fields by button to specify how to sort data in the table.
5. In the Group tab, 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 panel (the panel 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 panel as the summary field, and then select the function for the summary from the Aggregate Function column.

   Notes:

   - The Break Field is a defined field on which the summary will be calculated (if the break field of a summary field is null, the summary will be calculated based on the whole dataset).
   - When the report is created, JReport will automatically give the summaries some proper name labels to help you clarify the meaning of the numbers. The auto generated labels are controlled by the Text property in the Report Inspector. You can manually input the text of the label according to your requirements.
   - If you have created several summaries in the table report and the summaries have the same function, by default they will be aligned horizontally in the report, However, you can choose to align them vertically by checking Align summaries vertically in the Options dialog (File > Options > Component > Align summaries vertically).
7. In the Filter screen, define some filter condition(s) to filter the data displayed in the table.

   To define a filter condition, click the Add Condition button to add a condition line, then from the field drop-down list, select the field on which the filter will be based, set the operator with which to compose the filter expression from the operator drop-down list, and in the value combo box, type the value of how to filter the field or select the value from the drop-down list.

8. In the Style screen, specify the style of the table, and if required, click the Page Setup button to set the page settings.
9. When done, click Finish to create the report.

See also:

- Table Report Wizard for detailed explanation about options in this wizard.
- Tables for details about the table component.

See 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`.