Bug 49175 - POI is reading the data incorrectly in case the sheets were shifted
Summary: POI is reading the data incorrectly in case the sheets were shifted
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.6-FINAL
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-23 06:02 UTC by amitkale
Modified: 2011-06-24 10:22 UTC (History)
1 user (show)



Attachments
The attached file contains the code snippet and input excel file (10.24 KB, application/x-zip-compressed)
2010-04-26 03:01 UTC, amitkale
Details

Note You need to log in before you can comment on or make changes to this bug.
Description amitkale 2010-04-23 06:02:08 UTC
Hi , I am having workbook which has sheet1, sheet2 and sheet3 viz. If i add a range01 inside sheet3 and shifts the sheet3 before sheet2 and try to read the data from range01 it doesnt work correctly.

I am using AbortableHSSFListener to read the data from the range.
Please find the attached code for reference. Urgent help will be highly helpful for us as its blocking issue for us.
Comment 1 Yegor Kozlov 2010-04-24 13:00:51 UTC
Please attach the workbook and sample code to reproduce the problem. 

Yegor
Comment 2 amitkale 2010-04-26 03:01:02 UTC
Created attachment 25351 [details]
The attached file contains the code snippet and input excel file

We are trying to read the header row from the range "Range_01" which is part of "sheet2" . The expected output is header row of Range_01 while actual output is the same row from different sheet (i.e. sheet1).

On debugging what we have obesrved is the sheetIndex associated with Range_01 is coming invalid. Please let us know how we can resolve this.

Thanks,
Amit
Comment 3 Yegor Kozlov 2011-06-24 10:22:50 UTC
Use high-level usermodel API and you will be good. 

By using a low-level HSSFListener you are taking the burden of processing BIFF records, it requires a good knowledge of the Excel BIFF8 format and in cases like your it is not trivial. Spreadsheet usermodel API already does it for you, just try.

Yegor