View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David K[_2_] David K[_2_] is offline
external usenet poster
 
Posts: 3
Default asp.net html export to excel - error

Before Excel 2007, a common way to export data to excel from an ASP.Net
applicaiton was to get a DataGrid - get it as HTML - and send it via
ResponseType to Excel.

Excel would interpret the HTML tables and show the data.

With Excel 2007, users are now getting a new warning:
"The file you are trying to open, 'filename.xls', is in a different format
than specified by the file extension... Do you want to open the file now?"

Question one - how can this warning be avoided?
Question two - if you click "yes" to the warning, the file still opens, but
it can take a very long time to open if you have over 5000 rows. It's almost
as if Excel is parsing the html cell by cell.

Any ideas? Thanks much!