views:

688

answers:

4

Which is better API for excel parsing in Java Apache POI or JExcel API? In terms of speed, memory utilization and code stability.

+1  A: 

I recommend using Apache POI, which I used before, especially if you support the Office 2007/8 OpenXML format. JExcel doesn't support that. Apache POI also supports the Office applications.

I cannot comment on the performance part. However, I did have a very large Excel document (millions of columns) but with a relatively small file (few megabites). POI did take few minutes to parse it and modify it. However, in this case, Excel itself took minutes just to load the document.

notnoop
A: 

Apache POI is good with the latest formats, but speed wise(parsing) JExcel is better(JExcel doesn't support OpenXML format as notnoop said)

Richie
+3  A: 

Personally I would recommend POI over JExcel. The reasons I chose POI over JExcelAPI are:

  1. POI supports both old and new MS Excel sheet formats
  2. It has a cleaner API (imho)
  3. As far as I can see it does not suffer from the irritating Date\Time issues that JexcelApi has (Date display).

I have had the opportunity to use both. POI, in my opinion, has a really well thought out and easy to use API. The biggest benefit from my perspective is that you can factory off the creation of the worksheet instance and then deal with everything in the context of the usermodel interfaces. This means your code can process both old and new Excel file formats without having to worry about which is which.

Additionally, you are able to read and write the same Worksheet instance. With JExcelApi there is this really strange split between "readable" sheets and "writable" sheets which I found odd. This also resulted in me having to introduce messy work arounds to move from "reading" to "writing" in my code.

I did not notice meaningful performance difference using POI on old, binary files (POI HSSF) and JExcelApi. There is however a significant performance difference between POI HSSF (old format) and POI XSSF (new format). I assume this is because of all the extra work required for unpacking and parseing XML.

Malcolm Featonby
I second Apache POI. Even better since the 3.5 final release.
JasCav
thanks. Will give a try.
Venkat
A: 

JExcelAPi is better than Apache POI except that it does not support Excel 2007 format.

liya