views:

573

answers:

5

All I need to do is open an MS excel sheet - not sure which kind yet (2003, 2007, etc.) - and parse the information in each row into an object. I'm performing only readonly operations.

out of Apache POI, JExcelAPI, or OpenXLS which is best for this task?

I'd rather not find out about anymore api's but if you're certain that none of these are the best then I'll take your input.

+3  A: 

I have used POI only but found it to be simple to use and work as advertised.

Steve B.
I second POI. Plus it advertises support for 2007 format (I haven't tried it myself yet, can't vouch for it); JExcelAPI only supports 2003.
ChssPly76
I'm very impressed with POI's usability but i'm constently finding inconsistencies between the library and the documentation which is making it very confusing to learn. :P
Victor
+2  A: 

I have used only JExcelAPI, and found it quite usable and solid. Encountered one weirdness, but it was in writing, not reading, and is clearly documented (with solution) in their FAQ, so - happy to recommend it.

Carl Manaster
A: 

Another commercial java Excel spreadsheet component is SmartXLS for java.

It support read/write excel file,formula calculation,excel chart,pivot table...etc.

liya
+2  A: 

I do NOT recommend OpenXLS. I used it for a little while but became very frustrated by the limits of the free version. If you want to write formulae, for example, you can't. Unless you buy the commercial version that the company behind OpenXLS sells, anyway.

I've been using JExcelAPI for the last few months and am quite impressed with it. It's very easy to use it to read and write Excel spreadsheets. The documentation is fairly good but it could be better. If you haven't already made your choice, I would recommend JExcelAPI to you.

I'm afraid that I haven't tried POI so I can't comment on it.

Cosmic Flame
A: 

FWIW, Extentech -- the makers of OpenXLS -- released a new version that now supports adding formulas and executing them like so:

CellHandle cx = sheet.add("=sum(a1+a2)","b1"); String val = cx.getFormulaHandle().getFormattedValue();

Also, you will find that Sheetster.com is an open source web spreadsheet from Extentech and you can embed a nice web spreadsheet in your web apps.

johnnyshredder