HSSFWorkbook wb = ExcelExportUtil.toExportHos(new String[]{"管理机构", "医院编码", "医院名称", "医院等级", "年案件量", "目标医院状态"},hosList);
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
try {
response.setHeader("Content-Disposition", "attachment;filename="+
java.net.URLEncoder.encode("医院信息数据导出.xls","UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
try {
OutputStream os = response.getOutputStream();
wb.write(os);
os.flush();
os.close();
wb = null;
}catch(IOException e){
e.printStackTrace();
}
java输出response流文件,配合vue进行excel流文件下载
最新推荐文章于 2024-07-09 14:00:00 发布