How to exclude footer row while export to excel from gridview

Posted by Oswaldlily under ASP.NET on 2/7/2013 | Points: 10 | Views : 1549 | Status : [Member] | Replies : 0
I m using the following method to export to excel from gridview which exporting footer row values also..But i dont require footer row..What i can do to exclude footer row...

if (gv.Rows.Count > 0)
{
Response.Buffer = true;
string attachment = "attachment; filename=Excel.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gv.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}




Responses

(No response found.)

Login to post response