poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaikiran pai <jai_forums2...@yahoo.co.in>
Subject Re: Can't even read empty xls file
Date Fri, 10 Nov 2006 10:00:40 GMT
Had seen this recently. Apparently, the xls file was saved in 95 format. Changed the format
to 2003 and it worked.

----- Original Message ----
From: demi <finddemi@gmail.com>
To: poi-user@jakarta.apache.org
Sent: Friday, 10 November, 2006 3:27:06 PM
Subject: Re: Can't even read empty xls file

Hi Stephen..Did you happen to fix the  java.io.FileNotFoundException: no such
entry: "Workbook.
IF so could you please guide us appropriately.

Best Regards

Stephen Friedrich wrote:
> I created a new workbook in Excel 2003 and saved the xls using
> "Microsoft Excel 5.0/95-Arbeitsmappe" as file type.
> When I tried to read that file I get this exception:
> Exception in thread "main" java.io.FileNotFoundException: no such entry:
> "Workbook"
>     at
> org.apache.poi.poifs.filesystem.DirectoryNode.getEntry(DirectoryNode.java:245)
>     at
> org.apache.poi.poifs.filesystem.POIFSFileSystem.createDocumentInputStream(POIFSFileSystem.java:322)
>     at org.apache.poi.hssf.usermodel.HSSFWorkbook.(HSSFWorkbook.java:157)
>     at org.apache.poi.hssf.usermodel.HSSFWorkbook.(HSSFWorkbook.java:130)
> When I set a breakpoint at the throw statement and examine the contents of
> the
> "_entries" hash map that gets queried, it shows that it contains only
> these keys:
> \u0005SummaryInformation
> \u0005DocumentSummaryInformation
> Book
> So I guess for some reasons execel uses "Book" as aname when hssf expects
> "Workbook".
> I have seen similar problems with xls files from other sources (report
> generators),
> which used for example "WORKBOOK" (all upper case).
> So basically it seems that excel uses a different strategy to determine
> which entry
> actually represents the workbook.
> If I only knew which one, I'd implement a patch.
> Anayway: Any comment is highly appreciated.
> (Here's what I wanted to do originally: Since I cannot create pivot tables
> with hssf,
> I wanted to try wether I can create a 'template' xls in Excel which
> contains the
> pivot table in sheet 1 refering to actual data in sheet 2. That way I can
> maybe read
> the file, fill it with data and write it back. Should this work?)
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

View this message in context: http://www.nabble.com/Can%27t-even-read-empty-xls-file-tf1180287.html#a7274106
Sent from the POI - User mailing list archive at Nabble.com.

Yahoo! India Answers: Share what you know. Learn something new
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message