protected void btntoword_Click(object sender, EventArgs e)
{
//Response.Clear();
//Response.Buffer = true;
Response.ContentType = "Application/vnd.ms-excel"; // for excel only this line
Response.ContentType = "application/msword";// for word only this line
//Response.ContentEncoding = System.Text.Encoding.Default;
//Response.AddHeader("Content- Disposition", "attachment;filename=Rpt.doc");
//EnableViewState = false;
//System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
//System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
//pnMyPanel.RenderControl(oHtmlTextWriter);
//Response.Write(oStringWriter.ToString());
//Response.Flush();
//Response.Close();
}
Monday, September 20, 2010
/****** Convert to Ms word and Excel in one click ******/
Posted by
codeguru
at
11:15 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment