/**
*
* @Title: exportExcel
* @Description: TODO(导出Excel输出流)
* @param @param fileName
* @param @param wb
* @param @param response 设定文件
* @return void 返回类型
* @throws
*/
public void exportExcel(String fileName, HSSFWorkbook wb,
HttpServletResponse response) {
try {
response.setContentType("application/ms-excel;");
response.setHeader("Content-disposition", "attachment;filename="
+ new String(fileName.getBytes("gb2312"), "ISO-8859-1") + ".xls");
OutputStream ouputStream = response.getOutputStream();
wb.write(ouputStream);
ouputStream.flush();
ouputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
导出Excel中文名
最新推荐文章于 2023-11-24 15:02:24 发布