ActiveReports 18 .NET Edition
Report Authors: Designer Components / Report Controls / Page/RDLX Report / Tablix
In This Topic
    Tablix
    In This Topic

    A Tablix data region displays data in cells that are arranged in rows and columns. It provides enhanced layout capabilities ranging from the creation of simple tables to advanced matrices. Tablix is essentially a combination of two data regions, the table, and the matrix. Therefore, it provides all the features of a table and a matrix along with added capabilities including support for multiple adjacent groups on rows or columns and improved layout flexibility with stepped group layouts.

    By default, each tablix cell contains a TextBox control, and the function for each cell is determined by its location. You can change the layout of the Tablix data region using the LayoutDirection property.

    Structure

    Tablix structure

    The Tablix data region is composed of four areas denoted by dotted lines on the design surface - the corner, the row group area, the column group area, and the body.

    Corner

    The Corner element is located in the upper-left corner, or upper-right corner if a tablix has the LayoutDirection property set to Rtl. The layout direction applies at preview time only. This area is automatically expanded horizontally or vertically when you add a new column or row groups. You can merge cells inside the tablix corner and insert a data visualizer such as a TextBox or Image. 

    A corner may contain only static cells that are rendered only once in Tablix. 

    Column Group

    A Column group is represented by square brackets above the columns. Tablix column groups are located in the upper-right corner (upper-left corner for the Rtl layout). A column group represents a member of the column groups hierarchy and displays the column group instance values.

    Row Group

    A Row group is represented by square brackets on the left side of the rows. Tablix row groups are located on the lower-left corner (lower right for the Rtl layout). A row group represents a member of the row groups hierarchy and displays row group instance values.

    Body

    The Body element is used for displaying aggregated data with respect to row and column grouped data in the report. The body may contain only static cells that are rendered only once in Tablix. 

    Static and Dynamic Rows and Columns

    Rows or columns in the Tablix data region can be static or dynamic. The Tablix data region contains multiple rows and columns that provide a grid-type layout, where you can add or remove static or dynamic rows and columns in order to display your data efficiently.

    Static/dynamic rows and columns in Tablix 

    Row and Column Handlers

    When you select a Tablix data region, the row and the column handles appear. These handles help you to work with a Tablix and visually specify the type of data added in your tablix layout.

    The following table shows the different types of handles that appear in a Tablix data region.

    Handle Icon Description
    Tablix row/column with one outer group Row or column with one outer group.
    Tablix one outer and one inner group One outer group and one inner group.

    Tablix with one outer group with an extra row for totals and one inner group

    One outer group with an extra row for totals and one inner group.

    Tablix Layout Actions

    The Tablix data region provides context menu options to perform basic layout actions. You can access layout options for Tablix rows from the context menu by right-clicking on a selected row.
       

    You can access layout options for Tablix columns from the context menu by right-clicking on a selected column.

    Group Editor

    The Group Editor window gets displayed or hidden by the Group Editor icon, located on the left of the Design area. The Group Editor contains the following groups:

    The static column cell displays the label YEARS and CATEGORY NAMES in the Tablix data region. The static row cell displays the label Total in the Tablix data region.

    The image below displays the subjects in a row group. Nested column groups display practical and theory scores for the students. The total row displays the total scores for all of the subjects.

    Tablix with Row and Column Groups 

    Tablix Features

    Column and Row Groups

    Groups categorize the report data using a specified expression. You can add a group by using the context menu options or in the Group Editor component that is part of the designer.

    In Tablix, you can add row/column groups in the following ways:

    Important Group and Layout Properties for Tablix Groups 

    To add a group

    1. Select the Tablix data region in the design area.
    2. Right-click and select any group action in the context menu that appears.
    3. Or, with a Tablix selected, click Group Editor on the left of the Designer.
      Group Editor in Tablix

    Totals

    The intersection of a Row and Column Group displays one or more summary values. For example, in a report output, Row Groups may display media types, Column Groups - quarters, and their intersections may show the Sales for each media type in each quarter.

    A tablix can display two types of totals.

    To add a total,

    1. Right-click a Tablix cell and select Add Total > Before or Add Total > After menu item.
      If a group does not have a parent, then the grand total will be inserted. Otherwise, the subtotal for the parent group will be created.
      Add total in Tablix
    2. To insert additional totals, you can add rows and columns and set an expression to calculate sum for the newly added cells.
      Expression in Tablix context menu

    Merge Cells

    Tablix cells with the same value in a row group or a column group area are automatically merged. In the case of static cells, you can combine adjacent cells in horizontal (same row) or vertical (same column) direction into a single cell. For example, you may want a column header to span across the columns.

    To merge cells,

    1. Select the cells (Ctrl+Click) and then right-click.
    2. From the context menu, select Merge Cells.

    Auto Merge

    The AutoMergeMode property lets you set the mode to merge the adjacent cells (text boxes) in a row group with the same value. This property takes Always, Never, and Restricted values. The row groups with the same data values and with AutoMergeMode property set to:

    Let us take an example. In the following simple Tablix data region, 'District' column is Outside Group - Right to the 'Region' column group. We want the 'District' values to merge in case the 'Region' values are the same.
    The tablix without AutoMergeMode set in any cell looks as follows:

    Example for cell merging

    Let us set the AutoMergeMode property for the 'District' and the 'Region' values.

    1. Select the cell with District field in the row group and set the Layout > AutoMergeMode property to 'Restricted'. This merges districts depending on whether the corresponding regions (cells in the previous column) are merged.
    2. Select the cell with Region field in the row group and set the Layout > AutoMergeMode property to 'Always'. This merges the cells with similar regions.
    3. Preview the report. Here's how the tablix will look like.

      Example for cell merging

    Repeat to Fill (Page report)

    If you set the RepeatToFill property to True (the default value is False), the Tablix will fill extra space with empty rows.

    Setting the RepeatToFill property to 'True' (default value is 'False') fills the tablix with empty rows to reach the Fixed Height of the tablix. So, each page of the report displays the tablix with the same height. For example, the following image shows the page of a report where RepeatToFill property for the Tablix data region is set to 'False':

    Example of Tablix with RepeatToFill set to False 

    Then, in the Properties window, set the RepeatToFill property to 'True'. At the report preview, you will see that the tablix now has additional empty rows on the same page of the report.

    Example of Tablix with RepeatToFill set to True 

    Freeze Rows and Columns (RDLX Reports)

    When you use a Tablix 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 row and column headers looks like in JS Viewer.

    Tablix with frozen rows and columns

    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.

    See Also