I am trying to create a header row for a matrix in my SSRS report. Currently my matrix is configured as the following:
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:
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:
Is it possible to add the header row? And if so, what would be a good way to accomplish this task?
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.
Related
I'm creating a report that has 5 columns. However, one column can have no data and in that case I need to hide it. This works using the 'Hidden' property of column but when the column is hidden, I want to make the first column wider. Is there any way to do this in expression?
The only solution I found is to have multiple same tablixes with different column count and then show or hide each tablix appropriately if the specific column has no data. (by checking 'Max' value in column).
Unfortunately, it's not possible to enter an expression to the column width property but if you simply need to change the width of one other column when the first is hidden, I've come up with a workaround that works fairly well.
The idea is a little easier and requires less data to load than your current solution. Basically, you'll create an identical width column that is simply empty -- but set the borders to appear as if it is simply part of another column. So you'll simple reverse the expression used to hide the column with no data in the hidden property. To achieve this, depending on where you choose to add the extra space column, you'll have to adjust the borders of the adjoining cells where there is no right border on the cell to the left and a left border on the cell to the right. Depending on your layout, you would only need a top and bottom border on the extra space column cells.
I did something similar with a report that has 3 pages and 11 columns -- but 8 of the columns changed from page to page. I had to hide one column, show another, and used expressions in column headers and detail rows to simply change the data in each column based on a field that returns the type of the data.
I have an SSRS matrix that has one level of row groups and two levels of column groups. I have a textbox that is positioned inside one of the column groups, and outside of the other one, which is what I want. But I also want this textbox to be positioned inside of a row group.
Basically, I would like #1 in the screenshot below to have a row group associated with it so that #2 is inside that row group.
My goal is to conditionally set the row-visibility for the first row. But "row visibility..." is greyed out. As far as I can tell, the way to get the option is to make sure it's inside of a row group.
The reason I want to set visibility is because the user has the option to show or hide charts, and separately to show or hide data. If the user selects both charts and data, then I don't need the first row because the label for the data can describe the chart as well. But if the user only selects charts, then I need that first row.
If there's another approach outside of minimizing the row height, I'm all ears.
Though I'm still interested in whether this puzzle is even solvable, and if not, why not.
Steps to Repeat
A version of this problem can be repeated as follows:
Insert a new matrix in a report
Just fill in dummy values, such as a blank space, into the "RowGroup1" and "ColumnGroup" "Group On" expressions.
Add a parent group to the column group, and similarly just give it a dummy grouping expression.
Delete the second row of the matrix, via "Delete Rows Only"
You now have a matrix with the same problem. Namely, get the second cell of the first row, to be inside of a row grouping.
Sample Report showing where header should span
I hope the attached image explains succinctly what I am asking. I have a Matrix with a parent row group, a child row group, and a column group. I need to have a title for each group that spans a column group. The title will be the value of the Parent Row Group. Obviously by it's nature, a column group may be one or more columns which makes this very tricky (I hope not impossible though).
Does anyone know if this can be achieved, and if so how?
Thanks in advance!
I don't 'think' this is possible due to the presence of a column group. The only way I can think of to achieve this would be to create a subreport that displays single parent group (almost identical to what you have now), with a textbox on top of the tablix containing the parent group text.
The main report would then be a single cell table bound to a dataset that just lists the parent groups. In that cell you would place you subreport.
You can just create a parent table and put your table in it. The parent table will expand with the child.
Create another table with one column.
Set the dataset to be the same as your current table.
Add grouping and group on 1.
Make the group text box the same size as your table.
Drop your table in the group text box.
Add you header.
I don't have enough reputation to comment or to upvote Hannover Fist's answer, but it is a good way to proceed. You can indeed nest tables. You just need to make sure that the cell of the outer table that you paste the expanding table into does not have any row or column groups around it: you normally get a Detail row group when you simply insert a table, and you'll need to delete that group.
Subreports work too, but it's messy to have to break a long report into many subreports just because you want spanning headers.
I know this is been asked a million times and I have done it myself successfully a number of times however better to check than to assume it can't be done in my scenario.
Is it possible to freeze the first detail column where a parent group exists?
I have a parent Group setup which is grouped on 3 columns (in Advanced Mode Row Groups there are 4 columns above the Parent group, the 4th being the first detail row header and 2 static columns between the Group and the Details, the Details being the last column and I have a number of Static Column Groups) and I have right clicked on the Tablix header to view the properties and checked under Row Headers "Keep header visible while scrolling", and it Freezes my 3 columns in my Group only. So now I just want to freeze one more column the first detail column adjacent to the group - is it possible. I have as other posts suggest goto the static column and set the FixedData for scrolling but what Static column, I tried a number of combinations.
I also tried the Fixed Data on the first Column Group however When the "Keep header visible while scrolling is checked it does not compile and when it isn't ticked it freezes vertically and might I add horizontally as well which is just wrong and it scrolls on the first detail column only and not the 3 preceding group columns!!
Answer is to make my first detail column a child group of the existing parent column so now I have 2 levels of grouping and details. Should have thought of that!
I have added a row into my report by right clicking the top row and selected add row above. Then when I try and merge all the cells in the new row it doesn't give me the option when I have selected all the cells and right click.
I can Merge 2 or 3 cells but not the whole thing.
My question is why cannot I not merge all the cells? Is there something in the a certain cell I can't see or a creation property that needs to be changed.
Thanks
There seems to be an invisible lines between the row headers and the data, and also the column headers and the data. You cannot merge across these lines.
The solution is to keep you groups and delete the row and column headers. You can put the header rows inside the data area and you can merge cells too.
Sometimes you can only merge the cells from a row if you merge the cells from the row above.
_____1__________2_________3____
A |__________|__________|_________|
B |__________|__________|_________|
Sometimes you can only merge B1-B2-B3 if you merge A1-A2-A3 first.
This problem occure with grouping. You cannot merge across group lines. I have not had a problem merging when there is not a group. There is not a way around this.
if you're trying to create a header row for the whole table. you can create a separate table with 1 column and 2 rows and insert your table into the 2nd row of the new table. the 1st row can then be used as a header
The left-most column has been auto-added as a group, so it can't be merged with cells to the right. But you can delete that column and keep the grouping.
What I do is click on the second column (inside the grouping), then 'add column to left'. Then copy all of the Group fields from the left-most column into this new column, then delete the left-most group column. You should now be able to merge the cells.