To build a table, containing data for child objects of the current object, e.g. on a Source report to build a table, containing data about tests, linked to this Source, follow the below steps:
- Right click on Design Surface, select “Insert Detail Report”, and then select the corresponding type of objects, to which the table will be bound. In our example select “Test”
- To add a row with column headers, on the added Detail Report right click, select “Insert Band” -> “Report Header”.
- Now you have two bands on the added Detail Report: a “Report Header” band and a “Detail” band. The “Report Header” band will be used to place table’s row with columns names, the “Detail” band will be used for the table rows with data.
Select the Table item in the Toolbox and draw a rectangle across these bands.
Or select data fields from the Field List by clicking them while holding the CTRL or SHIFT key and drop them onto the Detail band. Drag and drop the same fields with the right mouse button to create column headers with the corresponding field names in the Report Header band.
- Adjust bands sizes properly
The number of rows in the table on the report will automatically be calculated according to the number of corresponding child objects of the current object.
It is possible to group rows of the table by some predefined field’s value, e.g. combine rows of the tests table by “Aliquot ID” or “Material ID”. To do that right-click on “Detail Report” control and select “Insert Band” -> “GroupHeader”. Select the added “GroupHeader” control and on “Properties” pane click […] on “Group Fields” field.
On the opened Group Field Collection Editor select from the “Field Name” drop-down the field by which you want to group table row’s.
You can add multiple Group Headers to group by multiple fields.
In the example below the table rows are designed to be grouped first by “Material ID” and then by “Aliquot ID”:
The result of grouping in the report: