jlolling / talendcomp_tFileExcel

Talend components tFileExcel* to read and write Excel documents
Apache License 2.0
14 stars 7 forks source link

Streaming workbook does not work while append data #38

Open jlolling opened 1 year ago

jlolling commented 1 year ago

The tFileExcelSheetOutput component rise an exception when appending data in streaming mode. java.lang.IllegalArgumentException: Attempting to write a row[4] in the range [0,1003] that is already written to disk. at org.apache.poi.xssf.streaming.SXSSFSheet.createRow(SXSSFSheet.java:146) at org.apache.poi.xssf.streaming.SXSSFSheet.createRow(SXSSFSheet.java:45) at de.jlo.talendcomp.excel.SpreadsheetFile.getRow(SpreadsheetFile.java:542) at de.jlo.talendcomp.excel.SpreadsheetOutput.writeRow(SpreadsheetOutput.java:187)

jlolling commented 1 year ago

First result. The patched class SXSSFSheet is not used anymore, instead the class shipped with Apache POI 5.2.3. In my patch it was possible to append a sheet, but not in the original implementation from POI.

jlolling commented 1 year ago

The patched SXSSFSheet works well. The append mode works now also in Streaming mode. Will publish the solution as version 13.8. Current solution works only with a locally patched apache poi lib. Will create a pull request.