views:

1362

answers:

3

I'm trying to add an image to a report. The image src url is an IHttpHandler that takes a few query string parameters. Here's an example:

<img src="Image.ashx?item=1234567890&lot=asdf&width=50" alt=""/>

I added an Image to a cell and then set Source to External and Value to the following expression:

="Image.ashx?item="+Fields!ItemID.Value+"&lot="+Fields!LotID.Value+"&width=50"

But when I view the report, it renders the image html as:

<IMG SRC="" />

What am I missing?

Update

Even if I set Value to "image.jpg" it still renders an empty src attribute. I'm not sure if it makes a difference, but I'm using this with a VS 2008 ReportViewer control in Remote processing mode.

Update

I was able to get the images to display in the Report Designer (VS 2005) with an absolute path (http://server/path/to/http/handler). But they didn't display on the Report Manager website. I even set up an Unattended Execution Account that has access to the external URLs.

+1  A: 

Have you tried using a fully qualified path?

http://&lt;servername&gt;/images/image1.jpg

More Info

jimconstable
Yes, I was able to get the images to display in the Report Designer (VS 2005) with an absolute path. But they didn't display on the Report Manager website.
jrummell
A: 

I am experiencing same problem: Visual Studio report designer shows images properly, "Preview report" does not show image; When I am using Report Builder 3.0 - it does render images all the time (design/preview)... however on reporting server images still showing X. Any ideas?

Vadim
+3  A: 

I have a SSRS Report that displays the information about the countries of the users of a site that we support at work. This is based on the IIS log data. On this report, in the first column of the table is an image field that holds a small .gif of the flag for each country. I was running into the same exact issue described in the question above. The path to the external image was calculated in the report’s query based on the country code. I initially setup the URL to point to something like http://www.mystaticcontent.com/fotwimg/us.gif for a United States flag and so forth. All I got was a red X broken image displayed in the report. Then I found this MSDN article that shined some light on the issue for me.

This is what I did with the report to make it work:

  1. Moved the fotwimg folder that has all the gifs from the static content server to the local SSRS machine, which also has a web server running on it.
  2. Setup a virtual directory on the default web site in the local SSRS machine IIS Manager.
  3. Then I changed the report query to refer to the image in the local SSRS machine, by machine name, like this http://mylocalssrsmachine/fotwimg/us.gif
  4. Voila, it works… or at least it worked for me.
Jonas Gorauskas
Thanks for the answer! I was trying to avoid putting the images on the report server. I wanted to display thumbnails that linked to the full size images, but I ended up using the hyperlink action on a normal text field instead. I'll have to remember this for the next time it comes up.
jrummell