Tuesday, March 27, 2012

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

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.
IgorSelect 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")|||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
"Julich" <julich@.gmail.com> wrote in message
news:1118320972.223994.206500@.z14g2000cwz.googlegroups.com...
> 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")
>

No comments:

Post a Comment