Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Dynamic image display in SSRS 2005

Author  Topic 

rameshpalla
Starting Member

16 Posts

Posted - 2005-12-19 : 08:27:38
Hi all,

I am currently working on some reports where I need to display images dynamically.

there is one total field whose value ranges between 0 and 100 %. amd I need to display different images depending on the range of the value.

for example,

if the range is between

80% - 100% smily face.

60% - 80% normal face

40% - 60% sad face.

Can any one help in approaching this.

Initially I worked with only static embeded images.

It also helps me in solving another problem.

I need to change the company logo (header image) as per the company in the common report template provided by the provider dynamically.

Thanks in advance.

waiting for an early help as it is very urgent for me.

Regards,

Ramesh P

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-12-19 : 10:19:44
Hello. I have not try this but think it will work. You need to create 3 different pictures. So do an embedded picture for each one. After that right click and go to properties. Then go to the visibility and choose Experssion.


=IIF(Fields!fieldname.Value > 40 And Fields!fieldname.Value < 60, False, True)


SO basically if the range is between 40 and 60 then display that picture else hide it. Let me know if you have any questions.
Go to Top of Page

rameshpalla
Starting Member

16 Posts

Posted - 2005-12-20 : 06:22:27
Hi thanks for an immediate reply. It worked for me. But as my report is complicated one and has several datasets, If I am placing the images on the report open space, it says can not place since there is more than one dataset.

If I place it in the Table, I could not place more than one image in the cell.

As I need to place several images one over other and control visibility as per the result,
I am still working on that.

Any how as I am new to these reporting concepts, this is a good help to me.
Please reply me if you or any one have how to solve this.

Regards,
Ramesh Palla
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-12-20 : 13:50:50
Hello. I have not try it with 2 or more datasets, but it shouldn't give you an error. Can you place more than 2 embedded picture without using the conditions to hide it? Or is it still giving you that error saying that you more 2 or more datasets?

Another that might work is using subreport. Create a new report with just the embedded image and the condition. Then use that for the subreport. You'll need a parameter for the field that you are evaluating so that it could be passed to your subreport. Let me know if this works for you.

Go to Top of Page

rameshpalla
Starting Member

16 Posts

Posted - 2005-12-21 : 09:16:40
Hi,

I have approached with another technique by using web option specifying url of the image to be displayed. Here I could make up with single image control.

I could get support from MSDN
http://msdn2.microsoft.com/en-us/library/ms157328(en-US,SQL.90).aspx
using
=Switch(Fields!PctComplete.Value >= .8, "Green", Fields!PctComplete.Value >= .5, "Amber", Fields!PctComplete.Value < .5, "Red")
syntax

Regards,
Ramesh


Go to Top of Page

GryphonsClaw
Starting Member

2 Posts

Posted - 2007-05-19 : 00:45:37
How can I dynamically change the URL of a web image. I have a web site with images of product numbers. Based on the product number displayed, I would like to show the image, ie item 1111 would be http://mysite.com/1111.jpg. Even better would be if the image was not there to not display it.
Go to Top of Page
   

- Advertisement -