protected void lnkPrint_Click(object sender, EventArgs e) { Response.Clear(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment;filename=finance.xls"); Response.Charset = "UTF-8"; Response.ContentType = "application/vnd.ms-excel"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); rptProduct.RenderControl(htmlWrite); Response.Write("<table>"); Response.Write(stringWrite.ToString()); Response.Write("</table>"); Response.End(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)