Major bug when serving Excel 2007 files through IE?

G

Guest

I've been upgrading our reporting module to output .docx and .xlsx files
instead of the Office 2003 formats (since the new ones will work for our
clients on Office 2000 with the compatibility pack), and I've come across a
major issue in the way (I believe) IE passes the files off to Excel.

Here is the headers we're sending:

Excel:
Content Type:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Content Disposition: inline; filename=OurReport.xlsx

Word:
Content Type:
application/vnd.openxmlformats-officedocument.wordprocessingml.document
Content Disposition: inline; filename=OurReport.docx

Everything is fine with Word, but with Excel, the Open/Save dialog pops up
(this shouldn't happen with content disposition set to inline?). Save works
fine, but clicking Open loads the LOGIN page of our web application in Excel.

I've included below the http requests from the IIS log. It seems to me, that
rather than sending the body of the response to Excel, IE is *throwing away*
the report, and telling Excel to go and fetch it itself (by giving it the
URL), since "Office Existence Discover" shows up next in the logs, and since
Excel doesn't have a logged in session, our web app redirects to the login
page (which Excel badly renders).

If I put a breakpoint on the report handler, it seems to be hit twice (once,
I assume is IE taking the body to throw away, and the second is Excel which
has no login credentials).

First off, is this a bug? I can't imagine it being desired behaviour.

Secondly, does anyone have any ideas how we might work around this?

Thanks
 
G

Guest

Whoops, forgot the log:


2007-01-31 09:19:49 GET /Meritas/Reporting/ReportViewer.aspx
CombinationReportId=6
Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04506.30) -
2007-01-31 09:21:15 GET /Meritas/Reporting/Generator/rep.ashx
CombinationReportId=6
Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04506.30) -
2007-01-31 09:21:18 HEAD /Meritas/Reporting/Generator/rep.ashx
CombinationReportId=6 Microsoft+Office+Existence+Discovery -
2007-01-31 09:21:18 HEAD /Meritas/Login.aspx ReturnUrl=snipeportId=6
Microsoft+Office+Existence+Discovery -
2007-01-31 09:21:23 LOCK /Meritas/Reporting/Generator/rep.ashx
CombinationReportId=6 Microsoft+Data+Access+Internet+Publishing+Provider+DAV -
2007-01-31 09:21:23 GET /Meritas/Reporting/Generator/rep.ashx
CombinationReportId=6
Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04506.30;+MSOffice+12) -
2007-01-31 09:21:23 GET /Meritas/Login.aspx ReturnUrl=snipeportId=6
Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04506.30;+MSOffice+12) -
2007-01-31 09:21:23 HEAD /Meritas/Reporting/Generator/rep.ashx
CombinationReportId=6 Microsoft+Office+Existence+Discovery -
2007-01-31 09:21:23 HEAD /Meritas/Login.aspx ReturnUrl=snipeportId=6
Microsoft+Office+Existence+Discovery -
 
G

Guest

I've fixed it!

Well, kinda.

This only happens if the Excel file is invalid (which is fine by me).

In my case, it was invalid because the Excel 2007 snippet for "Insert a
string into cell" was broken in a few ways. Firstly, it always inserted new
rows at the end, rather than inserting them if there was a "bigger node" (I
copied the Cell code and fixed it for Row). Secondly, it did a string
comparison on the reference to decide where to put the Cell, so it was
putting AA7 between A7 and B7 instead of after Z7!

With these fixed, it now opens correctly without problem (it strangely
spawns a blank IE window, but I can live with that more than a login page in
Excel!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top