Using dev-10022001.
I was getting pretty excited about POI but further exploration has left
me dubious about it.
I created a 3-sheet workbook with a chart, a picture, some macros, and
some formulae. I wasn't even able to copy it using the following code
taken from ReadWriteWorkbook:
POIFSFileSystem fs =
new POIFSFileSystem(new
FileInputStream("c:/Temp/template_noforms.xls"));
HSSFWorkbook wb = new HSSFWorkbook(fs);
FileOutputStream fileOut = new
FileOutputStream("c:/Temp/modtemplate_noforms.xls");
wb.write(fileOut);
fileOut.close();
Excel says the copied file is too damaged to repair. Alright, says I,
maybe it can't handle the formulae. Removed them, same problem. Removed
the macros, try again. Same. Removed the picture, try again. Same.
Removed the chart, still no luck.
Now I'm down to 3 simple sheets and I still can't copy the workbook,
much less modify and rewrite it. Very disappointing.
I get the following from BiffReader when running it on the copied file:
java.lang.ArrayIndexOutOfBoundsException
at
org.apache.poi.util.LittleEndian.getNumber(LittleEndian.java:557)
at
org.apache.poi.util.LittleEndian.getShort(LittleEndian.java:90)
at
org.apache.poi.hssf.record.PaletteRecord.fillFields(PaletteRecord.jav
a:118)
at org.apache.poi.hssf.record.Record.fillFields(Record.java:143)
at org.apache.poi.hssf.record.Record.<init>(Record.java:105)
at
org.apache.poi.hssf.record.PaletteRecord.<init>(PaletteRecord.java:91
)
at
org.apache.poi.hssf.dev.BiffViewer.createRecord(BiffViewer.java:622)
at
org.apache.poi.hssf.dev.BiffViewer.createRecords(BiffViewer.java:158)
at org.apache.poi.hssf.dev.BiffViewer.run(BiffViewer.java:110)
at org.apache.poi.hssf.dev.BiffViewer.main(BiffViewer.java:687)
Aha! Since the failure is at something called PalletteRecord, maybe the
problem is that I modified the color palette for the workbook so it
would contain entries for my company color scheme?
> -----Original Message-----
> From: Dennis Doubleday [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 11, 2002 5:10 PM
> To: 'POI Users List'
> Subject: RE: Data format - can't figure out what I'm doing wrong
>
>
> Ignore what I said before about BigExample having a bug--I
> read it wrong. However, the data format applied in BigExample
> doesn't seem to have any effect anyway--all the cells
> produced have "General" format.
>
> > -----Original Message-----
> > From: Dennis Doubleday [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, October 11, 2002 4:34 PM
> > To: [EMAIL PROTECTED]
> > Subject: Data format - can't figure out what I'm doing wrong
>
> > It is worth noting that BigExample has a bug I think that
> > doesn't actually demonstrate the data format usage because it
> > tries to alternate cell style settings but tests for (mod % 2
> > == 0) in both cases, so the first style gets overwritten
> > (lines 150 and 165).
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:poi-user-> [EMAIL PROTECTED]>
> For
> additional commands,
> e-mail: <mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>