Wednesday, September 26, 2018

Convert Table to Word Document

<div id="divExport" runat="server"> 

      <table >

       //developed format as  your requirement

     </table>


</div>


<button click   event>

{

            Response.AddHeader("content-disposition", "attachment;filename=letter6month.doc");
            Response.Charset = "";
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.ContentType = "application/doc";
            System.IO.StringWriter stringWrite = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
            divExport.RenderControl(htmlWrite);
            Response.Write(stringWrite.ToString());
            Response.End();


}




No comments:

Post a Comment

ADVANCE 2025

 HTML TABLE SCROLL BAR  <style>      .table-container {             width: 100%;             overflow-x: auto; /* Enables horizontal s...