public void BindAndRender(System.Data.DataTable dtInput) { string title = "OthersAbroad_BankReport"; Response.Clear(); Response.Buffer = true; StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); gvExportDoc.AllowPaging = false; gvExportDoc.DataSource = dtInput; gvExportDoc.DataBind(); Response.ContentType = "application/vnd.ms-doc"; Response.AddHeader("content-disposition", "attachment;filename=" + title + ".doc"); Response.Charset = ""; gvExportDoc.RenderControl(hw); string style = @"<style> .textmode { mso-number-format:\@; } </style>"; Response.Write(style); Response.Output.Write(sw.ToString()); Response.Flush(); Response.End(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)