是否可以在 SSRS 2008 中创建跨越矩阵所有列的行?

发布于 2024-09-29 04:51:12 字数 532 浏览 3 评论 0原文

是否可以向 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:

visual example of the matrix layout 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

和影子一齐双人舞 2024-10-06 04:51:12

您可以执行以下操作:

  1. 在上方选择要添加的列分组,然后右键单击并选择
    添加组...父组...
  2. 按不会聚合数据的内容对列进行分组。您必须从数据集中选择一个字段进行分组,以便创建重叠的列分组。
  3. 选中添加组标题

您现在应该看到类似以下内容:

Matrix with columns

现在您只需将 Value1 字段及其标题移到新列下方的矩阵分隔符右侧即可。完成后,只需删除刚刚从中复制 Value1 的未分组列,并确保选中仅删除列复选框。

您的成品应如下所示:

在此处输入图像描述

Here's what you can do:

  1. Select the column grouping you want to add above and right click and select
    Add Group... Parent Group...
  2. Group the column by something that will not aggregate the data. You'll have to select a field from your dataset to group by so that it creates an overlapping column grouping.
  3. Check the Add group header box

You should now see something similar to this:

Matrix with columns

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:

enter image description here

空名 2024-10-06 04:51:12

尝试在列组“标题”中添加分组表达式 (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.

乱世争霸 2024-10-06 04:51:12

这是可能的 - 以上答案是部分答案,省略了一个关键步骤:合并子行的单元格。

首先,右键单击分组的行,然后选择“插入行”->“插入行”。在组内 - 下面,您将得到两行,单元格在列上对齐

其次,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 columns

Second, 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.

雨落□心尘 2024-10-06 04:51:12

[编辑]

经过多次尝试,我想说这在 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...

随心而道 2024-10-06 04:51:12

最简单的方法是创建一个仅包含一列和行分组的 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".

已下线请稍等 2024-10-06 04:51:12

您可以通过为每个人使用子报表来实现目标。子报表将接收员工 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文