1

With SSRS we have the brilliant ability to be able to execute reports directly via URL and even export them in a particular format. I've got a report set up which I'm trying to export as an image, which works perfectly.

e.g.:

http://myserver/ReportServer?http://myserver/DynamicImageTest.rdl&Keyword=test&rs:Command=Render&rs:Format=IMAGE&rc:OutputFormat=PNG

However, because SSRS sets the header Content-Disposition: attachment, my browser always downloads the image, rather than displaying it inline.

I'm trying to embed the generated image somewhere else, so I need to be able to remove or suppress this behaviour.

Any way to do this, either using SSRS' built in URL parameters or some workaround, or will I need to run the report via the web service to do this?

GShenanigan
  • 5,409
  • 5
  • 38
  • 48

2 Answers2

2

This solution works for me, but still have rendering problems with graph/trends:

You need to embbed your request in a html page like this using javascript:

function updateImage()
 {
    if(newImage.complete) {    
    newImage = new Image();
    newImage.src = "http://server/Reportserver/?%2path%2ftestIMAGE&rs:Command=Render&Refdata=529&rc:Toolbar=false&time=" + new Date() +"&rs:Format=IMAGE&rc:OutputFormat=PNG";
    document.getElementById('updatebkg').style.backgroundImage = newImage.src ;
    }
}

then you upload the html page onto your SSRS portal like any rdl file. Finally you ask for a render of your html page via reportsserver acces (not reports):

http://server/Reportserver/?%2fpath%2ftesthtml&rs:Command=GetResourceContents
1

I don't think there is a way to change these headers in SSRS directly. You'll need to write your own service to get the content and send it along with the correct header. Fortunately writing that service will be pretty straightforward.

I'd be happy to learn that I'm wrong. If there is a method to change this, it's hidden pretty deep in the SSRS config.

Community
  • 1
  • 1
Jamie F
  • 23,189
  • 5
  • 61
  • 77
  • Ah, totally missed that question. I'll leave this open for a few days before accepting, see if there are any suggestions on any way to edit the config. – GShenanigan Nov 09 '12 at 21:11
  • Thanks, I'm going to head down this route as an intermediary to strip out the headers. – GShenanigan Nov 12 '12 at 09:57