Doesn't anyone else get this?
On Tue, Oct 5, 2010 at 12:35 AM, Nico Mommaerts <[email protected]>wrote:
> Hey,
>
> I'm reading an Excel2007 file with 2 sheets, one being a chartsheet. When I
> want to get the sheetnames I get a NPE.
> I couldn't find this in the buglist or the mailing list.
>
> Example:
> OPCPackage opcPackage = OPCPackage.open(file.getAbsolutePath(),
> PackageAccess.READ);
> XSSFReader xssfReader = new XSSFReader(opcPackage);
>
> for (SheetIterator sheetIterator = (SheetIterator)
> xssfReader.getSheetsData(); sheetIterator.hasNext();) {
> sheetIterator.next();
> System.out.println(sheetIterator.getSheetName());
> }
>
> This is the offending code in the SheetIterator class:
> public InputStream next() {
> ctSheet = sheetIterator.next();
>
> String sheetId = ctSheet.getId();
> try {
> PackagePart sheetPkg = sheetMap.get(sheetId);
> return sheetPkg.getInputStream();
> } catch(IOException e) {
> throw new POIXMLException(e);
> }
> }
>
> The returned PackagePart is null for a chartsheet.
> I get this in 3.6 as well as in 3.7-beta3. Is this already known or is
> there a workaround?
>
>
>