zoukankan      html  css  js  c++  java
  • 特殊符号如(▲)导到EXCEL中产生乱码

    处理方法

    1.在前台页面▲加上 。

    2.在后台强制下转换编码格式

     protected void ExportToExcel_Click(object sender, EventArgs e)
        {
            BindExportData();
            string attachment = "attachment; filename = MarkdownPerformanceOfAllSkuReport.xls";
            Response.ClearContent();
            Response.AddHeader("content-disposition", attachment);
            StringWriter stringWriter = new StringWriter();
            HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);
            ResultTable.RenderControl(htmlTextWriter);
            Response.ContentType = "application/ms-excel";
            Response.Write("<meta http-equiv=Content-Type content=\"text/html; charset=utf-8\">");
            Response.Write(stringWriter.ToString());
            Response.End();
        }

  • 相关阅读:
    Lotto--poj2245
    Avoid The Lakes--poj3620
    Fire Net--hdu1045
    变形课--hdu1181
    Apache Mina入门实例
    谈谈项目
    设计模式之装饰者模式
    linux下的权限控制
    centos 6.5 搭建JSP运行环境
    centos 6.5 搭建ftp服务器
  • 原文地址:https://www.cnblogs.com/scottpei/p/2082767.html
Copyright © 2011-2022 走看看