SSRS External Images don't display

The Situation
We want some photos taken from another website of ours to display in our report. These are not stored locally on the Reporting Server because other services use these photos on our Intranet and we only want one location to upload the photos. These images are provided via a website address (http) or network share (file).

Before you ask, we have several MS Sharepoint sites but we didn't go down the route of uploading 10000+ images into a Sharepoint database though we are still considering it; so this article is more about just getting external images to display when they are provided over an authenticated URL (You shouldn't be having any issues with this if the image is available to anonymous users - eg. Google Logo).

Our Setup
  1. Windows XP Workstation
  2. Business Intelligence Development Studio 2008 (BIDS)
  3. SQL Server 2008 R2 Reporting Server (SSRS) running on Windows Server 2003
  4. Team Foundation Server 2010 (TFS)

Problem #1: Image does not appear within SSRS
When previewing the report in BIDS, the photo appears fine. If we deploy the report to our Reporting Server and attempt to view it using a Web-Browser, the image does not display:
  1. Get report to see images hosted on an external URL
  2. Check if image exists to display alternative placeholding image.

Solution #1: Image does not appear within SSRS
Configure the Unattended Execution Account: According to Microsoft and Stack Overflow, your reporting server needs to have the "unattended execution account" configured. Some sources are specific saying that the account will need to be able to logon to the external server holding the files.

MSDN Quote:
When the report is previewed in Report Designer, preview uses the credentials of the user to display the image. When the report is run on the report server, the report server uses the unattended execution account to retrieve the image.

So here's my checklist:
  1. Test adding an external image that doesn't need credentials (such as Google's logo @
  2. Test disabling the "Unattended User Account" and seeing if Google's logo still appears.
  3. Test browsing to your images when you are not using one of your Intranet computers or user accounts (eg. try Local Admin Account on Computername as domain).
The first two of the above worked for us, which indicated an issue with the credentials we were using to access the the photos, so:
  1. Ensure the "Unattended User Account" can see the photos. - This solved the problem for us
  2. Some forums suggested to put this user also in the "Browser" roles of the Reporting Manager

Problem #2: Alternative image if file does not exist
We don't have photos for all ~20000 students at all times and these get updated/uploaded/added to about once a week. In cases where there are no photos, SSRS displays a mini ugly red cross. On the system that used to do this, we could use the HTML attribute "OnError" to load an alternative image. We would like something similar for SSRS.

Solution #2: Alternative image if file does not exist
More of a workaround than a solution but by asking some colleagues who developed the previous version (using 3rd-party components other than Microsoft SSRS) that the existence of a photo depended on the status of a student in any case. This meant that I could use the same Oracle PL/SQL query they used to determine whether to display an image or not. Bit of a cop-out I know but after two weeks of trying to find a solution, I would definitely recommend seeing if you can't check at the database level first. I will in future.

Debug Method
Fallback to debug methods; create a textbox that will be visible on the executed report (obviously replace the field name with the name of your field containing the location of the image - ours is "PhotoURL"):
=" The file " & First(Fields!PhotoURL.Value, "PhotoDetails") & IIF(Code.ImageExists(First(Fields!PhotoURL.Value, "PhotoDetails")), " exists!", " does NOT exist.")
  1.  =" The file " & First(Fields!PhotoURL.Value, "PhotoDetails") & IIF(Code.ImageExists(First(Fields!PhotoURL.Value, "PhotoDetails")), " exists!", " does NOT exist.") 

Additional Error (if you get this)
We didn't get this error as the problem was down to not having a "unattended user account" who could access the images.
Request for the permission of type 'System.Net.WebPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
  1.  Request for the permission of type 'System.Net.WebPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. 
Can apparently be solved by adding this to the top of your web.config file.
<location allowOverride="false">
	<trust level="Full" originUrl="originUrl" />
  1.  <location allowOverride="false"> 
  2.      <trust level="Full" originUrl="originUrl" /> 
  3.  </location> 

Searches that got me nowhere
  • ssrs check if file exists
  • ssrs hide image with red cross
  • ssrs alternative image on error
Category: SQL Server Reporting Services :: Article: 382

Credit where Credit is Due:

Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman

Related Articles

Joes Revolver Map

Joes Word Cloud


Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Donate to Joel Lipman via PayPal

Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF
© 2024 Joel Lipman .com. All Rights Reserved.