To add alternate colors in a matrix the expression should be as follows for the row group:
=IIf( RunningValue (Fields!FIELDNAME.Value, CountDistinct, Nothing) MOD 2, "Transparent", "aliceblue")
The tricky bit is when you want the same shading for the column groups. The way to do this is to insert a column outside of the row group and then use the same expression. Change the name of the textbox to "color". Then in your column group or data field in your matrix in the background color insert the expression which refers to the textbox "color":
=Reportitems!color.value
The colors in the matrix will alternate like a normal table.
Wahayy!!
Also in a anormal table where you have multiple groups you can use the following script for say 2 groups I assume you just use '&' and add in the extra fields if you have more than one group:
=IIF(RunningValue(Fields!Field1.Value & Fields!Field2.Value,CountDistinct, Nothing) MOD 2 = 1, "White", "Aliceblue")
This blog contains tips and tricks for reporting services 2005/2008R2/2016 "This blog is provided 'AS IS' with no warranties, and confers no rights."
Subscribe to:
Post Comments (Atom)
Keep SSRS (SSRS2016) report manager awake
When running a report for the first time in report manager it takes a while to run, after this initial run reports run fine. There are a ...
-
Due to the fact the reporting services allows you to query the tables you can easily write SQL which will allow you to return data from the ...
-
I have recently been looking at conditional page breaks in SSRS 2008 r2 and did not know that it is possible to do via an expression. For...
-
To add alternate colors in a matrix the expression should be as follows for the row group: =IIf( RunningValue (Fields!FIELDNAME.Value, Co...
Thank you Thank you Thank you. I have been looking at the top solution forever trying to get it to work on multiple groups and it just does not. Thankfully you also provided a solution to multiple groups!! I could not seem to find anyone who addressed that issue and it works great!
ReplyDeleteGlad it works as expected!
DeleteThanks, your example was very helpful
ReplyDeleteformatting pivot grid table color appearance
ReplyDelete- Nice article thanks this post share
ReplyDeleteThanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative.
ReplyDeleteGolden Triangle Tour Packages India