0
votes

I am trying to alternate row colors in SSRS but I want each group to start with the same color, independent of the amount of rows in the previous group. I know that the function =IIf(ROWNUMBER(NOTHING) MOD 2, "Transparent", "Gray") allows me to alternate the rows, but this creates

Current colors alternating rows

Which is not what I want, since group 2 now starts with a grey row. Below an example of the desired output where the first row in each group starts with a white background.

Desired colors alternating rows

Any idea how to solve this? Thanks in Advance!

1

1 Answers

1
votes

You just need to specify the scope that returns the row number

=IIF(ROWNUMBER("myRowGroupName") MOD 2, Nothing, "Gray")

"MyRowGroupName" is the name of the row group that you want to reset the colors, it is case sensitive and must be enclosed on double quotes.

All this does is evaluate ROWNUMBER() with in each group, so it will start at 1 again when it hits a new group.