Bug 46213

Summary: org.apache.poi.hssf.record.RecordFormatException: String record was supplied but formula record flag is not set
Product: POI Reporter: Duc Nguyen <duc.nguyen>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: duc.nguyen
Priority: P1    
Version: 3.2-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Input for this bug
Input to create the example of this bug

Description Duc Nguyen 2008-11-14 09:01:49 UTC
When I read the workbook with the object made by the POI and a patch file in svn r713852. I try to new HSSFWorkbook with that file, it throws RecordFormatException. 

the sample workbook is attached.

And this is detail exception:

Exception in thread "main" org.apache.poi.hssf.record.RecordFormatException: String record was  supplied but formula record flag is not  set
        at org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate.<init>(FormulaRecordAggregate.java:51)
        at org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate.construct(ValueRecordsAggregate.java:159)
        at org.apache.poi.hssf.record.aggregates.RowRecordsAggregate.<init>(RowRecordsAggregate.java:89)
        at org.apache.poi.hssf.model.Sheet.<init>(Sheet.java:199)
        at org.apache.poi.hssf.model.Sheet.createSheet(Sheet.java:161)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:282)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:196)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:178)
        at com.sds.util.AceParser.main(AceParser.java:55)
Comment 1 Duc Nguyen 2008-11-14 09:02:42 UTC
Created attachment 22874 [details]
Input for this bug
Comment 2 Josh Micich 2008-11-15 09:35:17 UTC
Fixed in svn r717883

Incidentally, do you have details on how the example file was created?
Comment 3 Duc Nguyen 2008-11-15 21:23:15 UTC
To create the example, I do steps:
 1. Copy value of each cell in row #11 into row #10.
 2. Delete row #11.
 3. Call method HSSFFormulaEvaluator.evaluateAllFormulaCells.
 4. Save.

You can get input in the attached file.
Comment 4 Duc Nguyen 2008-11-15 21:25:26 UTC
Created attachment 22878 [details]
Input to create the example of this bug