gpt4 book ai didi

reporting-services - 表中的 SSRS 行号,不包括隐藏行

转载 作者:行者123 更新时间:2023-12-04 14:01:39 37 4
gpt4 key购买 nike

我使用以下表达式获取 SSRS 中表的行号:

=RunningValue(CountDistinct("Table1"),Count,"Table1")

我还使用了行可见性属性的表达式。让我们说 Visibility 表达式是
=IIf(Fields!MyField.Value + Fields!MyField.Value <> 0, False, True) 

我的行号表达式不考虑该行是否可见。

我显然可以更改我的数据集查询,但是是否可以仅更改我的行号表达式以仅包含未隐藏的行?
谢谢

最佳答案

您可以通过组合两个表达式的逻辑来实现这一点。

假设您有一个简单的 DataSet 和一个基于此的简单 Tablix:

enter image description here

enter image description here

此处,RowNum 计算如下:

=RunningValue(Fields!val1.Value, CountDistinct, "Tablix1")

接下来,让我们使用基于其他两个字段的表达式隐藏一些行:
=IIf(Fields!val2.Value + Fields!val3.Value <> 0, False, True)

enter image description here

这会破坏 RowNum,但我们可以修改表达式以忽略隐藏的行。我们通过将它们清空来做到这一点(即对于设置为 Nothing 的 SSRS) - CountDistinct不会考虑任何 Nothing值(value)观:
=RunningValue(IIf(Fields!val2.Value + Fields!val3.Value <> 0, Fields!val1.Value, Nothing)
, CountDistinct
, "Tablix1")

现在 RowNum 根据需要忽略隐藏的行:

enter image description here

关于reporting-services - 表中的 SSRS 行号,不包括隐藏行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18953301/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com