Bug 47305 - Unable to read xls file with pivot table
Summary: Unable to read xls file with pivot table
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.5-dev
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2009-06-03 00:00 UTC by Yuta Takahashi
Modified: 2012-06-20 06:57 UTC (History)
0 users

Sample SpreadSheet: Pivot Table on Sheet2 (21.50 KB, application/vnd.ms-excel)
2009-06-03 00:00 UTC, Yuta Takahashi

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

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

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:


*** 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. 

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!