Bug 44951 - Error reading DVRecord with second formula
Summary: Error reading DVRecord with second formula
Status: RESOLVED DUPLICATE of bug 44710
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-FINAL
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-07 12:48 UTC by Gabriel Claramunt
Modified: 2008-05-07 19:33 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Claramunt 2008-05-07 12:48:04 UTC
(at least, decimal and date are the ones I've tried)
How to reproduce: create a new excel, select a cell and add a validation
Allow: decimal
Data: between
Minimum:0
Maximum:999999

Opening the XLS file with POI fails with an exception.

This is the stack trace
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance
	at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:199)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:117)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:207)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:148)
	at pruebas.PoiTest.testRunTest(PoiTest.java:36)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at 
...
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:80)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:44)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:315)
	at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:187)
	... 18 more
Caused by: java.lang.UnsupportedOperationException:  Unknown Ptg in Formula: 0x0 (0)
	at org.apache.poi.hssf.record.formula.Ptg.createPtg(Ptg.java:357)
	at org.apache.poi.hssf.record.DVRecord.fillFields(DVRecord.java:201)
	at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
	at org.apache.poi.hssf.record.DVRecord.<init>(DVRecord.java:134)
	... 23 more
Comment 1 Josh Micich 2008-05-07 19:33:13 UTC
Retested OK in 3.1-beta1
Problem easily reproduced in 3.0.2

I'm pretty sure this problem has little to do with Decimal and Date validation types, and more to do with the presence of the 'Maximum' value.

The fix was for bug 44710 was svn r643654.

*** This bug has been marked as a duplicate of bug 44710 ***