SSRS 根据组更改行颜色?
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对我来说,您似乎希望它根据组交替颜色,但要考虑到前一个日期最后一行的颜色。
鉴于这种情况,为什么不直接选择行本身(处理分组)(黄色框的最左侧部分)。然后,您可以选择“背景颜色”属性并选择“表达式”
您应该能够输入如下内容
:会让你按照你所描述的那样交替颜色。
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"
You should be able to input something like:
This will get you alternating colors as you have described.