this is pretty easy to do in the DOTNET world. All you have to do is set the contenttype of the response to excel and write the html output to the buffer.
private void ExportToExcel()
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=Products.xls");
Response.Charset = String.Empty;
Response.ContentType = "application/ms-excel";
StringWriter stringWriter = new StringWriter();
HtmlTextWriter HtmlTextWriter = new HtmlTextWriter(stringWriter);
gvProducts.RenderControl(HtmlTextWriter);
Response.Write(stringWriter.ToString());
Response.End();
}
For complete details and explanation of the process, go to this link
http://technico.qnownow.com/2012/04/06/export-data-from-asp-net-gridview-control-to-excel/ Subbaniadu, if this helps please login to Mark As Answer. | Alert Moderator