on 01-03-2008 6:40 PM
Hello,
I am using POI API to read an excel file that I have previously written using Java, but not using POI (I've written the file using Microsoft office xml and then writing it using FileOutputStream with an xls extension).
The problem is that when I read back the file I am getting this error:
The system was unable to upload the file: Invalid header signature; read 7311066695147732796, expected -2226271756974174256.
which means that the header of the file is not excel typed.
If I manually open the file and save it as excel POI is able to read it but I don't want to do this as this entire process of writing/reading the file should be automated. I don't want to use POI for writing the file because POI cannot provide me everything that I need when Microsoft office xml can.
So, my question is simple: Is there a way, using java, to set the header of a file to excel so that POI will recognize it as such?
hi roy,
@see: http://poi.apache.org/hssf/index.html
"HSSF is the POI Project's pure Java implementation of the Excel '97(-2007) file format. It does not support the new Excel 2007 .xlsx OOXML file format, which is not OLE2 based."
maybe jexcelapi supports you in writing your xls:
http://jexcelapi.sourceforge.net/
hth, jens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi roy,
well that's right: jexcelapi does not support xlsx, but is a stronger api than poi.
if you need an ooxml approach, that hope that ms does not change the specification and proceed with sax/ dom or jaxb, because as i know, there is no gnu-licensed api available for xlsx.
good luck,
regards, jens
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.