miachm / SODS

A simple Java library for handle ODS (Open Document Spreadsheet, compatible with Excel and Libreoffice)
The Unlicense
74 stars 30 forks source link

Sods-1.2.2-snapshot supports office very well, but it is not compatible with open office. #13

Closed lbyzx123 closed 4 years ago

lbyzx123 commented 4 years ago

Version :SODS-1.2.2-SNAPSHOT.jar.zip

Sods-1.2.2-snapshot supports office very well, but it is not compatible with open office.

When reading a file edited with Apache OpenOffice, there is a memory overflow.Stack info: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at com.github.miachm.sods.Cell.(Cell.java:6) at com.github.miachm.sods.Sheet.checkLazyRowLoading(Sheet.java:306) at com.github.miachm.sods.Sheet.setRowHeight(Sheet.java:502) at com.github.miachm.sods.OdsReader.processTable(OdsReader.java:277) at com.github.miachm.sods.OdsReader.processSpreadsheet(OdsReader.java:223) at com.github.miachm.sods.OdsReader.iterateFilesEntries(OdsReader.java:216) at com.github.miachm.sods.OdsReader.processContent(OdsReader.java:77) at com.github.miachm.sods.OdsReader.load(OdsReader.java:43) at com.github.miachm.sods.OdsReader.load(OdsReader.java:35) at com.github.miachm.sods.SpreadSheet.(SpreadSheet.java:52) at com.github.miachm.sods.SpreadSheet.(SpreadSheet.java:39) at com.center.test.ODSParserHelper.getDataFromSpreadsheet(ODSParserHelper.java:72)

My file download link is: https://github.com/lbyzx123/SODS/blob/master/alarm_config_rule_openoffice.ods

lbyzx123 commented 4 years ago

Version :SODS-1.2.2-SNAPSHOT.jar.zip

Sods-1.2.2-snapshot supports office very well, but it is not compatible with open office.

When reading a file edited with Apache OpenOffice, there is a memory overflow.Stack info: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at com.github.miachm.sods.Cell.(Cell.java:6) at com.github.miachm.sods.Sheet.checkLazyRowLoading(Sheet.java:306) at com.github.miachm.sods.Sheet.setRowHeight(Sheet.java:502) at com.github.miachm.sods.OdsReader.processTable(OdsReader.java:277) at com.github.miachm.sods.OdsReader.processSpreadsheet(OdsReader.java:223) at com.github.miachm.sods.OdsReader.iterateFilesEntries(OdsReader.java:216) at com.github.miachm.sods.OdsReader.processContent(OdsReader.java:77) at com.github.miachm.sods.OdsReader.load(OdsReader.java:43) at com.github.miachm.sods.OdsReader.load(OdsReader.java:35) at com.github.miachm.sods.SpreadSheet.(SpreadSheet.java:52) at com.github.miachm.sods.SpreadSheet.(SpreadSheet.java:39) at com.center.test.ODSParserHelper.getDataFromSpreadsheet(ODSParserHelper.java:72)

My file download link is: https://github.com/lbyzx123/SODS/blob/master/alarm_config_rule_openoffice.ods

Can you help me. Thanks!

miachm commented 4 years ago

That's not a regular file of Open Office. It was generated by Excel and then edited by OpenOffice. It looks like Open Office tried to preserve the info from Excel's.

The pattern is weird. It tries to reserves 100.000 rows and then it tries to set the row 100.001th. That destroys the system of lazy loading.

I suppose that there is no way to workaround this problem. There is always a "but".

So the solution must be the new sheet's architecture: https://github.com/miachm/SODS/commit/2f6aeb1bef6e897ed69968497f3c0e276162d03a

lbyzx123 commented 4 years ago

Thanks