G
Guest
Hello Everyone,
I have a gridview. I calculated some values in the gridview for the footer
of the gridview so basically I am adding all the values that are displayed in
the gridview for each column and displaying the total in the footer of the
gridview.
Now I export the gridview to excel spreadsheet with the code below.
Everything is exported well except the footer value become zero in the excel
spreadsheet. Can anyone tell me how can i fix this problem.
string attachment = "attachment; filename=Contacts.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
HtmlForm frm = new HtmlForm();
dgAgentActivity.Parent.Controls.Add(frm);
frm.Attributes["runat"] = "server";
frm.Controls.Add(dgAgentActivity);
frm.RenderControl(htw);
Any help will be greatly apprecaited.
Thanks.
I have a gridview. I calculated some values in the gridview for the footer
of the gridview so basically I am adding all the values that are displayed in
the gridview for each column and displaying the total in the footer of the
gridview.
Now I export the gridview to excel spreadsheet with the code below.
Everything is exported well except the footer value become zero in the excel
spreadsheet. Can anyone tell me how can i fix this problem.
string attachment = "attachment; filename=Contacts.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
HtmlForm frm = new HtmlForm();
dgAgentActivity.Parent.Controls.Add(frm);
frm.Attributes["runat"] = "server";
frm.Controls.Add(dgAgentActivity);
frm.RenderControl(htw);
Any help will be greatly apprecaited.
Thanks.