How to add row group headers to a "headerless" style report?
Method 0:
If there is an existing table (or using wizard), there is no better way to do it than the one you explained. By deleting and readding the group.
Method 1:
You can design the tablix from scratch in report designer. Add the tablix, set the dataset and add the group.
Method 2:
The other way to do is modify the xml code(RDL).
Cleanup for your design: Remove the second row and add Country data element to detail row, so your design look something like this without the vertical merge and dotted lines.
To add group headers the way you want via the xml code you need to move the TablixCell
from TablixRow
to TablixRowHierarchy
.:
Cut the
TablixCell
fragment underTablixRow
->TablixCells
containting your country data and keep it in seperate notepad/document.Delete the corresponding
TablixColumn
underTablixColumns
Rename
TablixCell
Node toTablixHeader
Add the
<Size>1in</Size>
fragment betweenTablixHeader
andCellContents
Paste the
TablixHeader
fragment underTablixRowHierarchy -> TablixMembers -> TablixMember
in betweenSortExpression
andTablixMembers
.- Remove one of the
<TablixMember />
fragment under theTablixColumnHierarchy
. It should match the number of column in the report except the columns before the dotted lines (or before the dotted group).
TablixHeader element defines the header for the group.
TablixCells element defines the list of cells in a row of the body section of a Tablix
Here is the link to RDL specifications. It doesn't have 2012 version but the 2008 version still looks good.
Here is the schema diagram of Tablix from RDL specifications. When your data is in the TablixHeader then the columns will be in vertical merge and with the dotted lines outside the tablix row. When it is in the TablixCells it is part of TablixRow.
There doesn't seem to be an easy way to add the category columns back.
The easiest way I know of is to add a parent group for the same field to the row group that you want the column back for. This will create a new category column and you can delete the old grouping. Just only delete the group, not the related cells & columns.
In your case you would add a parent group on the Country
field to the existing Country
grouping. You should now have your category column for country back and you can delete the original Country
grouping.
I would follow these steps:
- Under "Row Groups" right-click the table1_Details_Group entry and choose Add Group / Parent Group
- For Group By, choose Country. Click OK
- Under "Row Groups" right-click the new Country entry and choose Delete Group
- Choose Delete Group Only. Click OK
- Right Click the original Country column and choose Delete Columns
- Right Click the Country Group row and choose Delete Rows
Here's the final output: