all groups > sql server reporting services > june 2005 >
You're in the

sql server reporting services

group:

Changing color of the details depending on the value of the field


Changing color of the details depending on the value of the field imarchenko
6/8/2005 4:56:54 PM
sql server reporting services:
Hello !

I am using Reporting Services with SQL Server 2000 (SP3).
I am trying to build in dynamic coloring into my report depending on the
value in a certain field. Query already returns name of the color I would
like to use as an additional field (color conditions are driven by range of
data certain value falls into and stored in the database ). I simple need to
pick color stored in this field( it is Dataset field Color) and apply to
particular cell (possibly entire row) when rendering report. Colors are
returned as names: GREEN,RED,GREY etc.
Is there an easy way to accomplish this in Reporting Services?
Any help would be greatly appreciated.

Igor


Re: Changing color of the details depending on the value of the field Julich
6/9/2005 5:42:52 AM
Select the cell you want to colorize according to the value. Change the
BackColor property and use a VB expression instead of a hard-coded
color. Use the equal sign "=" in order to use a VB expression, just
like this :

=Fields!Color.Value

Since Green, Red and Gray are know colors, they will be authorized.

You also can do something like this (if my sales rate is under 50%, I
colorize in Red, otherwise, in green) :

=IIF(Fields!SalesRate.Value < 50, "Red", "Green")
Re: Changing color of the details depending on the value of the field imarchenko
6/9/2005 10:13:00 AM
Thanks a lot Julich! It worked perfectly! I would actually like to stored
color logic inside that database so that query returns color instead of
having RS making this decisions.

Thanks again,
Igor




[quoted text, click to view]

AddThis Social Bookmark Button