"Internet Explorer cannot download " in Report Viewer controls
This week, I spent a fair amount of time dealing with a customer who had issues opening up SSRS reports exported into Word, Excel, and PDF. They used both the webform Report Viewer control and a custom control which added a content disposition header for the document type in question to the response and then wrote it out to the browser (see https://support.microsoft.com/default.aspx?scid=KB;EN-US;q306654&ID=KB;EN-US;q306654&lex for more details).
While using the Report Viewer, this error got thrown:
Internet Explorer cannot download … from SomeSite
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
When in their custom control, we’d see an error like this (from the app which should have opened the document: Word, Excel, whatever):
The file could not be found. Try one or more of the following:
- Check the spelling of the name of the document
- Try a different file name
(C:\...\TempFolderName\DocName.doc)
The customer was also using a third party ISAPI filter to implement security on IIS.
Long story short, we were running into the behavior described in the following article:
https://support.microsoft.com/default.aspx?scid=kb;en-us;316431
Our problem was actually masked by a number of factors. It turns out, we had two things going on:
Even though SSL was not configured on IIS, the customer had an ISAPI filter installed which used SSL under the covers to do encryption
The ISAPI also automatically added the CacheControl: no-cache header to the response (You can use Fiddler from www.fiddlertool.com/ to check the headers yourself)
…and as the article above states, if one uses SSL and the no-cache header gets sent down, we will NOT cache the files in question…So we were pretty much deleting the office docs right after they made it to the client, but before we could display them (My customer used filemon to watch iexplore.exe do this, actually)…
So, even though this isn’t really an SSRS problem per-se, here are the takeaways:
Verify whether you are using SSL or not, even if you know you haven’t actually configured SSL on your website
Use Fiddler to see if the no-cache header is being sent down.
Comments
Anonymous
September 21, 2006
The comment has been removedAnonymous
September 29, 2006
Greetings,
Many thanks for this artical - it helped me to get to my solution. In my case, I'm running Apache and serving a dynamically generated PDF file that downloads fine in all popular browsers but IE. My working solution was to add the following lines prior to my other header outputs:
/**
* The following Pragma and Cache-Control lines are necessary
* as the overcome an issue that IE has in some server configurations
* when the no-cach header is sent. The two lines override these
* headers, allowing IE to proceed. When not turned on, the error IE
* provides is:
* Internet Explorer cannot download <item URL here instead of item file name> from <domain>.
*
* Internet Explorer was not able to open this Internet site. The requested site is either
* unavailable or cannot be found. Please try again later.
*/
header("Pragma: public");
header("Cache-Control: max-age=0");
Sean P. O. MacCath-Moran
www.emanaton.comAnonymous
November 14, 2006
THANK YOU!!!! i've waded through a pile of pages trying this and that -- clearing cookies, checking for spyware, repairing IE, nothing worked. downloading fidler and seeing what headers are actually being sent showed me that, indeed, "no-cache" was being set, so Response.ClearHeaders() and setting headers to "Pragma:public" and "Cache-Control:max-age=0" made it work. My app works again! THANK YOU, THANK YOU, THANK YOU!Anonymous
November 30, 2006
tips his hatI'm glad it worked out for you, florsita. =o)Anonymous
January 24, 2007
I am facing the same problem. But when I checked my server, I found that there was no IIS installed at all! Still trying to figure out what the problem could be :(Anonymous
May 31, 2007
Hi, I am having the same problem with MOSS2007 & SQL 2005 Reporting Services add-in, cannot export reports to file. Any ideas how MOSS headers could be configured?Anonymous
June 03, 2007
I had the same problem with MOSS & RS add-in, although the cache header was set to "private". The problem was solved by unchecking the "Do not store encrypted pages on disk" setting from IE7 advanced settings (in fact it was in our GPO).Anonymous
September 28, 2007
Thanks to Sean P. O. MacCath-Moran -your Pragma and Cache-Control headers solution sorted out my client's error when trying to export to excel (IE6, but with company encryption layers causing no-cache).Very useful, thank you.Anonymous
April 01, 2008
PingBack from http://copyrightrenewalsblog.info/russell-christophers-semi-useful-bi-musings-internet-explorer/Anonymous
May 06, 2008
You are a GENIUS, and have saved me hours of pointless and fruitless messing around trying to resolve this issue!.Great.Anonymous
July 18, 2008
Thanks much to Sean, your fix helped me out as well!Anonymous
September 29, 2008
Okay, I've inserted Pragma for the header name and Public for the value. I also inserted Cache-Control for the name and max-age=0 for the value. I don't know if I'm missing quotes or not but I can't get IE to work when I right mouse click and unregistered Mime-type and try to save it to my desktop in IE. Firefox is fine but not an option for the client.Help!Anonymous
December 19, 2008
Hi,This helped me in resolving my issue. I was setting the pragma:no-cache http header in my code. So I was not able to export reporting services report into excel, csv or pdf. After removing the code, it solved for me.Fiddler helped in finding wether no-cache header was being sent or notThanks a lot for your help.Anonymous
January 10, 2009
im trying to open files from microsoft word from my school course website. but every time i click on the file it tell me Internet Explorer cannot download <filename> from (website)im not verygood with comuters. could you tell me how to fix this problem in some detail plz... thanksAnonymous
January 10, 2009
The comment has been removedAnonymous
January 21, 2009
PingBack from http://www.keyongtech.com/2009289-moss-and-reporting-services-integrationAnonymous
May 29, 2009
PingBack from http://paidsurveyshub.info/story.php?title=russell-christopher-s-semi-useful-bi-musings-internet-explorerAnonymous
June 03, 2009
The comment has been removedAnonymous
January 21, 2010
I'm getting a similar problem. I have a servlet that displays an thumbnail image from the database. If I click on the image, a new window opens with a full-size image. This works fine when I use Firefox. IE fails with the error. If I enter the exact same URL in IE's nav bar, it works fine. IE wastes far too much of my time. >:-(Anonymous
November 08, 2011
Hi, I have verified that no-cache is being sent down But then the question, how do I remove cache-control: no-cache from reportviewer page / web control? Its being sent out may be because of the reserved.reportviewer.axd web handler.. and may be not the IIS.. How should that be detected and avoided? Thanks in advance Ameya ameyagholap@gmail.com