Bunch's Blog

One day I'll have a catchy subtitle, one day
posts - 77, comments - 89, trackbacks - 0

My Links

News

Tag Cloud

Archives

Green

Alternating Table Row Colors in SSRS (The Easy Way!)

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:
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Friday, March 07, 2008 12:31 PM |

Feedback

Gravatar

# re: Alternating Table Row Colors in SSRS (The Easy Way!)

Works like a charm. Thanks!
8/3/2011 4:02 PM | Santi M
Gravatar

# re: Alternating Table Row Colors in SSRS (The Easy Way!)

Wonderful! Thanks!
9/6/2011 12:24 AM | Thejeswini
Gravatar

# re: Alternating Table Row Colors in SSRS (The Easy Way!)

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
10/7/2011 7:24 AM | Venkat
Gravatar

# re: Alternating Table Row Colors in SSRS (The Easy Way!)

=IIf( RunningValue (Fields!FieldName, CountDistinct, Nothing) MOD 2, Color1, Color2)
10/7/2011 7:49 AM | Venkat
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: