0

I need to export excel from my android app. I use Apache-POI library and I get en exception when I run my app "NoClassDefFoundError". But the class is in "poi-ooxml-3.9-20121203.jar" and the jar is connected as external jar. I suppose that it is impossible to use that lib in android development. Any idea or library which can help me for these points:

  1. Create Excel file
  2. Read and add rows to it
Nathan Hughes
  • 94,330
  • 19
  • 181
  • 276
HK.avdalyan
  • 724
  • 1
  • 6
  • 21
  • I don't know what the Apache POI java file is, but take a look at this: http://www.basic4ppc.com/android/forum/threads/read-write-excel-files-on-android.25632/ It may just solve all of your problems – laminatefish Sep 25 '13 at 13:48

2 Answers2

0

I have been trying to use Apache POI for my app too and my conclusion was that it has dependencies that conflict with Android. Atleast I was not able to make it work, even with a quite amount of effort.

If the excel documents you wish to export are rather simple, I would suggest using jxl instead. This library unfortunately only supports old excel formats though.

Lars Vogel has made a nice tutorial showing how this is done: http://www.vogella.com/articles/JavaExcel/article.html

Yet another argument for not using POI is the size of the library. It is rather big, hence leaving a huge impact on your app size.

If you really want to use POI, I suggest creating a simple web service for it, having your app call that to create the excel documents.

cYrixmorten
  • 7,110
  • 3
  • 25
  • 33
0

you can use the latest poi 3.17 for excel xlsx format and run this on android ,provided you have eliminate all the duplicate classes bundle in the xmlbeans-2.6.0.jar, lot of duplicate classes are found under xml /streams and xml/utils, all you need to do is to use the normal zip manager such as 7 zip manager to open and delete off ,some of the examples are as below enter image description here all those duplicate classes found in the xmlbeans jar .

unfortunately , you can not use any POI method associate with call to java awt library specifically use by POI to work on picture resize or row resize.

thanks

link