Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Conditional Row Coloring

Author  Topic 

bushfoot
Yak Posting Veteran

53 Posts

Posted - 2008-12-11 : 14:12:33
I want to do conditional row coloring...

Is there a way I can set a global?
In ssrs alternating row colors every 4 will work like this
white
white
white
yellow
white
white
white
yellow

What I want to do is
white
white
white
yellow
yellow
yellow
yellow

So I need a way to say .. when the rownumber mod 4 is evenly divisible by 4 then set color as expected but toggle the default color to something else.

X002548
Not Just a Number

15586 Posts

Posted - 2008-12-11 : 14:19:10
I would say generate xml with a rules based table

BUT! Being a dba, I really don't care



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-12 : 09:48:06
are first 3 & next 4 two groups? if yes you can simply use
=IIF(Inscope("Group1"),"White","Yellow")
Go to Top of Page

bushfoot
Yak Posting Veteran

53 Posts

Posted - 2008-12-12 : 10:45:19
Its a table report not a matrix report. Oh and in my sample, there are suppose to be 4 whites, then 4 yellows, then 4 whites, then 4 yellows, etc.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-13 : 00:47:34
quote:
Originally posted by bushfoot

Its a table report not a matrix report. Oh and in my sample, there are suppose to be 4 whites, then 4 yellows, then 4 whites, then 4 yellows, etc.


and are each of 4 records a single group's data?
Go to Top of Page

bushfoot
Yak Posting Veteran

53 Posts

Posted - 2008-12-15 : 11:16:45
=IIf((System.Convert.ToInt32(Math.Ceiling(RowNumber("ReportData") / 4)) Mod 2 = 0), "LemonChiffon", "White")

This is the solution for my problem.. by getting the ceiling I get the "bucket" the row falls into and then the bucket number (1, 2,3,4,etc) is tested for odd/even for color toggle.
Go to Top of Page
   

- Advertisement -