3
模板列表填充,模板Excel有设定的格式,每行不一样,但是填充后全是按照第一行的格式往下复制,怎么办? 试了使用afterCellDispose,只设置了cell.setCellStyle(style),但是其他的cell全变成这样了
@Override
public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, List<CellData> cellDataList, Cell cell, Head head, Integer relativeRowIndex, Boolean isHead) {
CellStyle style = cell.getCellStyle();
//设置边框样式
if(StringUtils.isNotBlank(cell.getStringCellValue())) {
style.setBorderLeft(BorderStyle.THICK);
// contentWriteCellStyle.setBottomBorderColor(IndexedColors.BLUE.getIndex()); //颜色
style.setBorderRight(BorderStyle.THICK);
style.setBorderBottom(BorderStyle.THIN);
cell.setCellStyle(style);
}
}