SSRS 根据组更改行颜色?

发布于 2024-12-08 20:07:27 字数 747 浏览 0 评论 0原文

我在 SSRS 中有一份报告,我正在尝试根据组更改背景颜色。我有 3 个组:年月、投资组合和名称。我想更改所有其他投资组合组的颜色。在每个投资组合组中,我希望所有行都具有相同的颜色。

我尝试过以下表达式,当给定月份中有奇数个投资组合时,它会失败,即我不希望相同的颜色接触。

=IIF(RunningValue(Fields!Portfolio.Value, CountDistinct, "MonthYear") Mod 2, "Gainsboro", "White")

上面得到:

YearMonth   Port# (Color)
Sep-11      Port1 (Gainsboro)
            Port2 (White)
Aug-11      Port1 (Gainsboro)
            Port2 (White)
            Port3 (Gainsboro)
Jul-11      Port1 (Gainsboro)

我想要:

YearMonth   Port# (Color)
Sep-11      Port1 (Gainsboro)
            Port2 (White)
Aug-11      Port1 (Gainsboro)
            Port2 (White)
            Port3 (Gainsboro)
Jul-11      Port1 (White)

I have a report in SSRS and I am trying to change the background color based on a group. I have 3 groups: YearMonth, Portfolio, and Name. I want to change the color of every other portfolio group. Inside each portfolio group I want all rows to be the same color.

I have tried the following expressions and it fails when there are odd number of portfolios in a given month, ie I don't want the same colors touching.

=IIF(RunningValue(Fields!Portfolio.Value, CountDistinct, "MonthYear") Mod 2, "Gainsboro", "White")

The above gets:

YearMonth   Port# (Color)
Sep-11      Port1 (Gainsboro)
            Port2 (White)
Aug-11      Port1 (Gainsboro)
            Port2 (White)
            Port3 (Gainsboro)
Jul-11      Port1 (Gainsboro)

I want:

YearMonth   Port# (Color)
Sep-11      Port1 (Gainsboro)
            Port2 (White)
Aug-11      Port1 (Gainsboro)
            Port2 (White)
            Port3 (Gainsboro)
Jul-11      Port1 (White)

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

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

发布评论

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

评论(1

树深时见影 2024-12-15 20:07:27

对我来说,您似乎希望它根据组交替颜色,但要考虑到前一个日期最后一行的颜色。

鉴于这种情况,为什么不直接选择行本身(处理分组)(黄色框的最左侧部分)。然后,您可以选择“背景颜色”属性并选择“表达式”

在此处输入图像描述

您应该能够输入如下内容

= IIf(RowNumber(Nothing) Mod 2 = 0, "Silver", "Transparent")

:会让你按照你所描述的那样交替颜色。

To me it would seem that you want it to alternate colors based on group, but have it take into consideration the color of the last line in the prior date.

Seeing as how this is the case, why not just select the row itself (that handles the groupings)(far left portion of the yellow box). You can then select the BackgroundColor property and choose "Expression"

enter image description here

You should be able to input something like:

= IIf(RowNumber(Nothing) Mod 2 = 0, "Silver", "Transparent")

This will get you alternating colors as you have described.

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