Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS Alternating Row Colour Within Groups

I have a ssrs table report with row grouping and I would like to know how to change the colours of rows in groups without changing the background colour of the group column itself. With the answers I have found and implemented I get the effect of the second table in the picture when I want the effect of the first table:

enter image description here

Any help will be much appreciated.

This is a picture of the actual report and it's grouping:

enter image description here

like image 857
Liam Domingo Avatar asked Jun 03 '14 09:06

Liam Domingo


People also ask

How do I alternate row colors in SSRS?

Right-click the data row as shown in the below screenshot, click F4 or properties window in the View menu. When selecting this, you will see the BackgroundColor option. By default, it is No Color, which means that there is no color for the background and use can select any colors.


1 Answers

The RowNumber technique only works on the Details group i.e. the lowest level group (with no Group columns defined). Think of it as returning the Row in the Dataset.

Instead I would write an expression that calculates the equivalent to RowNumber, but for the Group level - typically something using RunningValue ... CountDistinct on the Group Key field, like this:

= Iif ( RunningValue ( Fields!tableid.Value , CountDistinct , "TheNameOfYourGroup") Mod 2 = 0, "White", "WhiteSmoke")

like image 135
Mike Honey Avatar answered Sep 17 '22 17:09

Mike Honey