Home > Forum > C# > How to export gridview/dataset to xlsx in asp.net c#

How to export gridview/dataset to xlsx in asp.net c#

by Thamil   on Dec 12, 2013   Category: C#  |  Views: 8068    |  Points: 5   |  Gold 
  Reply
Hi ,

How to export gridview/dataset to xlsx.
I have tried below code but not worked for me
var stringXml = ExcelHelper.GetExcelXml(ds, "ClientContactList.xlsx");
Response.Clear();
Response.AppendHeader("content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");

Question posted on behalf of Manish Chaudhari.

Bookmark and Share:
 
  User Reply  | Ask a question  |   Reply 
  Re :How to export gridview/dataset to xlsx in asp.net c#   
by Thamil
on Dec 12 2013 1:51AM
Points : 10
Gold 
Hello Manish Chaudhari,

Please refer the below link to get sample code.

http://www.dotnetgallery.com/kb/resource19-How-to-export-data-to-excel-from-gridview-and-DataTable-using-aspnet.aspx
  Re :How to export gridview/dataset to xlsx in asp.net c#   
by Michael Brown
on Mar 6 2016 11:40PM
Points : 10
Starter 
Hi,

I know this is old thread, but I also want to post here for someone who is trying to find an answer:

The following sample demonstrates how to Import/Export Data from DataTable to Excel in C#:

Operate excel document in C#--Import/Export Data from DataTable to Excel

https://code.msdn.microsoft.com/Operate-excel-document-in-881b1ce8

Recent Post

Latest Posts