2
votes

I am trying to create a header row for a matrix in my SSRS report. Currently my matrix is configured as the following:

Matrix

If I right+click to add a new row, it will insert a row above but I cannot merge the entire row of cells to form a single row, the grouping columns stay separate:

AddedRow

My work-around has been to add a text box above the matrix, but will not keep the the rows together in a page break:

Work-Around

Is it possible to add the header row? And if so, what would be a good way to accomplish this task?

1
I think it's already answered here stackoverflow.com/questions/11285923/…niktrs

1 Answers

0
votes

I had the same issue! I wish they would let you merge across the row header; or add a new region of matrix called "title" .

My tablix also had dynamic columns, so I needed the width of the box on the top to expand and collapse with the rest of the table.

There are two ways you can handle it (that I know of)

1. Create a "parent" list object with two rows and insert the table in the second row
2. Put all the columns to the right of the row header

To solve my problem I tried both. First, I added the list with one column and two rows and I copied the entire table into the second row. The first row of the outer list is now centered and spans the entire table. It was messy because I had dynamic columns with a toggle for visibility. The outer list had to have columns that lined up with the visibility set to the same toggle. It was a messy work around because of that.

I decided to try the second method above and insert new columns on the other side of the row header.

The challenge is that row header group labels will repeat for each row... in your example RoleID would repeat down each detail row. I created an expression to only show when it was the first row of the group.

=iif(RowNumber("roleid_group") = 1, max(Fields!roleID.Value,"roleid_group"), "")

I used an expression to only show the border when it was the last row in the group:

=iif(RowNumber("roleid_group") = countrows("roleid_group"),"Solid","None")

This gives the illusion of a grouped row. Don't delete the row header columns (column 1 and 2) until you get it working because its hard to add them back. Careful: This method though doesn't work well if the text of the row title needs to wrap. (The first row of the group will be wider --row height is set to can grow.)

If there is another way I would love to know. These are both somewhat tricky but get the job done.