Bug 46213 - org.apache.poi.hssf.record.RecordFormatException: String record was supplied but formula record flag is not set
Summary: org.apache.poi.hssf.record.RecordFormatException: String record was supplied...
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.2-FINAL
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2008-11-14 09:01 UTC by Duc Nguyen
Modified: 2008-11-15 21:25 UTC (History)
1 user (show)

Input for this bug (32.00 KB, application/vnd.ms-excel)
2008-11-14 09:02 UTC, Duc Nguyen
Input to create the example of this bug (5.83 KB, application/zip)
2008-11-15 21:25 UTC, Duc Nguyen

Note You need to log in before you can comment on or make changes to 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