| | |
| | | }); |
| | | } |
| | | |
| | | WriteCellStyle headWriteCellStyle = new WriteCellStyle(); |
| | | WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); |
| | | |
| | | contentWriteCellStyle.setWrapped(true); |
| | | HorizontalCellStyleStrategy horizontalCellStyleStrategy = |
| | | new HorizontalCellStyleStrategy(null, contentWriteCellStyle); |
| | | new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); |
| | | LongestMatchColumnWidthStyleStrategy longestMatchColumnWidthStyleStrategy = new LongestMatchColumnWidthStyleStrategy(); |
| | | |
| | | excelWriter = EasyExcel.write(fileName, ComMngPopulationExcelVo.class).registerWriteHandler(horizontalCellStyleStrategy).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | excelWriter = EasyExcel.write(fileName, ComMngPopulationExcelVo.class) |
| | | .registerWriteHandler(horizontalCellStyleStrategy) |
| | | .registerWriteHandler(longestMatchColumnWidthStyleStrategy) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("问卷调查答题导出数据").head(headList).build(); |
| | | excelWriter.write(datalist, writeSheet); |
| | | excelWriter.finish(); |