Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing Row Colors in SSRS Report via data values

I know you can set the BackgroundColor to alternate between two colors with a fairly simple expression. I have a column that contains date values organized in order. Basically, I want the BackgroundColor to alternate each time the date value changes as you go down the rows. I got partway there with this code:

=iif(Previous(Fields!Req_Del_Dt.Value) = (Fields!Req_Del_Dt.Value), "White", "Lavender")

This will change the color each time the value of a row is not the same as the previous row. This is what the results of this look like:

http://imageshack.us/photo/my-images/24/alternatingcolors.jpg/

How can I make it so that the color changes to one color for an entire date (which might be 3 rows) and then "toggle" to a different color when the next date change occurs? I think I am on the right track, but I just can't figure this one out.

I would greatly appreciate any suggestions or comments. Thank you!

like image 352
Loki70 Avatar asked Oct 20 '25 02:10

Loki70


1 Answers

=IIF(RunningValue(Fields!Address.Value, CountDistinct, Nothing) MOD 2 = 1, "White", "Lavender")

For me this does the trick.

like image 142
Nanu Avatar answered Oct 22 '25 04:10

Nanu