【问题标题】:SSRS Background Color Expression ErrorSSRS 背景颜色表达错误
【发布时间】:2014-08-08 18:35:12
【问题描述】:

我正在尝试创建一个表达式,该表达式将根据 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")

谢谢。

【问题讨论】:

  • 保存您的报告关闭 Visual Studio 并再次打开它,很奇怪但有时会工作..
  • 您是在所有条件下都收到错误还是仅在不匹配(其他)条件下收到错误?

标签: sql sql-server tsql reporting-services


【解决方案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",""))

【讨论】:

  • 所有“Fields!DriveLetter”都需要以“.Value”结尾
猜你喜欢
  • 2014-10-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-16
  • 1970-01-01
  • 2011-06-26
  • 1970-01-01
相关资源
最近更新 更多