Adding Header Rows
The header row ties the crosstab value columns together and provides data-driven identification for them as well. Before proceeding, look at the header in the table below; it consists of a blank area that spans two columns, three areas that will contain data (the year number) and span three value columns each, and an area labeled "Total" that spans three columns:
Start by adding a Header Row element to the Crosstab Table, as shown below, then "build-up" the row using a combination of elements. Set the Header Row element's required ID and its Header Position attribute to Top.
Next, add a Column Cell element that will be a "spacer" or placeholder; its attributes are set to span the two columns beneath it. It contains nothing.
Then, add a Crosstab Table Header Column element, with a required ID and configured to span three columns.
Beneath the Crosstab Table Header Column add a Label element and set its Caption attribute value to the token @Data.rdCrosstabColumn~. It will display the actual data from the datalayer column identified as the Crosstab Column in the Crosstab Filter's attributes (in our example, this is "OrderYear").
Finally, add a second Column Cell element and configure it to span three columns:
Beneath the Column Cell add a Label element with the word "Total" as its Caption attribute value.
The elements added in this step create the header row, highlighted in yellow:
And the resulting table, with header looks like this:
Adding Group Header Rows
You can also add Header Rows to grouped Data or Value Columns. This feature works like the one mentioned above, but instead of creating a Header Row along the top of the Crosstab Table, it allows you to add Header Rows to any Data Columns you have grouped together. For information on grouping Crosstabs, see Working with the Crosstab Filter.
Add a Header Row element beneath a Label Column Group element and give it an ID:
You can adjust the span of the Header Row by adding a Column Cell element and changing the Column Span attribute. In this example, we're adjusting the Column Span to 2.
Add a Label element beneath the Column Cell and give it a Caption based on the Data Column.
Then, add a Label element beneath the Crosstab Table Header Column and give it a Caption using the special Crosstab Table token " @Data.rdCrosstabColumn~", shown below:
You can repeat the previous steps for the Crosstab Filter Label Column (in this example, Region) and additional Secondary Crosstab Label Column(s) (in this example, Product Id).