开发者

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:

How to get group headers to span a Tablix column

But you want it to look like this:

How to get group headers to span a Tablix column

Step by step, here’s how I’ve figured out

  1. Add your table (Tablix) and ensure the DataSetName property is set

How to get group headers to span a Tablix column

  1. Highlight the details row and right click. Add a parent group to the row

How to get group headers to span a Tablix column

  1. Set the group by to e.g. TeamDescription, and check Add group header

    How to get group headers to span a Tablix column

  2. The Row Groups panel should look like this. The indent for the Details is needed.

How to get group headers to span a Tablix column

  1. 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.

How to get group headers to span a Tablix column

  1. 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.

  2. Then delete the first column as that’s now redundant.

  3. Here’s how it should look by now:

How to get group headers to span a Tablix column


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜