Showing posts with label itself. Show all posts
Showing posts with label itself. Show all posts

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!!

Dynamically changing task name displayed within ForEach Loop Container

Does anyone know how to change the task name displayed within a ForEach Loop Container (or of the ForEach Loop Container task itself) based on a variable. I am pretty familiar with setting variable values during task execution and using expressions to alter task properties based on variables. I have tried using an expression to alter the value of the Name property of the ForEach Loop Container but the name of the ForEach Loop Container does not change during execution. Since the color of the various tasks change during execution, I would think that the task names could be changed as well.

What? Why would you want to do this? The fact that the colors change is just a pretty *debug feature* and means nothing in the execution of the package.|||I know that. I have a loop that executes through a few hundred iterations and runs for 30 minutes or so. I'd like to review how far in the process it is while it runs.|||Can you write a counter to a log file or something?|||

You can create checkpoints or if that does not fit your needs; you could write to a file or table on each iteration an the look at that. if you are interacting with a DB you may use a DB profiler to monitor the activity. Or try to loop only a few times until you get confident with the package result.

Rafael Salas

|||

No, you can't change the task name during execution.

You can log to the log output window though and only log the increment count, that would be the equivalent.

|||Thanks to everyone for the alternative suggestions. Thanks to Kirk for the definitive answer.