Drag the Table element from the Elements palette into any band of the report. The Table Wizard enables you to create a table from a new or existing dataset.
|
Table Wizard - New Table |
To create a table from a new dataset:
| 1. | Select Create a Table from a new dataset and click Next. The Dataset window appears. |
|
Table Wizard - Dataset |
| 2. | Name your dataset and select your option: Create new dataset from a connection or datasource or Create an empty dataset. For this example, choose the first option and click Next. You'll be prompted to select a datasource and design query. |
Table Wizard - Dataset Datasource |
|
| 3. | Select a data source and enter an SQL query such as: select * from orders and click Next. You'll be prompted to select dataset fields. |
Table Wizard - Dataset Fields |
|
| 4. | Select the fields you want in your table and add them to the Fields list on the right. Then click Next. You'll be prompted to select the fields to group by from among your chosen fields. |
Table Wizard - Dataset > Group By |
|
| 5. | Select one or more fields to group by and move them to the Fields list on the right. Click Next. You'll be prompted to select a connection. |
Table Wizard - Connection |
|
| 6. | Select a data connection option. Your options are: |
| • | Use the same connection used to fill the master report (the option used in this example) |
| • | Use another connection (you'll provide a connection) |
| • | Use an empty datasource |
| • | Use a JRDatasource expression (you'll enter a JRDatasource expression) |
| • | Don't use any datasource or connection |
| 7. | Click Next. You'll be prompted to choose the fields for produce table columns. |
Table Wizard - Table Columns |
|
| 8. | Select one or more fields to for table columns and move them to the Fields list on the right. Click Next. You'll be prompted to select a layout. |
Table Wizard - Layout |
|
| 9. | Select the layout for your table, and click Finish. The table appears where you dragged the table element in your report. |
Report Containing a Table |
|
To create a table using an existing dataset:
Creating a table using an existing dataset is largely the same as creating a table using a new dataset.
| 1. | In the Dataset window of the Table Wizard, select Create a Table using an existing dataset. |
| 2. | Select a dataset from the drop-down. |
Table Wizard - Dataset |
|
| 3. | Click Next. You'll be prompted to select the connection. |
From this point the steps are the same as creating a table using a new dataset.
Recommended Comments
There are no comments to display.