Bug 47305

Summary: Unable to read xls file with pivot table
Product: POI Reporter: Yuta Takahashi <ytakahashi>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P2    
Version: 3.5-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Sample SpreadSheet: Pivot Table on Sheet2

Description Yuta Takahashi 2009-06-03 00:00:05 UTC
Created attachment 23747 [details]
Sample SpreadSheet: Pivot Table on Sheet2

With POI 3.5 dev, I am getting the following error while reading an xls file with a pivot table. With POI 3.2 Final, it worked fine.

Code
===============
    HSSFWorkbook wb = null;
    try {
        FileInputStream in = new FileInputStream("pivot_test.xls");
        POIFSFileSystem fs = new POIFSFileSystem(in);
        wb = new HSSFWorkbook(fs);
        in.close();
    } catch (Exception e) {
        e.printStackTrace();
    }

Exception
===============
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance
	at org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:226)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:352)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:276)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:201)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:183)
	at test.main(test.java:15)
Caused by: org.apache.poi.hssf.record.RecordFormatException: Expected to find a ContinueRecord in order to read remaining 65535 of 65535 chars
	at org.apache.poi.hssf.record.RecordInputStream.readStringCommon(RecordInputStream.java:318)
	at org.apache.poi.hssf.record.RecordInputStream.readUnicodeLEString(RecordInputStream.java:273)
	at org.apache.poi.hssf.record.pivottable.ExtendedPivotTableViewFieldsRecord.<init>(ExtendedPivotTableViewFieldsRecord.java:57)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:224)
	... 5 more
Comment 1 Josh Micich 2009-06-04 14:58:06 UTC
Your bug is a duplicate of bug 46918 .

This regression was caused by the patch in bug 46301 .

Sometimes it helps to search with a few keywords from the stack trace. For example:

http://www.google.com/search?q=ExtendedPivotTableViewFieldsRecord+65535
http://www.google.com/search?q=ContinueRecord+readStringCommon

*** This bug has been marked as a duplicate of bug 46693 ***
Comment 2 anuj tripathi 2012-06-20 06:51:58 UTC
Hi Ytakahashi,

I am a Software Developer, and I have a requirement where I have to read an excel file containing  sheet that is having a Pivot Table.
i am able to read excel with sheet name.but requirement is different that is

>>> i want to read excel sheet with pivote table.
I need some help with you. 

Thanks.
Anuj Tripathi
Comment 3 Nick Burch 2012-06-20 06:57:19 UTC
Bugzilla is not the place to ask for help, and certainly not on long closed bugs!