Pre Merge pull request !52 from dazer007/master

pull/52/MERGE
dazer007 5 years ago committed by Gitee
commit 4349bcf83c

@ -321,7 +321,8 @@ public class ExcelUtil<T>
*/ */
public void exportExcel(HttpServletResponse response, List<T> list, String sheetName) throws IOException public void exportExcel(HttpServletResponse response, List<T> list, String sheetName) throws IOException
{ {
response.setContentType("application/vnd.ms-excel"); //response.setContentType("application/vnd.ms-excel");
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
this.init(list, sheetName, Type.EXPORT); this.init(list, sheetName, Type.EXPORT);
exportExcel(response.getOutputStream()); exportExcel(response.getOutputStream());
@ -335,7 +336,8 @@ public class ExcelUtil<T>
*/ */
public void importTemplateExcel(HttpServletResponse response, String sheetName) throws IOException public void importTemplateExcel(HttpServletResponse response, String sheetName) throws IOException
{ {
response.setContentType("application/vnd.ms-excel"); //response.setContentType("application/vnd.ms-excel");
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
this.init(null, sheetName, Type.IMPORT); this.init(null, sheetName, Type.IMPORT);
exportExcel(response.getOutputStream()); exportExcel(response.getOutputStream());

Loading…
Cancel
Save