SSRS 每组中以相同颜色开始的交替行

发布于 2025-01-16 15:35:05 字数 488 浏览 3 评论 0原文

我正在尝试在 SSRS 中交替行颜色,但我希望每个组都以相同的颜色开始,与前一组中的行数无关。我知道函数 =IIf(ROWNUMBER(NOTHING) MOD 2, "Transparent", "Gray") 允许我交替行,但这会创建

当前颜色交替行

这不是什么我想要,因为第 2 组现在以灰色行开始。下面是所需输出的示例,其中每组中的第一行以白色背景开头。

所需颜色交替行

知道如何解决这个问题吗?提前致谢!

I am trying to alternate row colors in SSRS but I want each group to start with the same color, independent of the amount of rows in the previous group. I know that the function =IIf(ROWNUMBER(NOTHING) MOD 2, "Transparent", "Gray") allows me to alternate the rows, but this creates

Current colors alternating rows

Which is not what I want, since group 2 now starts with a grey row. Below an example of the desired output where the first row in each group starts with a white background.

Desired colors alternating rows

Any idea how to solve this? Thanks in Advance!

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

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

发布评论

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

评论(1

烟织青萝梦 2025-01-23 15:35:05

您只需指定返回行号的范围

=IIF(ROWNUMBER("myRowGroupName") MOD 2, Nothing, "Gray")

"MyRowGroupName" 是要重置颜色的行组的名称,区分大小写,并且必须用双引号引起来。

所有这一切都是在每个组中评估ROWNUMBER(),因此当它遇到新组时它将再次从 1 开始。

You just need to specify the scope that returns the row number

=IIF(ROWNUMBER("myRowGroupName") MOD 2, Nothing, "Gray")

"MyRowGroupName" is the name of the row group that you want to reset the colors, it is case sensitive and must be enclosed on double quotes.

All this does is evaluate ROWNUMBER() with in each group, so it will start at 1 again when it hits a new group.

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