Groups | Blog | Home
all groups > sql server reporting services > september 2007 >

sql server reporting services : Alternate Background Color in Row


Jeannette
9/7/2007 3:12:00 PM
Hi,

I am working on a report in the Reporting Services. I was wondering if we
can set alternate background color for a group of rows on the report. Let's
see the example below.

ID Name Month Field4 Field5
1 A Jan 8 9 --- Background color: red
1 A Jan 10 2 --- Background color: red
1 A May 3 3 --- Background color:
transparent
2 B Feb 2 4 --- Background color: red
3 C Apr 5 6 --- Background color:
transparent
3 C Apr 7 5 --- Background color:
transparent
4 D Mar 2 2 --- Background color: red
4 D Jun 3 1 --- Background color:
transparent

The background color will be set based on the group of ID, Name and Month
fields. Does anyone know if this is doable? If so, how to do it?

Any help would be greatly appreciated!

Thank you in advance.

Carl Henthorn
9/7/2007 4:08:00 PM
to alternate colors in a table, place this in BackgroundColor expression:
=iif(RowNumber(Nothing) Mod 2, "AliceBlue", "White")

feel free to place whatever colors you want in there

[quoted text, click to view]
Jeannette
9/9/2007 1:36:02 PM
Thank you very much for your response! Carl. Although your answer is not
exactly what I am looking for, it really helps me to get to what I need for
my report. As I explained earlier in my previous message, the alternate
background color will be set based on the GROUP of ID, Name, and Color
fields. Below is what I found for my question. It really works!

In BackgroundColor expression:
=iif(RunningValue(Cstr(Fields!ID.Value) & CStr(Fields!Name.Value) &
CStr(Fields!Month.Value),CountDistinct,Nothing) Mod 2, "AliceBlue", "White")

Jeannette


[quoted text, click to view]
AddThis Social Bookmark Button