问题描述
我在 SSRS 报告中有一个表格,该表格仅显示一个组,而不是表格详细信息.我想找出正在显示的项目的行号,以便我可以使用色带.我尝试使用Rowcount(Nothing)",但我得到了详细信息表的行号.
I have a table in a SSRS report that is displaying only a group, not the table details. I want to find out the row number for the items that are being displayed so that I can use color banding. I tried using "Rowcount(Nothing)", but instead I get the row number of the detail table.
我的基础数据类似于
ROwId Team Fan
1 Yankees John
2 Yankees Russ
3 Red Socks Mark
4 Red Socks Mary
...
8 Orioles Elliot
...
29 Dodgers Jim
...
43 Giants Harry
我只显示组的表格如下所示:
My table showing only the groups looks like this:
ROwId Team
2 Yankees
3 Red Socks
8 Orioles
29 Dodgers
43 Giants
我希望它看起来像
ROwId Team
1 Yankees
2 Red Socks
3 Orioles
4 Dodgers
5 Giants
推荐答案
您可以使用 RunningValue 表达式,类似于:
You can do this with a RunningValue expression, something like:
=RunningValue(Fields!Team.Value, CountDistinct, "DataSet1")
DataSet1
是基础数据集的名称.
DataSet1
being the name of the underlying dataset.
考虑数据:
创建一个简单的报告并比较 RowNumber
和 RunningValue
方法表明 RunningValue
给出了您需要的结果:
Creating a simple report and comparing the RowNumber
and RunningValue
approaches shows that RunningValue
gives your required results:
这篇关于SSRS 2005 中组的行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!