Export HTML to DOC/PDF with header and footer
-
Hi i have an html report in asp.net I want to export html report to word .. I am able to do that by following code ..but i want to have predefined header and footer in exported word document... so how to set header/footer of ms-word document from asp.net code. ------------------------------------------CODE----------- string strHTMLContent = reader.ReadToEnd(); strHTMLContent = strHTMLContent.Replace("#Education#", "BE"); strHTMLContent = strHTMLContent.Replace("#Position#", "Software Engineer"); lblmsg.Text = strHTMLContent; HttpContext.Current.Response.Clear(); HttpContext.Current.Response.Charset = ""; HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8; HttpContext.Current.Response.ContentType = "application/ms-word"; string strFileName = "new1" + ".doc"; HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + strFileName); HttpContext.Current.Response.Write(strHTMLContent); HttpContext.Current.Response.End(); HttpContext.Current.Response.Flush();