我看了下没发现什么问题,现把代码发出来求高手解答#regionprivatevoidExportToExcel()privatevoidExportToExcel(){Response.Clear();Response.Buffer=true;Response.Charset="utf-8"...
我看了下没发现什么问题,现把代码发出来求高手解答
#region private void ExportToExcel()
private void ExportToExcel()
{
Response.Clear();
Response.Buffer = true;
Response.Charset = "utf-8";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + strModuleName + ".xls");
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.ContentType = "application/ms-excel";
this.EnableViewState = false;
System.Globalization.CultureInfo myCItrad = new System.Globalization.CultureInfo("ZH-CN", true);
System.IO.StringWriter oStringWriter = new System.IO.StringWriter(myCItrad);
System.Web.UI.HtmlTextWriter sw = new System.Web.UI.HtmlTextWriter(oStringWriter);
try
{
展开