Link to home
Create AccountLog in
Avatar of jsvb1977
jsvb1977

asked on

SSRS Export to Excel Error Through IIS 7.5

I am using an ASP.NET Report Viewer Control pointed at another server for SQL Server Reporting Services Data. The report renders in the aspx page just fine and most Export Functions work as expected.

Except for the Export to Excel.
[See Screen Shot Below]

The .xls file that is generated is not able to be opened and generates the error:

"The file you are trying to open, *.xls, is in a different format than specified by the file extension..."
[See Screen Shot Below for entire message]

I have been reading online and some of the solutions involve updating the registry on the end users' local machine. Since this is a report being run on a website designed for our customers, I hope this is not the only solution.

I am thinking that there must be something in either SSRS or IIS 7.5 Settings that can solve this problem.

Note: The error only appears on Excel Files generated via this website -- so, for example, if I navigate directly to the SSRS Report without first loading the web page using the Report Viewer Control, the Export to Excel works as expected and the file can be opened.

Versions:
SSRS 2005
MS SQL 2005
IIS 7.5
ASP.NET 2.0
MS Office 2007


ssrsheader.png
excelerrormessage.png
Avatar of ValentinoV
ValentinoV
Flag of Belgium image

What happens if you click the Yes button on that warning message?  Is Excel able to show anything from the report?
Avatar of jsvb1977
jsvb1977

ASKER

It just comes out as pure rubbish. See screen shot below:

14000                              
ÐÏࡱá>þÿ      þÿÿÿþÿÿÿy÷wøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿþÿÿÿ                        
                        
Thanks for the reply,
Jason
rubbish.png
First we need to know for sure where the problem is – SSRS server or the client? Did you tried to do exactly the same thing on the SSRS server if possible? I mean don't use a client but try please to RDP into your SSRS server and do the export right there. Or pls try following if you can't do that in your SSRS server: add a new subscription to the report and choose EXCEL as the "Render Format" to see if the SSRS server is capable of generating the appropriate Excel doc.
The export to excel works properly for this report when it is run directly from SSRS.
That's good because it takes the SSRS server out of equation. Are all or I should say any "client" computer(s) having the exact same issue or just one in particular?
Or maybe try take the file you exported on the client computer where you experience the issue and open it one another one to see if its not MS OFFICE related... I had some similar issue if I renamed a .xlsx to a .xls and try open it with 2007, but for me it worked after the warning from excel.
The issue happens on all computers both inside and outside of our network [employees and customers].

I am unable to rename, edit, or open the spreadsheet with another installation of Excel. I do not have access to any other versions of Excel -- All I have is 2007.

I went as far as to create a whole new website containing the same code with the same configuration as the website in question in the same IIS on the same server.

The only difference is that the new website i created as a test was inside the Default Website Directory set up as an application WHERE AS the website I am having this issue on is in it's own container and set up as a public facing website.

The public facing website is using the URL Rewrite Module 2.0 for IIS 7.5.

Thanks for working with me on this one -- It is driving me a little crazy.
Jason
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
No clients can view the report when exported to excel [unless it's run directly through SSRS].
The report can be exported to other formats successfully.

I will check out the link.
Jason
Sorry I wasn't quite clear when I said " Can any client view the report properly - pretty sure yes but just want to confirm that?"

I meant, can any client view a report or report history in browser before is exported to Excel?
Yes -- the report renders in IE as well as FF before the export.
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Valentino V:

Yes, I have tried this with success.
Here are my test scenarios:

====================
1. Live Public Facing Website:
Excel corruption when exporting report from any machine or any user
Report Renders Correctly in Web Page
Report can be exported successfully to other formats

2. Dummy Internal Web Application in Default Website Container:
Report can be successfully exported to Excel
Report Renders Correctly in Web Page
Report can be exported successfully to other formats

3. SSRS Direct:
Report can be successfully exported to Excel
Report Renders Correctly in Web Page
Report can be exported successfully to other formats

4. Internal Web Application created Inside Live public Facing Website:
Excel corruption when exporting report from any machine or any user
Report Renders Correctly in Web Page
Report can be exported successfully to other formats

============================
When I spell it out like that - all signs point to this specific public facing website.
I wonder if it could be a permissions issue or something like that.
Maybe I should look at the App Pool associated with this website as well as the Domain User tied to that app pool [if any].

Jason




All permissions work as expected for the App Pool Identity associated with this website. If they did not -- the report would not render properly INSIDE the website.

I am at a loss as to what else could be the problem.
Jason
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
pcsmitpra,

Thank you for the link. It was helpful.
The website that is giving this error is written in C# [a language I do not have a lot of experience with]. I am able to properly export to excel with the same report when I create a new website on the same IIS Server - but written in VB.NET.

Since this is a low priority item [now it is - it was high priority when I opened the question] I will accept your solution as the correct one since it contained pertinent and useful information.

Thank you for your efforts.
Jason