Friday, March 9, 2012

Dynamically controlling a cell in 2005 SRS

Is there a way to put code (i.e. an Expression) behind a cell in a
table that will control the background and foreground colors of the
cell itself?
For example (this is pseudocode to indicate what I want to happen)
If =Fields!policy_count.Value > 5 then
Set background and foreground to "Red"
else
Set background and foreground to "Green"
endif
Thanks!!Couple issues here:
First, to answer your main question, yes you can do this with
expressions but you're going to need to set up two sepearte
expressions; one for each of the cell properties you want to change,
BackgroundColor and Color. Color is the property for font color i.e.
Foreground.
Insert code something like =IIF(Fields!policy_count.Value >
5,"Red","Green") as the Expression for the property in question. That
should give you the appearance you desire.
Second thing and maybe I'm just reading too much in but you don't want
use the same expression for both properties otherwise you'll end up
with just all green or all red cells.
HTH
toolman
wardellcastles wrote:
> Is there a way to put code (i.e. an Expression) behind a cell in a
> table that will control the background and foreground colors of the
> cell itself?
> For example (this is pseudocode to indicate what I want to happen)
> If =Fields!policy_count.Value > 5 then
> Set background and foreground to "Red"
> else
> Set background and foreground to "Green"
> endif
> Thanks!!

No comments:

Post a Comment