TIP: Displaying images created using RenderStream

I'm working on an application that uses the Render() and RenderStream() methods of the SRS ReportingService interface. This app is an ASP.NET WebForm that calls Render() for a given report (and RenderStream if the report contains stream resources – images, charts, etc), gets the results back as HTML, and outputs the HTML inline in the WebForm.

 

As I got started on it, I had some problems getting the rendered images to appear in the report. It turns out that these resources are output without any file extension, so IE wasn't sure how to handle them.

 

The fix:

  • In Internet Information Services Manager, navigate to the directory where external resources are rendered (the ASP.NET Machine account <machinename>\ASPNET will need to have write permissions to this directory in order to successfully create resources)
  • Open the Properties page for this directory, and select the HTTP Headers tab
  • Click 'File Types'
  • Click 'New Type'
  • In 'Associated Extension', enter '*' (no quotes)
  • In 'Content Type (MIME)', enter 'image/png' (no quotes)

Note, the above will only work for charts within the report. I haven't yet figured out how to do this for multiple file types (say, PNG, CSS, etc). If anyone knows how, I'd love to hear!

 

cheers,

~stuart