From b1b3cb92a029641bae8f0aa581cc8b093d42dedd Mon Sep 17 00:00:00 2001 From: Twenty Date: Thu, 11 Oct 2018 17:17:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=98=AF=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E8=AE=B0=E5=BD=95=EF=BC=8C=E9=BB=98=E8=AE=A4=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E5=BC=80=E5=A7=8B=E8=BF=9B=E8=A1=8C=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/afterturn/easypoi/excel/export/ExcelExportService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easypoi-base/src/main/java/cn/afterturn/easypoi/excel/export/ExcelExportService.java b/easypoi-base/src/main/java/cn/afterturn/easypoi/excel/export/ExcelExportService.java index be00db3..b314767 100644 --- a/easypoi-base/src/main/java/cn/afterturn/easypoi/excel/export/ExcelExportService.java +++ b/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)); }