Archive

Archive for May 7th, 2010

SSRS SQL Server Reporting Services – How to reference an external image hosted on the report server

May 7th, 2010 1 comment

Ok,

I needed to do this the other day, after an hour or so I finally got it.

Issue, I have an images directory that is deployed to the report server with my reports, It is hidden in the tile view.

The problem, how to insert an image into my report that references the images directory hosted on my report server.

Well after a while of struggling with it I noticed this little perl of information in the warnings for my report;

[rsWarningFetchingExternalImages] Images with external URL references will not display if the report is published to a report server without an UnattendedExecutionAccount or the target image(s) are not enabled for anonymous access.

So to make this work do the following

1. Setup an unattended execution account, (See the Execution pane in the Reporting Services Configuration Tool)
2. ** Very Important ** Ensure “everyone” has browse access to the images folder, (or confirm that the unatteneded execution user has access to the images folder)
3. In your report set the URL of your image with an expression like the following:

=IIf(Globals!ReportServerUrl is nothing, 
      "http://localhost/ReportServer", 
       Globals!ReportServerUrl) + "?%2fimages%2fimage.png"

Two things of interest in this code:
1. There is a ? after the http:///ReportServer path
2. This expression uses the localhost when in the IDE preview window and the full reportserverUrl when deployed to a server. I didn’t want to hard code localhost for a production deployed report.

And now it all works both in the IDE and the deployed report.

Cheers

VN:F [1.9.22_1171]
Rating: 5.3/10 (4 votes cast)

Categories: Reporting Services Tags: