4

As Apache POI supports Microsoft office and JExcelApi supports Open Office, is there any Java library which supports both Microsoft office and Open Office?

Note: In the pom.xml file we are using either POI and JExcel utilities in order to fetch/read data from the Excel sheet in Microsoft office and Open Office respectively.

So my question: Is there any library which supports both?

Petr Janeček
  • 37,768
  • 12
  • 121
  • 145
mfsi_sudhansu
  • 175
  • 2
  • 3
  • 10
  • 1
    http://jexcelapi.sourceforge.net/ states that JExcel API supports `Excel 95, 97, 2000, XP, and 2003 workbooks`. There's no word about Open Office. Anyway, OO has its own [Java API](http://www.openoffice.org/api/) ([guide](http://wiki.openoffice.org/wiki/Documentation/DevGuide)). I don't know any library that would be able to open both MS and OO documents. – Petr Janeček Jul 22 '13 at 13:07
  • Why do you need one library that supports both? You could also just use two libraries, one for MS Office and one for Open Office support. – Jesper Jul 22 '13 at 13:33
  • What do you need to do? Get text out? Read rich values? Write changes? – Gagravarr Jul 22 '13 at 13:45

3 Answers3

4

Aspose covers all of Microsofts formats, but it is not free and not open source.

Regarding open source Java API, you can find a review on each available java library here,

http://www.esupu.com/open-source-office-document-java-api-review/

Apache UNO Java library supports all according to my knowledge and it's free and open source but it need a Open Office installation to process and it's documentation is heavy and not that much clear

Supun Sameera
  • 2,683
  • 3
  • 17
  • 14
0

There is probably no library that would support both formats. If you don't want to use a library (and write the needed code) for each format, you can try a workaround.

Use a converter to convert .xls to .odt (or the other way around), then use your favourite library to handle that one format.

Available converters I found via quick Googling, I'm sure you'll find more:

Consider converting both formats to something more friendly, like a CSV (more CSV) or XML.

Petr Janeček
  • 37,768
  • 12
  • 121
  • 145
-1

docx4j is a Java library for creating and manipulating Microsoft Open XML (Word docx, Powerpoint pptx, and Excel xlsx) files.

Docx4j