6.2.2 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 elements can be bound the same query.
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. Select the Data Source tab in the left-side panel (next to Toolbox tab). This opens the Data Source panel.

2. In the Data Source 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. Now, when the table is selected, the Data Source panel displays only the fields for the 'Order details' query, and the Binding panel displays the query name.

In the next steps, you will specify grouping and summarization.
5. Select 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 symbol next to the field name in the 'Company' cell.

6. Repeat the previous procedure to add 'Product' as another grouping column.
7. Select 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 process to add 'Total' as another summarized column.

9. Press the 'Save' button to open the 'Save As' dialog box, and select the Local Report tab. Enter “Sample Sales Report” as the 'File name'.


10. Press 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 to dynamically bind data to a report element at runtime. See Binding Queries in Report Scripting for more information.
| << 6.2.1 Adding Text and Presentation Elements | © 1996-2013 InetSoft Technology Corporation (v11.5) | 6.3 Saving a Report to the Working Repository >> |