次の方法で共有


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

Comments

  • Anonymous
    November 22, 2004
    Hmm.. That is interesting. When I was working on my rsWebParts project I believe I tried to do some work with RenderStream and ran into this exact issue. However, since this tip didn't exist and I wasn't able to figure it out I gave up on that. :)

    Thanks for these great tips!
  • Anonymous
    November 27, 2007
    PingBack from http://feeds.maxblog.eu/item_1250955.html