Export GridView to Excel (xlsx, Excel 2007 Format)

  • Thread starter Thread starter walter
  • Start date Start date
W

walter

Hi
I have my application running in Windows 2000 and uses Office 2000.
Below is the code wrriten to export excel file
Response.ContentType = "application/vnd.ms-excel"
If i try to run the same code in VISTA or XP Machine which uses Office 2007.
I am getting below error.
"The format not supported ... " what it could be the cause and how to
resolve this.
Irrespective of Windows 2000 (Office 2000) , VISTA (Office 2007) or
XP(Office 2007).
Do i need to write any specific code for each OS i use or a single code
which can fix my problem.

Kindly help in this

Thanks
Mwalter.
 
Export to Excel 2007 xlsx format

xlsx excel format is completely different form any other excel format. It's basically a zipped file! To verify this you can rename an xlsx file to zip and then double click it.

You'll find a lot of xml files inside organized accordingly to Microsoft Office Open xml format specifications.


I :) developed a tool (a dll) which allows an asp.net developer to export data to xls and xlsx starting from sqldatasource, sqldatareader, etc with or without the use of a gridview.

Of course it does NOT require you to install Office on your machine!

You can find it at http://www.gridviewtoexcel.com.

Hope this can help!

Ettore
 
Back
Top