How can I create more than sheets
converting different datatable
to excel?
My code:
DataTable dt = new DataTable();
dt = Tr.Get();
GridView x = new GridView();
x.DataSource = dt;
x.DataBind();
Response.Clear();
x.HeaderStyle.Font.Size = 8;
x.RowStyle.Font.Size = 10;
Response.AddHeader("content-disposition", "attachment;filename=s.xls");
Response.ContentType = "application/excel";
StringWriter stringWriter = new StringWriter();
HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);
x.RenderControl(htmlTextWriter);
Response.Write(stringWriter.ToString());
Response.End();