5
建议先去看文档 参考动态表头和web中的写,写的代码 异常代码
try {
//response.setContentType("application/x-download");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8");
fileName = URLEncoder.encode(fileName, "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream()).head(heads).sheet("sheet1");
} catch (IOException e) {
....
}
异常提示 参考动态表头和web写,写的,下载下拉的excel打开时提示“excel无法打开'xxxx',因为文件格式或扩展名无效,请确定文件未损坏........”! 建议描述