SSRS背景颜色表达错误

时间:2014-08-08 18:35:12

标签: sql sql-server tsql reporting-services

我正在尝试创建一个表达式,它将根据FileType和与FileType关联的DriveLetter更改背景颜色。当我预览报告时,会出现此错误:

  

警告1 [rsRuntimeErrorInExpression] BackgroundColor表达式   对于文本框'Physical_Name'包含错误:输入字符串是   格式不正确。

这是否意味着此列的数据类型存在问题,或者是否有人看到我使用的表达式有问题?

这是表达式:

=Switch(((Fields!DriveLetter.Value = "F") OR (Fields!DriveLetter.Value = "T")) AND (Fields!FileType.Value = "MDF"), "Lime", 
        ((Fields!DriveLetter.Value = "F") OR (Fields!DriveLetter.Value = "T")) AND (Fields!FileType.Value = "LDF"), "Red")

感谢。

1 个答案:

答案 0 :(得分:1)

尝试使用以下表达式:

=IIF(Fields!FileType.Value = "MDF" AND (Fields!DriveLetter = "F" OR Fields!DriveLetter = "T"),"LIME",IIF(Fields!FileType.Value = "LDF" AND (Fields!DriveLetter = "F" OR Fields!DriveLetter = "T"),"RED",""))