设置头文件
<%
response.setHeader( "Pragma ", "public"); response.setHeader( "Cache-Control ", "must-revalidate, post-check=0, pre-check=0 "); response.addHeader( "Cache-Control ", "public "); response.addHeader("Content-Disposition", "attachment; filename=posStatistic_export.xls"); response.setContentType("application/vnd.ms-excel.numberformat:@;charset=UTF-8"); %>
如果还有乱码
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Excel.Sheet><meta name=Generator content="Microsoft Excel 11">