Reputation: 815
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.
Upvotes: 0
Views: 3396
Reputation: 910
Try using the below expression:
=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",""))
Upvotes: 1