Last post Mar 01, 2018 08:09 AM by PatriceSc
Feb 27, 2018 03:17 PM|threeo|LINK
I have a web app that has been running fine for years. recently, users are reporting that when they click "export to excel", which uses the gridviewexportutil to create a older XLS file, they receive the error message "the file format and extension don't
has anyone encountered this or know how to fix it?
Feb 27, 2018 06:39 PM|PatriceSc|LINK
You export HTML markup pretending this is an XLS file and since few version users are warned agains this kind of discrepancy. Also it is inconvenient for users as they don't always realize this and they can have strange messages down the road if adding unsupported
stuff to what is actually an HTML file.
Try perhaps to keep the mime type but keep a .htm extension to see what happens. At some point I would consider to create true XLS (or XLSX file) using the OpenXML SDK or some other Excel file generation Library.
Feb 27, 2018 06:49 PM|threeo|LINK
I'm using the gridview export utility to create an excel file. it comes up and says "do you want to open myfilename.xls or save?
it's only after excel then launches and tries to open the xls file that the error is generated. I believe Microsoft added a patch the excel to generate this error in order to prevent backward compatability issues. it HAD been working just fine. for YEARS.
Feb 28, 2018 08:44 AM|Cathy Zou|LINK
That is a link basically describing that MS knows about the problem your describe and that it cannot be suppressed from within ASP.NET code. It must be suppressed/fixed on the client's registry.
Mar 01, 2018 08:09 AM|PatriceSc|LINK
Excel was upgraded or patched. It behaves this way since Excel 2013 if not Excel 2007 (for example if you renamve a xls file to xlsx or the other way round).
IMO your best bet is to embrace this change and to generate true XLS or XLSX file.