Gridview data export to excel sheet
Hi all
I am developing web app using C# 2.0,ASP.NET 2.0,SQL Server 2005.
i am exporting my gridview content to excel sheet using the following code:
protected void btnExcel_Click(object sender, EventArgs e)
{
tdExcel.Visible = false;
tdExcel2.Visible = false;
strExcel = "Excel";
Response.ContentType = "application/x-msdownload";
Response.AddHeader("content-disposition", "attachment;filename=Transfer_Report.xls");
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = string.Empty;
}
in the excel sheet i am trying to display only the table having records, so i am hiding all the images. I am successful in doing that but the problem is that my gridview paging is enabled(it has to be there because of hundreds of pages), Due to this in my excel sheet page numbers are coming along with the table. How to hide the gridview page numbers before exporting to excel sheet?
Thanks
Abhishek
|