标签:style blog http color os 数据 io re
Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8"); Response.Charset = ""; Response.ContentType = "application/vnd.ms-excel"; EnableViewState = false; System.IO.StringWriter tw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter hw = new HtmlTextWriter(tw); Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("统计.xls", System.Text.Encoding.UTF8)); gvData.RenderControl(hw); Response.Write(tw.ToString()); Response.End();
将GridView数据直接导出为EXCEL(保留样式),适用GV不分页的情况,布布扣,bubuko.com
将GridView数据直接导出为EXCEL(保留样式),适用GV不分页的情况
标签:style blog http color os 数据 io re
原文地址:http://www.cnblogs.com/PeaCode/p/3868554.html