The Table data region is available in Page and RDLX reports. It is used to display the information in tabular format in Tabular Reports. The Table data region consists of columns and rows that organize data. By default, a table has three columns and three rows, a total of nine cells, where each cell is filled with a text box. At design time, you can add or remove columns, rows, and groupings to suit your needs. Also, you can embed other data regions in the table cells.
Column is a vertical group of cells in a table. If you right-click a column handler, you can add new columns or delete existing ones using the context menu that appears.
Row is a horizontal group of cells in a table. If you right-click a row handler, you can add new rows or delete existing ones using the context menu that appears.
Cell is the intersection of a row and column. By default, each table cell contains a TextBox report item. But you can replace it with other report controls, such as an Image, by drag-and-drop the corresponding item from the Toolbox into the cell.
Header row appears at the beginning of a table. If its RepeatOnNewPage property is set to 'True', it prints on every page taken by the table content. You could use the header row to display the title or the logo of a tabular report. A table may have several header rows.
Group header row appears at the beginning of a group. If its RepeatOnNewPage property is set to 'True', it prints on every page taken by the table content. You could use a group header row to display the group's field value or summary value. A group may have several header rows.
Details row repeats for each bound dataset record that passed through the dataset filters and data region filters. If a table has the grouped data, then the details row appears between the header and footer of the enclosing group instance. A table may have more than one details row.
Group footer row appears at the end of a group. If its RepeatOnNewPage property is set to 'True', it prints on every page taken by the table content. You could use the group footer row to display summary values. A group may have several footer rows.
Footer row appears at the end of a table. If its RepeatOnNewPage property is set to 'True', it prints on every page taken by the table content. You could use the footer rows to display grand totals.
The Table data region provides context menu options to perform basic layout actions. You can access layout options for Table rows from the context menu by right-clicking on a selected row.
You can access layout options for Table columns from the context menu by right-clicking on a selected column.
You can set the Table properties in the Table dialog. To open it, with the Table selected on the report, under the Properties window, click the Property dialog link.
Once you place the Table data region on a report, you can add data to its cells. As with any data region, you can drag fields from your Fields list onto cells in the table. Although the default report control within each cell of the table is a text box, you can replace it with any other report control or a data region. When you drag a field into a cell in the details row, ActiveReports automatically provides a label in the table header. As with all report controls, you can use expressions to further manipulate the data within the cells of the table. For more information, see Expressions.
Alternatively, in the table, select a TextBox in the Details row and, from the Fields Selection Adorner, select a field from the list.
Groups provide a way to organize data and make data analyses easy. In a Table data region, you can also create a document map based on the groups by specifying the group expression in the Document map label option. For information on document map and navigation, see the Document Map topic for more details.
Let us understand grouping using the report shown. The report consists of a Table that displays Movie details – Title, MPAA, and User Rating fields. The report connects to the 'Movie' table from 'Reels.db' data source on GitHub.
You can group the table data according to the other dataset field, 'Year Released', to group the details based on the year when a movie was released.
The following steps add a group in the table using Group On expression.
Another way of grouping the table data is by grouping the Details row without adding a group. The Detail Grouping groups the data in such a way that only one row per distinct grouping value or expression is displayed for each row of data in Details row. Also, it does not add a Group Header and Group Footer. Detail grouping is useful when you do not want the values to repeat within the details as many times as they are present in the data source.
Let us use Detail Grouping to group the table data. For example, we have a report with the Table that displays Movie details – Title, MPAA, and User Rating fields. The report connects to the 'Movie' table from 'Reels.db' data source on GitHub.
You can combine adjacent cells in horizontal (same row) or vertical (same column) direction into a single cell. Vertical cell merging is possible within the same row type, that is, within the Header, Group Header, Footer, Group Footer, or Details row.
To merge cells,
The AutoMergeMode property lets you set the mode to merge the adjacent cells (text boxes) in details row with the same value. This property takes Always, Never, and Restricted values. The details row with the same data values and with AutoMergeMode property set to:
The following steps take you through how to add automatic merge to the cells in the following table. The report connects to the 'Orders' table from 'NWIND.db' data source on GitHub.
When you use a Table data region containing a large amount of data in an RDLX report, the user must scroll to see all of the data. On scrolling the column or row headers out of sight, the data becomes difficult to understand. To resolve this problem, you can use the FrozenRows and FrozenColumns properties that take effect in the JSViewer in Galley mode, and allow you to freeze headers so that they remain visible while scrolling through the data region. You can freeze as many rows or columns as you have headers in the data region.
Here's how a report with one frozen column looks like in JS Viewer.
If any header cells that you want to freeze are merged, you should not set the FrozenRows or FrozenColumns property to a value that would split a merged cell.
To display data from different datasets, you can use nested tables that are bound to different datasets. You can do any one of the following to achieve this:
For example, the following report shows three nested Table data regions that fetch data from three different datasets.
The report connects to the 'NWIND.db' data source on GitHub.
Table1 is bound to 'Products' dataset, Table2 is bound to 'Invoices' dataset, and Table3 is bound to 'Customers' dataset. The parent table, Table1, shows the Product Name and Units In Stock information from the Products dataset. For each ProductID, child table, Table2 shows the Ship Name and Ship Country information from the Invoices dataset. And for each CustomerID, the child table, Table3, shows the Contact Name, City, and Phone information from the Customers dataset.
Let us create this report using both methods.
For the child tables, add a filter using the Filters property as elaborated below:
Similarly,
For each child table, we create a parameter to pass to the dataset and then modify the dataset query to filter the dataset fields.
The following steps elaborate the procedure.
Similarly,
Filtering allows you to set filters on a large set of data that has already been retrieved from the data source and use them with datasets or data regions to limit the information you want to display on your report. Although not as efficient performance-wise as query parameters which filter data at the source, there are still scenarios that demand filters. The obvious case is when the data source does not support query parameters.
To apply a filter in a Table data region,
Sorting helps better organize and present data in your report, you can sort alphabetically or numerically in ascending or descending order.
To apply sort in a Table data region,
You can use interactive sort or user sort on a TextBox control to sort data columns within a data region in a published report. The Interactive Sort page in the TextBox dialog allows you to enable interactive sorting. See Sort Data topic for further information on applying this kind of sorting on a table.
The dynamic columns in tables are the columns that grow or shrink depending on the visibility of other columns. When a Table has hidden column(s), the other column(s) can be made dynamic by setting the column's AutoWidth property to 'Proportional'.
So, for example, in the following table, we have five columns: Title, MPAA, User Rating, Country, and Language. The visibility of columns MPAA, User Rating, and Language is being toggled by a text box. We want the columns Title and Country to grow or shrink when the visibility of the other three columns is toggled.
The above report can be created as elaborated below:
You can control the number of Table Details rows, displayed on a page, with the MaxDetailsPerPage property. If the number of rows exceeds the value, specified in the MaxDetailsPerPage property, a page break is added after the specified number of rows.
For example, we have a Table with six Details rows.
If the MaxDetailsPerPage property is set to '5', a page break is added after five rows and the Table is split to two pages.
If a Table contains a group (for example, a SalesID group) and the MaxDetailsPerPage property is set to '5', a page break is not added after five rows because, in this case, the Details rows are counted in each group. In the screenshot below, each group has three Details rows and no page break is added.