How To Create .docx Files And .xlsx Files On Android
Solution 1:
You can use docx4j to create .docx files.
docx4j is an open source (Apache v2) library for creating, editing, and saving OpenXML "packages", including docx, pptx, and xslx.
So you need to use JAXB-based Java library for Word docx.
This is a helpful tutorial for that: http://www.javacodegeeks.com/2012/07/java-word-docx-documents-with-docx4j.html
Then your next question "is that compatible with the android ? " Look at this: JAXB can be made to run on Android
I think this will help you.
Solution 2:
Use Apache POI library only because It is the best out there.
Google also uses it in its Quick Office Application for Android.
For the .***x files like docx and xlsx, It might have some limits on the allowed functions in Dalvik.
Solution 3:
normally you only must to do this:
FileOutputStream archivoSalida;
HSSFWorkbookwb=newHSSFWorkbook();
HSSFSheetsht= wb.createSheet("Conciliacion");
...
...
archivoSalida = newFileOutputStream(fileDestination);
wb.write(archivoSalida);
archivoSalida.close();
But it seems that your problem is not in the code. Is in the libraries and the compilation. I'am wrong?
Solution 4:
Try using http://jexcelapi.sourceforge.net/
The jar file has a very simple apis, to manipulate/create Excel sheets.
Post a Comment for "How To Create .docx Files And .xlsx Files On Android"