把统计表导到excel出现乱码
把统计表导到excel出现乱码public void OutExcel()
{
//Excel文件名
string fileName = DateTime.Now.ToString("yyyy-MM-dd") + "考勤报表.xls";
Response.Clear();
Response.Buffer = true;
//对文件名进行编码
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.ContentType = "application/vnd.ms-excel";
this.EnableViewState = false;
}
#endregion
}
把统计后的表格导到excel总是出现乱码,求高手帮我解决