Geeks With Blogs
Bunch's Blog One day I'll have a catchy subtitle, one day

A lot of the applications I work with utilize SQL Server Reporting Services (SSRS) for reporting. I was shown a way by the previous owner of an app to make a table show up in green bar (alternating colors). I added a function to the XML code for the .rdl to determine if the row is odd or even. Then I would add a <BackgroundColor> entry to each item in the table (again in the XML). It never took too long but was a bit of a pain to setup.

I recently found a MUCH easier way. All you have to do is go into the properties of the TableRow and for the BackgroundColor property add in =iif(RowNumber(Nothing) Mod 2, "Green", "White"). D’oh! This much easier to implement and update.

Technorati Tags:
Posted on Friday, March 7, 2008 12:31 PM SSRS | Back to top


Comments on this post: Alternating Table Row Colors in SSRS (The Easy Way!)

# re: Alternating Table Row Colors in SSRS (The Easy Way!)
Requesting Gravatar...
Works like a charm. Thanks!
Left by Santi M on Aug 03, 2011 4:02 PM

# re: Alternating Table Row Colors in SSRS (The Easy Way!)
Requesting Gravatar...
Wonderful! Thanks!
Left by Thejeswini on Sep 06, 2011 12:24 AM

# re: Alternating Table Row Colors in SSRS (The Easy Way!)
Requesting Gravatar...
Works OK when there is no grouping on the Rows but doesn't work when there is grouping property added on the details section of the report.. so any alternate way for this kind of implementation.

Thanks
Left by Venkat on Oct 07, 2011 7:24 AM

# re: Alternating Table Row Colors in SSRS (The Easy Way!)
Requesting Gravatar...
=IIf( RunningValue (Fields!FieldName, CountDistinct, Nothing) MOD 2, Color1, Color2)
Left by Venkat on Oct 07, 2011 7:49 AM

# re: Alternating Table Row Colors in SSRS (The Easy Way!)
Requesting Gravatar...
Thanks a Lot...Its perfect..!!
Left by Reshma on Jan 03, 2013 11:43 PM

# re: Alternating Table Row Colors in SSRS (The Easy Way!)
Requesting Gravatar...
thats cool dud.. After lots of trouble i got this !!
Cheers
Left by Nikhil on Feb 05, 2013 5:29 AM

# re: Alternating Table Row Colors in SSRS (The Easy Way!)
Requesting Gravatar...
Nice trick. Thanks!
Left by Sal on Aug 22, 2014 4:11 PM

# re: Alternating Table Row Colors in SSRS (The Easy Way!)
Requesting Gravatar...
neat! thanks!!
Left by SV on Sep 16, 2014 2:29 PM

# re: Alternating Table Row Colors in SSRS (The Easy Way!)
Requesting Gravatar...
Thanks man
Left by bijay on Mar 26, 2015 4:23 AM

Your comment:
 (will show your gravatar)


Copyright © Bunch | Powered by: GeeksWithBlogs.net