July 20, 2016 at 4:32 am
Hello,
I am trying to code an expression to change the colour of my text box if the value of the cell is above 10%. This field is calculated by dividing two values from the data set.
iif(Sum(Fields!DNA.Value / Fields!Total.Value) > 0.1,"Red","Green")
Why does this not work?
Any help will be appreciated.
Paul
July 20, 2016 at 5:46 am
iif(Sum(Fields!DNA.Value / Fields!Total.Value) > 0.1,"Red","LimeGreen") is not a valid color.
I think there is something wrong with the syntax
July 20, 2016 at 5:51 am
dramaqueen (7/20/2016)
iif(Sum(Fields!DNA.Value / Fields!Total.Value) > 0.1,"Red","LimeGreen") is not a valid color.I think there is something wrong with the syntax
The syntax looks okay. What property have you got the expression in? Also, at risk of being patronising, do you have an "=" at the start of the expression?
July 20, 2016 at 6:12 am
PB _BI touched on this...
I'm assuming you're attempting to use that expression in a text box properties/color setting... you can put a color or expression in there. if it does not begin with "=" SSRS assumes it's a color. As the error reads,
iif(Sum(Fields!DNA.Value / Fields!Total.Value) > 0.1,"Red","LimeGreen") is not a valid color.
-- Itzik Ben-Gan 2001
July 20, 2016 at 6:18 am
Yes sorry I was being really stupid. Makes complete sense.
Thanks everyone.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply