title: SSRS external image not displayed when value set by expression
body: <p>I am using <code>Microsoft.ReportViewer.WebForms</code> version 11 via an aspx page embedded in an MVC application. The report is rendered directly as a PDF from the report viewer.</p>
  <p><strong>Problem</strong></p>
  <p>I have a tablix that displays external images. The images don't display if the URL to the image is calculated from an expression or set from a column in the database. The image only displays if I hardcode the URL directly in the report. Obviously this is not a solution, but it shows that the report is capable of accessing the URL and rendering the image.</p>
  <p>I get these warnings from rendering the report:</p>
  <blockquote>
  <p>The ImageData for the image ‘LinkedImage’ is invalid. Details: Invalid URI: The format of the URI could not be determined.</p>
  <p>The value of the ImageData property for the image ‘LinkedImage’ is “”, which is not a valid ImageData.</p>
  </blockquote>
  <p><strong>What I've tried</strong></p>
  <ol>
  <li><p>I've double checked the URL that gets generated and it is correct. I've even made it the click action a hyperlink to the image and it goes to the image correctly.</p>
  </li>
  <li><p>Initially I was concatenating the URL in the expression but after this didn't work I had the SQL Query build the entire URL. It still doesn't display.</p>
  </li>
  <li><p>I have tried setting a flag:</p>
  <pre><code>reportViewer.LocalReport.EnableExternalImages = true;
  </code></pre>
  </li>
  <li><p>Using .NET Reflector to generate PDB files I was able to step through the code of the report viewer. There is a flag on the value object called &quot;IsExpression&quot; which is set to false when the report renders. I don't know much about the inner workings of the Report viewer so I don't know if this is a red herring.</p>
  </li>
  <li><p>I've changed the output format to HTML and it still doesn't display. The image markup (as seen in Chrome developer tools) renders as:</p>
  <pre><code>&lt;img onload=&quot;this.fitproportional=true;this.pv=0;this.ph=0;&quot; height=&quot;5px&quot; width=&quot;1px&quot; src=(unknown)&gt;
  </code></pre>
  </li>
  <li><p>I've tried setting the <strong>MIMEType</strong> value to the correct value for each image. (Thanks Mike Honey for the suggestion)</p>
  </li>
  <li><p>I have tried the different <strong>Sizing</strong> values of <em>AutoSize</em>, <em>Fit</em>, <em>FitProportional</em>, and <em>Clip</em>.</p>
  </li>
  <li><p>I both repaired and reinstalled entirely the ReportViewer runtime installation using the installer here: <a href="https://www.microsoft.com/en-gb/download/details.aspx?id=35747" rel="nofollow noreferrer">https://www.microsoft.com/en-gb/download/details.aspx?id=35747</a></p>
  </li>
  <li><p>I have run the website from my local Visual Studio instance and a deployed version in a website on another server (same installed ReportViewer version) and the problem persists.</p>
  </li>
  </ol>
  <p>I'd like to draw attention to number 4. Could there be a configuration which is causing the ReportViewer code to not see the value as an expression?</p>
  <p><strong>Code</strong></p>
  <p>Here is the markup in the RDL:</p>
  <pre><code>&lt;Image Name=&quot;LinkedImage&quot;&gt;
      &lt;Source&gt;External&lt;/Source&gt;
      &lt;Value&gt;=Fields!imageUrl.Value&lt;/Value&gt;
      &lt;Sizing&gt;FitProportional&lt;/Sizing&gt;                               
      &lt;Style&gt;
          &lt;Border&gt;
              &lt;Style&gt;None&lt;/Style&gt;
          &lt;/Border&gt;
      &lt;/Style&gt;
  &lt;/Image&gt;
  </code></pre>
  <p>Here's an example URL (host removed from example):</p>
  <pre><code>http://---------/images/FEE40608-0457-E511-A17F-00155D145C00/FFE40608-0457-E511-A17F-00155D145C00.jpg
  </code></pre>
  <p>Am I missing something? Thanks!</p>