Avatar of vbnetcoder
vbnetcoder
 asked on

custom background color per row

I have a table that is connected to a dataset that will return 5 and only 5 items every time.  The background color for each row needs to be different so the first item will be red, the second will be orange, the third purple etc.

How do i do this?
SSRS

Avatar of undefined
Last Comment
ValentinoV

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Jim Horn

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
vbnetcoder

ASKER
I ended up using a switch but the concept was the same
Jim Horn

Can you post your Switch code?  Kinda curious.

And a screen shot of your report with all the colors.  I have occasional debates with other experts on how many colors should be used in a report, especially with those experts that have embraced the new metrosexual 'minimalist' look.

Thanks.
vbnetcoder

ASKER
I can't post the report  because i would get in trouble with my client.  The table i was talking about earlier was a table HOWEVER i was using the table as a legend for a chart.  So, the first column was a square with the background using the switch statement and the second column was a description

I had to change to script a little so that i could share it but this gives the idea:

=SWITCH(RowNumber("dsTable1") = 1, "Green"),
RowNumber("dsTable1") =   2, "Blue"),
RowNumber("dsTable1") =  3, "Gray"),
RowNumber("dsTable1") =  4, "Green"),
RowNumber("dsTable1") =  5, "Red")
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Jim Horn

Ok thanks.
ValentinoV

Looking at Jim's solution I think he meant to use Switch but typed IIF instead (IIF doesn't work like that) :)