How to get group headers to span a Tablix column
I am using Microsoft Reporting Services (rdlc, that comes with Visual Studio 2010)
Suppose I want to create a report that has a Group Header, detail rows, and a group footer. (I'm using Tablix, but if there is a different way, I'm open to it).
Now, there are several columns, but I want for the group header to span the columns. Is that possible?
Another question: Suppose I want to conditionally span columns in my detail row, i开发者_运维知识库s that possible? (and how?)
Say you have teams/reps and you want to send them their leads/appointments to work on for the day.
A lot of tutorials for grouping in a RDLC Tablix look like this:
But you want it to look like this:
Step by step, here’s how I’ve figured out
- Add your table (Tablix) and ensure the DataSetName property is set
- Highlight the details row and right click. Add a parent group to the row
Set the group by to e.g. TeamDescription, and check Add group header
The Row Groups panel should look like this. The indent for the Details is needed.
- OK, at this point you’ve got what you don’t really want. ANDY and BELINDA are going to appear in a column to the left of your info.
But that’s fixable. In the spare cell above e.g. ApptStart enter e.g. [TeamDescription] and right click on it and choose to merge the cell across the other three columns. Set its alignment to center. Maybe bold too.
Then delete the first column as that’s now redundant.
Here’s how it should look by now:
You can get a field to span columns by selecting a few of the header fields and selecting the "Merge Cells" option.
As for conditionally spanning, you can't do that directly but I can think of a workaround. It really depends on the data you have so for a better answer you need to provide more information.
You could have two detail rows and conditionally hide one or the other. In one row the cells could be merged and not in the other. The only thing you couldn't necessarily control with this technique is the order of the rows, but it might work.
精彩评论