|Summary:||Sheet.getSize() returns wrong value when UncalcedRecord is present|
|Product:||POI||Reporter:||Josh Micich <josh>|
|Component:||HSSF||Assignee:||POI Developers List <dev>|
Description Josh Micich 2008-05-22 20:45:57 UTC
This bug is one of a few noticed while working on bug 45046. Inspection of Sheet.getSize() and Sheet.serialize() shows that the presence of UncalcedRecord is handled differently. The discrepancy causes wrong offset values to be encoded into BoundSheetRecord. If there is more than one sheet, Excel will report errors and loose data when trying to open the book. To reproduce: Create a spreadsheet in Excel with 2 sheets. Change the workbook settings for 'recalculation' to 'manual' and uncheck the 'recalculate before save' option. Add any formula to the first sheet. Save. Read with POI and write back. Open in Excel. boom. Perhaps the biggest problem here is that HSSFWorkbook asks all the sheets for their sizes, but then doesn't care how much space they take when they are serialized.