FineUI 官方论坛

标题: 同样的代码,为什么一导出EXECL就出错呢? [打印本页]

作者: bluer    时间: 2014-11-7 12:00
标题: 同样的代码,为什么一导出EXECL就出错呢?
StringBuilder sb = new StringBuilder();
        sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
        sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
        sb.Append("<tr><td>asdfadfafd</td></tr></table>");
        Response.ClearContent();
        Response.AddHeader("content-disposition", "attachment; filename=" + tbxProd.Text.Trim() + ".xls");
        Response.ContentType = "application/excel";
        Response.ContentEncoding = System.Text.Encoding.UTF8;
        Response.Write(sb.ToString());
        Response.End();

[attach]6781[/attach]





欢迎光临 FineUI 官方论坛 (https://fineui.com/bbs/) Powered by Discuz! X3.4