Response.Clear();
Response.Buffer = true;
Response.Charset = "GB2312";
Response.AppendHeader("Content-Disposition", "attachment;filename=FileName.xls");
// 如果设置为 GetEncoding("GB2312");导出的文件将会出现乱码!!!
Response.ContentEncoding = System.Text.Encoding.UTF7;
伊图教程网[www.etoow.com]
http://www.etoow.com/html/2007-08/1187097171.html
Response.ContentType = "application/ms-excel";//设置输出文件类型为excel文件。
导出到Excel
'http://www.etoow.com/html/2007-08/1187097171.html