javaexcelapache-poijxl

What is the better API to Reading Excel sheets in java - JXL or Apache POI


Which of the 2 APIs is simpler to read/write/edit excel sheets ? Do these APIs not support CSV extensions ?

Using JXL for file.xls and file.xlsx, I get an exception like:

jxl.read.biff.BiffException: Unable to recognize OLE stream
    at jxl.read.biff.CompoundFile.<init>(CompoundFile.java:116)
    at jxl.read.biff.File.<init>(File.java:127)
    at jxl.Workbook.getWorkbook(Workbook.java:268)
    at core.ReadXLSheet.contentReading(ReadXLSheet.java:46)
    at core.ReadXLSheet.init(ReadXLSheet.java:22)
    at core.ReadXLSheet.main(ReadXLSheet.java:72)

Both for .xls and .xlsx extensions. Java Version I am using is : JDK1.6


Solution

  • I have used both JXL (now "JExcel") and Apache POI. At first I used JXL, but now I use Apache POI.

    First, here are the things where both APIs have the same end functionality:

    However, there are many differences:

    Additionally, POI contains not just the main "usermodel" API, but also an event-based API if all you want to do is read the spreadsheet content.

    In conclusion, because of the better documentation, more features, active development, and Excel 2007+ format support, I use Apache POI.