I'm trying to use an expression to set the fill color for the background of a text box in Report Builder. When I try to add a second condition, the value of AC, I can't get it to work. When I use only one line, it works for an specific value of AC, but when I add the other two the fill value is always the default, white. Here's the code:
=IIF (Fields!AC.Value = 1 and Fields!Retention.Value > 82, "Lime", "Red") OR
IIF (Fields!AC.Value = 2 and Fields!Retention.Value > 78, "Lime", "Red") OR
IIF (Fields!AC.Value = 3 and Fields!Retention.Value > 78, "Lime", "Red")
Any ideas? I'm kind of a novice at Report Builder.
If you look at the code and replace the IIF statements with one of the two possible values each could produce your code would look like this (or other combinations of Lime and Red)
= "Lime" OR "Red" Or "Lime"
I am not sure what the builder will do in this situation, but i guess not finding a colour or getting an error would give you the default colour.
You need to put all the logic inside the condition part of IIF(condition, "Lime", "Red")
=IIF ((Fields!AC.Value = 1 and Fields!Retention.Value > 82) OR
(Fields!AC.Value = 2 and Fields!Retention.Value > 78) OR
(Fields!AC.Value = 3 and Fields!Retention.Value > 78), "Lime", "Red")