SSRS - Conditional row background color - Alt rows

I have a report - there are a series of numbers listed (e.g. below) - what I need to do - is to set a row background color for every other number set - so all 1's will have a background color green, same with 3's, etc. - so need to conditionally alternate row color backgrounds - in XLS I can do it with =MOD($A1,2)=1 but need to so it in SSRS

1
1
1
2
3
3
4
4
tbaseflugAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ValentinoVConnect With a Mentor BI ConsultantCommented:
To add some more info on the previous reply by planocz: to select the "detail row", you need to click the grey box on the left of the detail row - that's the one with the three horizontal lines above each other.  These grey selectors only appear when the table is selected.

Now that the detail row is selected, in the Properties window, locate the BackgroundColor property.  Select it, click the dropdown, and choose "Expression".

The attached expression assumes that your number field is called ProductID.

Also note that this will only result in alternating colors for your numeric groups if they are increasing by one at a time, but I think you won't have an issue with that in your situation - you would have had the same issue in Excel.

Regards,
Valentino.

=IIF(Fields!ProductID.Value Mod 2 = 1, "Green", "Blue")

Open in new window

0
 
planoczCommented:
Need something like this in your detail row background properties
=IIF(RowNumber(Nothing) Mod 2 = 1, "White", "Silver")
You will need to change this to fit your row count
0
 
planoczCommented:
Hi tbaseflug,
did the coments help you?
Do you need more help?
0
All Courses

From novice to tech pro — start learning today.