From fdeb31794078057955e615e62c60639208298307 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Tue, 9 Jun 2020 16:24:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A1=AB=E5=85=85=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E6=9C=80=E5=90=8E=E4=B8=80=E8=A1=8C?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E6=9C=89=E7=A9=BA=E8=A1=8C=E4=BC=9A=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=A4=B1=E8=B4=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/write/executor/ExcelWriteFillExecutor.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java index 1a42fde1..383d31f9 100644 --- a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java @@ -303,7 +303,13 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { if (fillConfig.getForceNewRow()) { row = cachedSheet.createRow(lastRowIndex); } else { - row = sheet.createRow(lastRowIndex); + // The last row of the middle disk inside empty rows, resulting in cachedSheet can not get inside. + // Will throw Attempting to write a row[" + rownum + "] " + "in the range [0," + this._sh.getLastRowNum() + "] that is already written to disk. + try{ + row = sheet.createRow(lastRowIndex); + }catch (IllegalArgumentException ignore){ + row = cachedSheet.createRow(lastRowIndex); + } } checkRowHeight(analysisCell, fillConfig, isOriginalCell, row); WriteHandlerUtils.afterRowCreate(writeContext, row, null, Boolean.FALSE);