I am using the following code to export excel from html string.
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition",
"attachment;filename=" + DateTime.Now.ToString("MM- dd-yyyy H:mm:ss") +
"-FormAndImunizationTracker" +
".xls");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Write(htmlString);
Response.End();
return null;
This is working fine but i need to add 2 more worksheets in the same excel for different report. I already have created html string for those report. How would I create worksheets and add the content into that. Thanks for you help.