I need to read a Excel 2007 xlsx file in a java application. Does anyone know of a good api to accomplish this task?
Thanks in advance for any advice given.
-MrPortico
I need to read a Excel 2007 xlsx file in a java application. Does anyone know of a good api to accomplish this task?
Thanks in advance for any advice given.
-MrPortico
I had to do this in .NET and I couldn't find any API's out there. My solution was to unzip the .xlsx, and dive right into manipulating the XML. It's not so bad once you create your helper classes and such.
There are some "gotchas" like the nodes all have to be sorted according to the way excel expects them, that I didn't find in the official docs. Excel has its own date timestamping, so you'll need to make a conversion formula.
Have you looked at the poorly obfuscated API?
Nevermind:
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.
You might consider using a JDBC-ODBC bridge instead.
AFAIK there are no xlsx-libraries available yet. But there are some for old xls:
One library is jxls which internally uses the already mentioned POI.
2 other links: Handle Excel files, Java libraries to read and write Excel XLS document files.
This one maybe work for you, it can read/write Excel 2007 xlsx file. SmartXLS
I'm not very happy with any of the options so I ended up requesting the file in Excel 97 formate. The POI works great for that. Thanks everyone for the help.
Apache POI 3.5 have added support to all the OOXML (docx, xlsx, etc.)
See the XSSF sub project
i have one query I have used jdbc-odbc bridge but it uses sql query to fetch the data So it depends on name of sheet whatever we have given in workbook But i want to make it independent of sheet name Can anybody help me?
thanks in advance
Aditi
http://poi.apache.org/spreadsheet/quick-guide.html
this link should help. XLSX and DOCX
docx4j now covers xlsx as well.
"Why would you use docx4j to do this", I hear you ask, "rather than POI, which focuses on xlsx and binary xls?"
Probably because you like JAXB (as opposed to XML Beans), or you are already using docx4j for docx or pptx, and need to be able to do some stuff with xlsx as well.
Another possible reason is that the jar XML Beans generates from the OpenXML schemas is too big for your purposes. (To get around this, POI offers a 'lite' subset: the 'big' ooxml-schemas-1.0.jar is 14.5 MB! But if you need to support arbitrary spreadsheets, you'll probably need the complete jar). In contrast, the whole of docx4j/pptx4j/xlsx4j weighs in at about the same as POI's lite subset.
If you are processing spreadsheets only (ie not docx or pptx), and preceding paragraph is not a concern for you, then you would probably be best off using POI.