如何格式化矩阵小计中的行?

发布于 2024-11-13 08:18:33 字数 247 浏览 2 评论 0原文

我有一个数据集,需要将其报告为矩阵。在数据集中,我汇总了一周内 CDN 的单独总数以及一周内所有 CDN 的总体总数。我这样做是为了更容易计算报告中的每周百分比。

我正在使用 Visual Studio 2005 来构建报告。您可以在 Sheet2 上看到矩阵定义。

一切都很顺利,直到我彻底了解为止。正如您在 Sheet3 上看到的,提供的总数是正确的,但占总数的百分比不正确。事实上,我什至不需要此行在“总计”部分中可见。我怎样才能隐藏这一行?

I have a dataset that I need to report as a matrix. Within the dataset, I pull together the individual totals for CDNs within a week, along with the overall total for all CDNs within the week. I do this to make it easy to calculate the weekly percentages within the report.

I am using Visual Studio 2005 to build the report. You can see the matrix definition on Sheet2.

Everything works out fine until i get to the bottom Total. As you can see on Sheet3, the total Offered is correct, but the % to Total is not correct. In fact, i do not even need this row visible on the Total section. How can i hide this row?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

佼人 2024-11-20 08:18:33

以下是隐藏 SSRS 报告小计部分中的行或行值的两种可能方法。下面显示的示例使用 SSRS 2005

A。第一个选项是在单元格上设置Initial Visibility表达式以隐藏行。总计标签单元格将跨越两行,这可能看起来不太好。请参阅屏幕截图#1

B。第二个选项是根据范围显示单元格中的数据。这不会隐藏该行,但不会显示任何数据。请参阅屏幕截图#7

以下部分解释了如何实现上述每个选项。

使用选项 A:

  1. 右键单击包含 PhonenumberCDN source 表达式的单元格,然后选择编辑组...,如图所示在屏幕截图中 #2

  2. 记下名称。在此,此示例使用名称 PhoneNumber。单击确定取消。请参阅屏幕快照 #3

  3. 右键单击包含文本 % to Total 的单元格,然后选择属性,如屏幕截图 #4 所示。

  4. 文本框属性对话框中,单击可见性选项卡并选择表达式单选按钮。在表达式中,输入值 =Not(InScope("PhoneNumber"))。请参阅屏幕截图 #5

  5. 右键单击包含表达式的单元格以计算总计值的百分比,然后选择属性,如屏幕截图 #6 所示。对此单元格也重复步骤6

使用选项 B:

  1. 执行步骤 1 和 2 2 在前面的选项 A 中提到。

  2. 右键单击包含文本 % to Total 的单元格,然后选择表达式,如屏幕截图 #8 所示。

  3. 将表达式更改为 =IIf(InScope("PhoneNumber"), "% to Total", Nothing)

  4. 右键单击包含表达式的单元格以计算占总计值的 %,然后选择表达式,如屏幕截图所示 #< strong>9。

  5. 将表达式更改为 =IIf(InScope("PhoneNumber"), Round((IIf(Sum(Fields!Offered.Value) = 0 Or Sum(Fields!WeekTotal.Value) = 0, 0, Sum (Fields!Offered.Value)/Sum(Fields!WeekTotal.Value))) * 100, 1).ToString() + " %", Nothing)

  6. 确保根据您的要求更改表达式。

选项A的输出可以在屏幕截图#1中看到,选项B的输出可以在屏幕截图#7中看到>。

希望有帮助。

屏幕截图 #1:

1

屏幕截图 #2:

2

屏幕截图 #3:

3

屏幕截图 #4:

4

屏幕截图 #5 :

5

屏幕截图#6:

6

屏幕截图 #7:

7

屏幕截图 #8:

8

屏幕截图 #9:

< img src="https://i.sstatic.net/Lr7eJ.png" alt="9">

Here are two possible ways to hide the rows or row values in sub-totals section of SSRS reports. The examples shown below use SSRS 2005.

A. First option is to set the Initial Visibility Expression on the cells to hide the rows. Totals label cell will span to two rows, which might not look good. Refer screenshot #1.

B. Second option is to display the data in the cells based on the scope. This will not hide the row but won't show any data. Refer screenshot #7.

Following sections explain how each of the above options can be achieved.

Using Option A:

  1. Right-click on the cell that has Phonenumber and CDN source expression and select Edit Group... as shown in screenshot #2.

  2. Make note of the Name. Here, this example uses the name PhoneNumber. Click OK or Cancel. Refer screemshot #3.

  3. Right-click on the cell containing the text % to Total and select Properties as shown in screenshot #4.

  4. On the Textbox Properties dialog, click on the Visibility tab and select Expression radio button. In the Expression, enter the value =Not(InScope("PhoneNumber")). Refer screenshot #5.

  5. Right-click on the cell containing the expression to calculate the % to Totals value and select Properties as shown in screenshot #6. Repeat the step 6 for this cell as well.

Using Option B:

  1. Perform steps 1 & 2 mentioned in previous option A.

  2. Right-click on the cell containing the text % to Total and select Expression as shown in screenshot #8.

  3. Change the expression to =IIf(InScope("PhoneNumber"), "% to Total", Nothing)

  4. Right-click on the cell containing the expression to calculate the % to Totals value and select Expression as shown in screenshot #9.

  5. Change the expression to =IIf(InScope("PhoneNumber"), Round((IIf(Sum(Fields!Offered.Value) = 0 Or Sum(Fields!WeekTotal.Value) = 0, 0, Sum(Fields!Offered.Value)/Sum(Fields!WeekTotal.Value))) * 100, 1).ToString() + " %", Nothing)

  6. Make sure that you change the expressions according to your requirements.

Output of option A can be seen in screenshot #1 and output of option B can be seen in screenshot #7.

Hope that helps.

Screenshot #1:

1

Screenshot #2:

2

Screenshot #3:

3

Screenshot #4:

4

Screenshot #5:

5

Screenshot #6:

6

Screenshot #7:

7

Screenshot #8:

8

Screenshot #9:

9

划一舟意中人 2024-11-20 08:18:33

我能够找到另一种方法来做到这一点。由于我的数据设置方式,SubTotal 部分中的 WkTotOff.Value 始终是 CDN_Value 数量的一个因素。因此,我可以放置
=iif(Sum(Fields!WkTotOff.Value)/CountDistinct(Fields!CDN_Val.Value) = Sum(Fields!Offered.Value), "Silver", "White") 在我想要的行的属性中的背景颜色隐藏(在详细信息部分)。由于单个细节级别永远不会满足此标准,因此它们将保持可见。

这看起来有点草率,但这是我能弄清楚的。我也会尝试你的方法。

PK

I was able to figure out another way to do this. Because of how my data is set up, the WkTotOff.Value in the SubTotal section is always going to be a factor of the number of CDN_Values there are. Therefore, i could place
=iif(Sum(Fields!WkTotOff.Value)/CountDistinct(Fields!CDN_Val.Value) = Sum(Fields!Offered.Value), "Silver", "White") in the Background Color in the properties of the row i want to hide (in the detail section). Since the individual detail level will never meet this criteria, these will remain visible.

This seems a bit sloppy but was all i could figure out. I will try your methods as well.

PK

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