Welcome to Spipp.net server Sign in | Join | Help

Kaisa's blog

On Reporting Services, Sharepoint, dotText and Larp

Conditional background color in Reporting Services

Sometimes, it's nice to have alternating background colors in Reporting Services reports. Doing this in tables is fairly easy, and can be done in 2 different ways; one using RowNumber and one using runningvalue:

=IIF(RunningValue( Fields!MyField , CountDistinct, Scope) Mod 2, "White", "WhiteSmoke")

The field has to be one that is changing a lot. The Scope needs to be the row group above the one you want to change. If you don't have any rowgroups, set Nothing.

Using RowNumber:
=iif(RowNumber(Nothing) Mod 2, "Gainsboro", "White")

It's slightly harder to to this on a matrix. Chris Hay has written a very thorough instruction on how to do it at Chris Hays's Reporting Services Sleazy Hacks Weblog:
http://blogs.msdn.com/chrishays/archive/2004/08/30/GreenBarMatrix.aspx.
In step 6: Set the font weight of the inner grouping header to 1 pt - I think he means font size. The rest is ok.

Published 08-05-2006 03:37 by kaisa
Filed Under:
New Comments to this post are disabled
SkinName:iroha_Blog2
Powered by Community Server, by Telligent Systems