This article provides a brief knowledge to get your data in excel sheet.
public void ExportData(DataTable dset)
{
HttpResponse response = HttpContext.Current.Response;
// first let's clean up the response.object
response.Clear();
response.Charset = "";
// set the response mime type for excel
//Dim filename As String = "Record.xls"
string filename = "Report(" + "" + DateTime.Now.ToString("dd-MM-yyyy") + ").xls";
response.ContentType = "application/vnd.ms-excel";
response.AddHeader("Content-Disposition", "attachment;filename=\"" + filename + "\"");

Join the conversation! Your thoughts help the community grow.