Setting cell's background color based on cell value?
In my ssrs report, I need to compare the values of 2 cells on each row of my dataset. If the values are not equal, I need to set the cell's background color to yellow. Otherwise, I leave it as white. I tried the following expression within the BackgroundColor property, but had no luck. =iif(Fields!ReportCell1.Value.Equals(Fields!ReportCell2.Value), "White", "Yellow") This expression sets all cells to white, regardless of their value. Any idea why I can't get the background color to switch to Yelllow for values that aren't equal? Thanks.
August 19th, 2011 4:53pm

Reverse the color and see if it all shows yellow. =iif(Fields!ReportCell1.Value.Equals(Fields!ReportCell2.Value), "Yellow","White"). if it is all Yellow then something is wrong with the data becuase expression looks correct. Also do send me few sample data and your report desing layout screeshot.
Free Windows Admin Tool Kit Click here and download it now
August 19th, 2011 5:27pm

Hi Goalie35, Thanks for your question and arunsinghit’s reply. Please compare the two fileds’ value directly. =Iif(Fields!ReportCell1.Value=Fields!ReportCell2.Value,"White","Yellow") The effect just like this: Thanks, Sharp Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
August 21st, 2011 3:22am

Hi Goalie35, Thanks for your question and arunsinghit’s reply. Please compare the two fileds’ value directly. =Iif(Fields!ReportCell1.Value=Fields!ReportCell2.Value,"White","Yellow") The effect just like this: Thanks, Sharp Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2011 3:22am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics