简体   繁体   中英

SSRS Background Color Expression Error

I am trying to make an expression which will make the background color change based on FileType and the DriveLetter associated with the FileType. When I preview the report, this error appears:

Warning 1 [rsRuntimeErrorInExpression] The BackgroundColor expression for the text box 'Physical_Name' contains an error: Input string was not in a correct format.

Does this mean there is a issue with the datatype for this column or does anyone see something wrong with the expression i used?

Here is the expression:

=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")

Thanks.

尝试使用以下表达式:

=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",""))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM