Hi. I try convert Listview content to word document. I use this code
string filename = "test";
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
ListView2.RenderControl(htw);
string renderedGridView = sw.ToString();
File.WriteAllText(Server.MapPath("") + "/"+filename+".doc", renderedGridView);
Response.ContentType = "applicaiton/vnd.ms-word";
Response.AddHeader("content-disposition", "attachment;filename=" + filename + ".doc");
Response.TransmitFile(Server.MapPath("") +"/"+ filename + ".doc");
code works, but in word document i get all page content with sidebar, header, etc.
i need to only listview content to word document. How i can ...
Go to the complete details ...