Adding Data Elements

You will now add a new Table element. The table will display the results retrieved by several fields of a query.

Follow the steps below to add the table:

1. Click inside the body of the report to select it. This places the insertion indicator (black triangle) at the top of the body region.

2. Drag the 'Table' element from the Toolbox panel into the body of the report. This adds a blank table to the report.

 

Multiple report ele­ments can be bound the same query.

In the next steps, you will bind the table to a data source. Data binding is the process of associating a query or other data source with a report element. When the report is generated, the data retrieved by the query is placed into the element. During the data binding process, you can modify the query by hiding fields, adding conditions, grouping, etc.

Follow the steps below to bind data to the table.

1. Click the Data tab in the left-side panel (next to Toolbox tab). This opens the Data panel.

 

2. In the Data panel, expand the 'Orders' node. Then expand the 'Order details' query.

3. Select all fields in the 'Order details' query (Shift-click or Ctrl-click).

4. Drag all of the fields above the top row of the table. When you see the column selector triangle, drop the fields.

 

In design view, the table displays query field names rather than data. To view data, preview the report as described below.

This binds the table to the 'Order details' query, and displays the selected fields as columns. Note that now when the table is selected, the Data panel displays only the fields for the 'Order details' query, and the Binding panel below displays the query name.

 

In the next steps, you will specify grouping and summarization.

5. Click on the detail cell for the 'Company' field. Right-click on the cell, and choose 'Cell' > 'Group' > 'Default' from the context menu.

 

This adds 'Company' as a grouping field. Note the grouping sym­bol next to the field name in the 'Company' cell.

 

6. Repeat the previous step to add 'Product' as another grouping column.

7. Click on the detail cell for the 'Quantity' field. Right-click on the cell, and choose 'Cell' > 'Summarize' > 'Sum' from the context menu.

 

This adds 'Quantity' as a summarized field. Note the aggregation symbol next to the field name in the 'Quantity' cell.

 

8. Repeat the previous step to add 'Total' as another summarized column.

9. Save your report as “Sample Sales Report”.

10. Click the 'Preview' button in the top toolbar to preview the finished product.

 

In the example above, you defined a fixed binding for the table. You can also use JavaScript or Java code to dynamically bind data to a report element at runtime. See Binding Queries in Report Scripting for more information.

<< Adding Text and Presentation Elements © 1996-2013 InetSoft Technology Corporation (v11.4) 6.1.3 Saving a Report to the Working Repository >>