【问题标题】:Changing background colors of table cells (Visual Studio Reports 2008)更改表格单元格的背景颜色 (Visual Studio Reports 2008)
【发布时间】:2017-01-29 10:46:03
【问题描述】:
我在 Visual Studio Reports 2008 中有一份报告。
我创建了数据集以从 ReportParameter (Place) 中选择值。
从 ReportParameter (Place) 中选择的数据用于显示报表。
如何更改等于 ReportParameter (Place) 中选定值的表格单元格的背景颜色?
【问题讨论】:
标签:
visual-studio
reporting-services
【解决方案1】:
这很容易通过在要突出显示的单元格上设置背景属性来完成。
在设计模式下,选择要突出显示的单元格。在“属性”窗格中,查找“背景”属性,并将“表达式”设置为如下所示。
=IIf(Fields!Place.Value = Parameters!Place.Value, "Yellow", "White")
字段名称会有所不同,具体取决于您为自己命名的名称。这将检查当前 Place 值是否等于所选参数值,如果匹配则将背景设置为黄色,否则设置为白色。
这应该适用于任何版本的 SSRS。