瀏覽代碼

如果是第一个记录,默认重新开始进行分组

4.1.3.A
Twenty 6 年之前
父節點
當前提交
b1b3cb92a0
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      easypoi-base/src/main/java/cn/afterturn/easypoi/excel/export/ExcelExportService.java

+ 1
- 1
easypoi-base/src/main/java/cn/afterturn/easypoi/excel/export/ExcelExportService.java 查看文件

@@ -82,7 +82,7 @@ public class ExcelExportService extends BaseExportService {
for (int i = 0, exportFieldTitleSize = excelParams.size(); i < exportFieldTitleSize; i++) {
ExcelExportEntity entity = excelParams.get(i);
// 加入换了groupName或者结束就,就把之前的那个换行
if (StringUtils.isBlank(entity.getGroupName()) || !entity.getGroupName().equals(excelParams.get(i - 1).getGroupName())) {
if (StringUtils.isBlank(entity.getGroupName()) || i = 0 || !entity.getGroupName().equals(excelParams.get(i - 1).getGroupName())) {
if (groupCellLength > 1) {
sheet.addMergedRegion(new CellRangeAddress(index, index, cellIndex - groupCellLength, cellIndex - 1));
}


Loading…
取消
儲存