FineUI 官方论坛
标题:
Grid动态列导出Excel,本地无误,上传服务器后表头乱码
[打印本页]
作者:
teenagermostr
时间:
2017-5-25 09:53
标题:
Grid动态列导出Excel,本地无误,上传服务器后表头乱码
手动加的列:
[attach]10175[/attach]数据库读取的列:
[attach]10176[/attach]
--
本地效果:
[attach]10177[/attach]显示正常
服务器显示效果
[attach]10178[/attach]
导出代码:
#region 导出
protected void btn_Print_Click(object sender, EventArgs e)
{
DataTable table = JCSJCXCommon.GetData(sql, 1, where, Convert.ToInt32(lbl_cou.Text));
Grid1.DataSource = table;
Grid1.DataBind();
Response.ClearContent();
//Response.AddHeader("content-disposition", "attachment; filename=aaa.xls");
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("aaa.xls", Encoding.UTF8).ToString());
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.EnableViewState = false;
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
#endregion
---求大神指点
欢迎光临 FineUI 官方论坛 (https://fineui.com/BBS/)
Powered by Discuz! X3.4