如何格式化矩阵小计中的行?
我有一个数据集,需要将其报告为矩阵。在数据集中,我汇总了一周内 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是隐藏 SSRS 报告小计部分中的行或行值的两种可能方法。下面显示的示例使用
SSRS 2005
。A。第一个选项是在单元格上设置
Initial Visibility
表达式以隐藏行。总计标签单元格将跨越两行,这可能看起来不太好。请参阅屏幕截图#1。B。第二个选项是根据范围显示单元格中的数据。这不会隐藏该行,但不会显示任何数据。请参阅屏幕截图#7。
以下部分解释了如何实现上述每个选项。
使用选项 A:
右键单击包含
Phonenumber
和CDN source
表达式的单元格,然后选择编辑组...,如图所示在屏幕截图中 #2。记下名称。在此,此示例使用名称
PhoneNumber
。单击确定
或取消
。请参阅屏幕快照 #3。右键单击包含文本
% to Total
的单元格,然后选择属性
,如屏幕截图 #4 所示。在
文本框属性
对话框中,单击可见性
选项卡并选择表达式
单选按钮。在表达式中,输入值=Not(InScope("PhoneNumber"))
。请参阅屏幕截图 #5。右键单击包含表达式的单元格以计算总计值的百分比,然后选择
属性
,如屏幕截图 #6 所示。对此单元格也重复步骤6。使用选项 B:
执行步骤 1 和 2 2 在前面的选项 A 中提到。
右键单击包含文本
% to Total
的单元格,然后选择表达式
,如屏幕截图 #8 所示。将表达式更改为
=IIf(InScope("PhoneNumber"), "% to Total", Nothing)
右键单击包含表达式的单元格以计算占总计值的 %,然后选择
表达式
,如屏幕截图所示 #< strong>9。将表达式更改为
=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)
确保根据您的要求更改表达式。
选项A的输出可以在屏幕截图#1中看到,选项B的输出可以在屏幕截图#7中看到>。
希望有帮助。
屏幕截图 #1:
屏幕截图 #2:
屏幕截图 #3:
屏幕截图 #4:
屏幕截图 #5 :
屏幕截图#6:
屏幕截图 #7:
屏幕截图 #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:
Right-click on the cell that has
Phonenumber
andCDN source
expression and select Edit Group... as shown in screenshot #2.Make note of the Name. Here, this example uses the name
PhoneNumber
. ClickOK
orCancel
. Refer screemshot #3.Right-click on the cell containing the text
% to Total
and selectProperties
as shown in screenshot #4.On the
Textbox Properties
dialog, click on theVisibility
tab and selectExpression
radio button. In the Expression, enter the value=Not(InScope("PhoneNumber"))
. Refer screenshot #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:
Perform steps 1 & 2 mentioned in previous option A.
Right-click on the cell containing the text
% to Total
and selectExpression
as shown in screenshot #8.Change the expression to
=IIf(InScope("PhoneNumber"), "% to Total", Nothing)
Right-click on the cell containing the expression to calculate the % to Totals value and select
Expression
as shown in screenshot #9.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)
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:
Screenshot #2:
Screenshot #3:
Screenshot #4:
Screenshot #5:
Screenshot #6:
Screenshot #7:
Screenshot #8:
Screenshot #9:
我能够找到另一种方法来做到这一点。由于我的数据设置方式,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