Making a Table Group
To make a Table Group, you simply need to click the Make TableGroupbutton in the Configure Table tab of your table. You will be able to tell that it worked when you notice a Table Group icon displayed in the lower left corner of the table component, and your Configure Table tab has now changed into a Configure TableGroup tab.
We can see our original table listed in the Configure TableGroup tab, and we have the option to add additional tables by clicking the Plus icon. Adding a child table will add a table that is a child to the table that is currently selected in the Table Group list. Adding a peer table will add a table that is a peer to the currently selected table. We can add as many of each of these as we need.
For example, in the image below I have added two child tables to my original Fruit Data table. I then have two peer tables to Fruit Data, one of them is a standalone table, while one has a child table with the child also having a child table.
Navigating Within Table Groups
As you can see from the image above, the Table Group hierarchy can get quite confusing very quickly. It is important to understand how each part of the Table Group works, and to always be aware of which table you are actually looking at inside the Table Group. To view a different table within the Table Group, simply select it from the hierarchy. The table displayed in the design area will switch depending on which table you have selected.
Fruit Data Selected
This allows you to get a quick preview of how each of the tables within the Table Group are setup. To go in and configure an individual table within the Table Group, select it from the hierarchy and then click on the table object in the design area. The Configure TableGroup tab in the Property Inspector should change to the Configure Table tab, and will display properties relevant to the table you had selected. This allows you to add a Data Key, set grouping, configure relevant row styles, and format the table in any way that you want. After configuring the table, we can navigate back to the Table Group configuration by clicking on the Table Groupicon in the bottom left corner of the table.
At the bottom of the Configure TableGroup tab, there is an option called Start on new page. With this option enabled, we can force the next table in the list to start on the next page instead of immediately after the previous table. This will only apply to the table that is currently selected.
In the Configure TableGroup tab, we can modify the hierarchy of the Table Group using the Arrowbuttons to the right of the table list. This allows us to change the order that the tables appear in, change a peer table into a child table, or change a child table into a peer table. If at some point, you realize you have added too many tables, you can also use the Trash icon to remove it. Be careful, as removing a table that has children will also remove the child tables.
Finally, if you ever want to cancel the Table Group click the Deleteicon to do so.
Child versus Peer
When adding tables to a Table Group, they can be added as either a "Child" or "Peer" table. These terms are always relative to adjacent tables in the group's hierarchy. Thus a table that is a child to one table may have some peers, as well as its own child tables . You can always tell the relationship between two tables by the indentation of each table.
In regard to the image above, the following statements are true:
- Both Table 1 and Table 2 are peers. This is denoted by the matching indentation.
- SubTable 1 and SubTable 2 are both children to Table 1, because they are indented over from their parent.
- SubTable 1 and SubTable 2 are also peers to each other, because they have a matching indentation.
- SubSub 1 is a child to SubTable 2, and does not have any peer or children tables.
When the report is generated, the first row of Table 1 will appear first. Each row of Table 1 will generate an instance of SubTable 1 and SubTable 2. Furthermore, each row of SubTable 2 will generate an instance of SubSub 1. After all of Table 1 has been represented on the report, Table 2 will appear on the report.
The behavior of Peer and Child tables are further described below.
Individual Datasource in Singular Table
Table Group with Two Different Datasources
- Once you have your Data set up from the above example, click on the Design tab and add a Table component to your report.
- With the table created, add a Header row to the table. Drag all of your Equipment details into the table, and add header titles for each column
Parent Table - 'Equipment'
- Now that we have a base table, click the Make TableGroup button at the bottom of the Property Inspector.
- Once you make your TableGroup, you're ready to create a Child Table. In the ConfigureTable Group tab, make sure the Equipment table is selected and click the plus icon
- A Child Table has its own datasource and uses a nested query to pull data from the database. Double click on the child table to select it and see the details for that table. Note: You can switch back to the Configure TableGroup tab by clicking on the Table Group button in the lower left of the Table component.
- Drag the child datasource (i.e., EquipDowntime) from the Key Browser to the Key field in the Configure TableGroup tab.
- Next, add a header row with column name text.
- Drag your columns from the Key Browser to the appropriate columns in your table.
Child Table - 'EquipDowntime"
- Go to the Preview panel to view the report. You'll notice the Child Table is now embedded in the parent table.