asp.net导出excel

T_long T_long 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
画了一个table导出的excel的,但是导 出来的不是标准的格式
怎么导出一个标准的excel
这个是导出的代码
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.Buffer = true;
System.Web.HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
System.Web.HttpContext.Current.Response.Charset = "GB2312";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
System.Web.HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" + MainID + SubID + Date + ".xls");
System.Web.HttpContext.Current.Response.Write(content.ToString());
System.Web.HttpContext.Current.Response.End();
...全文
评论 19
收藏 已收藏
分享
返回顶部
T_long
.NET社区 62,272 成员 668,968 内容