仅供参考。注意点1是多sheet导出时,sheetNo 和 sheetName 要根据页数变更。如果sheetName一样,会导出在一个sheet中,另外我是自定义head,不是用对象去定义的。这样更灵活些。 @Override public void exprot(HttpServletResponse response,List<Long> ids) { List<SupplyPlanHeadDTO> exportData = new ArrayList<>(); List<List<String>> head = new ArrayList<>(); ; List<List<String>> body = new ArrayList<>(); ; List<String> productBarCode = Lists.newArrayList(); List<String> productName = Lists.newArrayList(); List<String> regionWarehouseName = Lists.newArrayList(); productBarCode.add("xxx"); productName.add("xxx"); regionWarehouseName.add("xxx"); ExcelWriter excelWriter = null; try { response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding("utf-8"); fileName = URLEncoder.encode("导出报表&
easyExcel 多sheet导出
最新推荐文章于 2024-07-05 15:43:14 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)