是否可以在 SSRS 2008 中创建跨越矩阵所有列的行?
是否可以向 SSRS 2008 矩阵添加一行以跨越矩阵的所有列?
这个粗略的图表大致显示了我正在寻找的内容:
基本思想是每个行项目都是一个人,每一列都是该人表单中的一个字段。字段本身是动态的(并作为矩阵上的列组实现)。还包括其他列组来附加非动态表单字段,例如输入记录的时间和输入者。每个人的记录下都有一个评论字段,该字段应涵盖其上方的所有表单字段。
目前,我已将矩阵嵌入到另一个 Tablix 中,矩阵中包含名称和字段,父 Tablix 中包含注释。这适用于数据(矩阵的每个实例最终都是一行),但标题重复得太频繁(每人一次),因为它附加到矩阵。关于如何解决这个问题,我唯一的想法是在父 tablix 中创建具有相同分组的另一个矩阵,并使用它来显示标题...但这将需要大量的手动同步来保持两个矩阵相同的。
编辑:这里的关键问题是使第二行跨越多个列组。
Is it possible to have add a row to an SSRS 2008 Matrix that spans all of the matrix's columns?
This crude diagram shows roughly what I'm looking for:
The basic idea is that each line item is a person, and each column is a field in a form for that person. The fields themselves are dynamic (and implemented as column groups on the matrix). Additional column groups are included to append non-dynamic form fields, like the time the record was entered and who entered it. Under each person's record is a comments field, which should span all of the form fields above it.
At the moment I have the matrix embedded in another tablix, with the name and fields in the matrix and the comments in the parent tablix. This works for the data (each instance of the matrix ends up being one row), but the header repeats too often (once per person) because it's attached to the matrix. The only thought I have as to how to fix this is to create another matrix in the parent tablix with the same grouping and use it to display the headers... But this will require quite a lot of manual synchronization to keep the two matrices the same.
Edit: The key problem here is making the second row span multiple column groups.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您可以执行以下操作:
添加组...父组...
您现在应该看到类似以下内容:
现在您只需将 Value1 字段及其标题移到新列下方的矩阵分隔符右侧即可。完成后,只需删除刚刚从中复制 Value1 的未分组列,并确保选中仅删除列复选框。
您的成品应如下所示:
Here's what you can do:
Add Group... Parent Group...
You should now see something similar to this:
Now you just need to move the Value1 field and it's header over under the new column to the right beyond the matrix dividers. Once that's done, simply delete the ungrouped column where you just copied Value1 from and be sure to select Delete columns only checkbox.
Your finished product should look like this:
尝试在列组“标题”中添加分组表达式 (1=1)。然后需要定义一个详细字段。如果您使用正确的数据定义其他组,则“标题”将延伸到所有详细信息列。您可能需要合并,具体取决于其他选项。
Try adding in you column group "header" with a grouping expression of (1=1). Then a detail field will need to be defined. If you define the other group with correct data then the "header" will stretch across all details columns. You may need to merger depending on other options.
这是可能的 - 以上答案是部分答案,省略了一个关键步骤:合并子行的单元格。
首先,右键单击分组的行,然后选择“插入行”->“插入行”。在组内 - 下面,您将得到两行,单元格在列上对齐
其次,ctrl 单击新行中的所有单元格(即没有数据的行),然后右键单击突出显示的单元格之一,然后选择
合并单元格
。现在你已经有了你喜欢的桌子了。要向新行添加值:首先右键单击新的(多列)单元格,选择
创建占位符
,然后将所需的数据集项目添加到占位符。It is possible - And the above answers are partial answers leaving out one key step: Merging the cells of the child row.
First, right click on your grouped row, then select
Insert Row -> Inside Group - Below
and you will get two rows with the cells aligning on the columnsSecond, ctrl click all the cells in your new row (ie row without the data) then right click on one of the highlighted cells, and then select
Merge Cells
.Now you have the table you like. To add a value to the new row: first right click your new (multi column) cell,select
Create Placeholder
, and then add the dataset item you desire to the placeholder.[编辑]
经过多次尝试,我想说这在 SSRS 中是不可能的。我能想到的最好方案是跨第 1、2 和 3 列的组页脚,但不跨用户列。
[原始回复]
我最近做了类似的事情。
首先,您使用什么工具来创建 SSRS 报告? (我使用 SQL Server Business Intelligence Development Studio)
您需要创建一个行组(按人员分组)
附加 将行添加到“设计”视图中的表格中(右键单击,“插入行 --> 组内 - 下方”)。
将表达式添加到提取“注释”列值的行 (=Fields!Comment.Value)。
让我知道这是否有帮助...
[Edit]
After several attempts, I'm going to say this isn't possible in SSRS. The best I could come up with is a group footer that spans columns 1,2, and 3, but not the User column.
[Original Response]
I recently did something similar to this.
First, what tool are you using to create SSRS reports? (I used SQL Server Business Intelligence Development Studio)
You'll want to create a row group (grouped on Person)
Append a row to your table in "Design" view (Right click, "Insert Row --> Inside Group - Below").
Add an expression to the row that pulls the value for your "Comment" column (=Fields!Comment.Value).
Let me know if that helps...
最简单的方法是创建一个仅包含一列和行分组的 Tablix。
然后,您在该组内创建两行。
在组内的第一行中,插入一个矩阵,然后您可以根据需要对其进行子分组。
我刚刚遇到了类似的问题,这就是我的解决方案。
我用头撞墙很长时间,直到我意识到问题的解决方案不是“使单元格跨越多个列组”,而是“使单元格分成多个列组”。
The easiest way to do this is to create a Tablix with only one column, and your row grouping.
Then, you create two rows inside this group.
In the first row inside the group, you insert a Matrix, wich you can then subgroup as you prefer.
I just had a similar problem, and this was my solution.
I banged my head against the wall for a lot of time, until i realized the solution to my problem wasn't "making a cell span multiple column groups", but "making a cell split into multiple column groups".
您可以通过为每个人使用子报表来实现目标。子报表将接收员工 ID 并为您创建层次结构。确保子报表列宽与父报表的宽度匹配。
You can accomplish the goal by using a subreport for each person. The subreport will receive the employee id and create the hierarchy for you. Make sure your subreport column widths match the widths of the parent report.