Hi,
Your error just means that excel template has not been found .. below is
little snippet which should give you a hint
POIFSFileSystem fs = null;
InputStream excel =
getClass().getResourceAsStream(
"/com/example/report/templates/template.xls");
if (excel != null) {
try {
fs = new POIFSFileSystem(new
BufferedInputStream(excel));
} catch (IOException e) {
e.printStackTrace();
}
-----Original Message-----
From: Fankanowsky, Michael [mailto:[EMAIL PROTECTED]
Sent: 19. maaliskuuta 2003 17:13
To: '[EMAIL PROTECTED]'
Subject: Opening excel files out of jar
Hi all,
I have problems opening an excel template out of a jar file. I tried both
... new POIFSFileSystem(...getResourceAsStream(<filename>)) and ... new
POIFSFileSystem(...getResource(<filename>).openStream())
and received following IOException:
java.io.IOException: Unable to read entire block; 44 bytes read; expected
512 bytes
at
org.apache.poi.poifs.storage.RawDataBlock.<init>(RawDataBlock.java:98)
at
org.apache.poi.poifs.storage.RawDataBlockList.<init>(RawDataBlockList.java:8
8)
at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:
123)
When running the code in IDE I don't have any problem.
I use jakarta-poi-1.10.0-dev-20030222 and eclipse.
Does anybody have an idea ?
Kind regards,
Michael.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]