Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created one dropdownlist.By default --All-- is selected in dropdown .If all is selected then after clicking on export to excel button it should generate two different excel documnet one for A and another for B(i.e One excel file for document related to A and other file related to B)

following is the code related ::
XML
Response.ClearContent();
             

              Response.Output.Write("<tr><td></td><td></td><td></td><td></td><td colspan='2' align='center'><div align='center' style='text-align:center'>" + imagepath + "</div></td></tr>");
              Response.AddHeader("content-disposition", "attachment; filename=" + strFileName);
              Response.AddHeader("content-disposition", "attachment;filename=" + strFileName);
              Response.ContentType = "application/excel";
              System.IO.StringWriter sw = new System.IO.StringWriter();
              HtmlTextWriter htw = new HtmlTextWriter(sw);
              dg.RenderControl(htw);
              Response.Write(sw.ToString());
              Response.End();


Give me Quick Response!!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900