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.<init>(HSSFWorkbook.java:157)
at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(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: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/