System.IO.StringWriter sw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(sw); this.reptStaff.RenderControl(hw); Response.Clear(); Response.ContentType = "application/vnd.ms-excel"; Response.Charset = ""; Page.EnableViewState = false; Response.AppendHeader("Content-Disposition", "attachment;filename=Teacher.xls"); Response.Write("<html><head><meta http-equiv=Content-Type content=/"text/html; charset=utf-8/"><title> Copyright by SDU</title></head><body><center>"); Response.Write(sw.ToString()); Response.Write("</center></body></html>"); Response.End();
服务器 导出excel
最新推荐文章于 2021-12-07 17:42:53 发布