Friday, March 9, 2012

Dynamic embedded image...

Hey all,

I am trying to add an image object to a report that has its value property set dynamically and am not being very successful. I have two images embedded in the report called greyFlag and orangeFlag. When I try to add the condition:
...
=IIf(Fields!DateFilled.Value >= DateTime.Now.AddMonths(-12), "orangeFlag", "greyFlag")
...
I get the error:
...
The value of the value property for the image ‘image2’ is "greyFlag", which is not a valid value.

...

What am I doing wrong here?

Regards,

Stephen.

You need to put the code in the visible expression field.

in the Hidden for Greyflag field add the expression

=IIf(Fields!DateFilled.Value >= DateTime.Now.AddMonths(-12), true, false)

ANd do the opposite for the orangeFlag

=IIf(Fields!DateFilled.Value >= DateTime.Now.AddMonths(-12), false,true)

|||

OK. I was hoping to use just one image and replace its source, but I've used your technique by overlaying two images.

Thanks for the help!

Regards,

Stephen.

No comments:

Post a Comment