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();
}
Logo

前往低代码交流专区

更多推荐