I have tried all the expresssions posted for alternating colors in a group but it's not working correctly.
Here is what my report design looks like:
I would like each group row to alternate colors and I would like the detail inside each group to alternate. However, I always get this for the group alternating
I am using this expression:
=IIF(RunningValue(Fields!AssignedUnit.Value,COUNT,NOTHING) MOD 2 = 0
,IIF(ROWNUMBER(NOTHING) MOD 2=0,"LIGHTBLUE","SILVER")
,IIF(ROWNUMBER(NOTHING) MOD 2=1,"SILVER","LIGHTBLUE"))
for the group fill and this expression for the detail fill:
= IIf(RowNumber(Nothing) Mod 2 = 0, "LIGHTBLUE", "SILVER")
can someone help me figure out what I need to change so that the outside groups alternate correctly?
Thank you.
I use a function to control the background color - it's more reliable than using the ROWNUMBER function in SSRS.
You would add this to the VB Code section (Report Properties --> Code tab):
Then call the function from the BackgroundColor value:
All the function does is check the bOddRow variable and return the first or second color depending on bOddRow's value.
The third argument is the Toggle value. If it is 1, the color will change otherwise it would return the same color. The first column in a group would toggle while the others would have a 0 so the color is the same as the first.
The fourth argument is for the group number. For your report, I would make the inner Group 1 for the last number and the outer group would be 2.
Inner Group First column background color :
Inner Group Other columns background color :
Outer Group First column background color :
Outer Group Other columns background color :
Plagiarized from my previous post: How to create Alternative Row Background colors in SSRS for values in a group