B4J Library jPOI - Supports Microsoft Excel xls and xlsx Workbooks

Discussion in 'B4J Libraries & Classes' started by Erel, Aug 19, 2015.

  1. StarinschiAndrei

    StarinschiAndrei Active Member Licensed User

    Sorry i didn't tell what i want to do, i would like to read an existing sheet from an existing xlsx file.
     
  2. StarinschiAndrei

    StarinschiAndrei Active Member Licensed User

    thank you , i found the solution : Dim sheet As PoiSheet=wb.GetSheet(0)
     
  3. Laurent95

    Laurent95 Active Member Licensed User

    Hello,

    Thanks for this library who is already very useful, but i stay to think to futures possibilities.
    There are many other properties in the Java project in comparison of those who are accessible on Excel. ie page setup, named cells, etc. And it seems the library can access to many other object like OLE2 Word, PowerPoint etc.
    This library could be improved on properties or on documents format in time ?

    Thanks for reply if someone have an idea on this.

    Regards.
     
  4. peacemaker

    peacemaker Well-Known Member Licensed User

    I hope, in any future the possibility to save .DOC also will be wrapped ? For start maybe some main classes for .DOC creation - text with fontsize+fontcolor and a picture insertion.
     
    Laurent95 likes this.
  5. Erel

    Erel Administrator Staff Member Licensed User

  6. Stefano Bordini

    Stefano Bordini Member Licensed User

    Hi everybody,i try to read xlsx file with this code

    Code:
    Dim wb As PoiWorkbook
        wb.InitializeExisting(
    "/home/pi/billi/","Billi.xlsx","")
    this code in windows work but when i try in raspberry the program don't work he's block in this action,before this action i read sqlite db and this operation work correctly.
    Sometime after 1 minues the program exit without messages
    and sometime with this error
    Waiting for debugger to connect...
    Program started.
    java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:3210)
    at java.util.Arrays.copyOf(Arrays.java:3181)
    at java.util.ArrayList.grow(ArrayList.java:261)
    at java.util.ArrayList.ensureExplicitCapacity(ArrayList.java:235)
    at java.util.ArrayList.ensureCapacityInternal(ArrayList.java:227)
    at java.util.ArrayList.add(ArrayList.java:458)
    at org.apache.xmlbeans.impl.values.NamespaceContext$NamespaceContextStack.push(NamespaceContext.java:81)
    at org.apache.xmlbeans.impl.values.NamespaceContext.push(NamespaceContext.java:106)
    at org.apache.xmlbeans.impl.values.XmlObjectBase.check_dated(XmlObjectBase.java:1318)
    at org.apache.xmlbeans.impl.values.XmlObjectBase.getStringValue(XmlObjectBase.java:1529)
    at org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTCellImpl.getR(Unknown Source)
    at org.apache.poi.xssf.usermodel.XSSFCell.<init>(XSSFCell.java:106)
    at org.apache.poi.xssf.usermodel.XSSFRow.<init>(XSSFRow.java:68)
    at org.apache.poi.xssf.usermodel.XSSFSheet.initRows(XSSFShee
    t.java:238)
    at org.apache.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:201)
    at org.apache.poi.xssf.usermodel.XSSFSheet.onDocumentRead(XSSFSheet.java:188)
    at org.apache.poi.xssf.usermodel.XSSFWorkbook.onDocumentRead(XSSFWorkbook.java:378)
    at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:166)
    at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:241)
    at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:175)
    at anywheresoftware.b4j.objects.PoiWorkbookWrapper.InitializeExisting(PoiWorkbookWrapper.java:53)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:656)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:232)
    at anywheresoftware.b4a.shell.She
    ll.raiseEvent(Shell.java:159)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
     
    Last edited: Jun 26, 2016
  7. Erel

    Erel Administrator Staff Member Licensed User

    You are running out of memory. Try to increase the heap size. You will need to run it from the terminal with:
    Code:
    java -Xmx512m -jar <your jar>
     
  8. Stefano Bordini

    Stefano Bordini Member Licensed User

    i can launch this mode inside ide editor of B4J with debug mode?
     
    Last edited: Jun 26, 2016
  9. Stefano Bordini

    Stefano Bordini Member Licensed User

    This mode work but is very slow
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    No. Usually it is done with the #VirtualMachineArgs attribute, however this attribute is not supported by B4J-Bridge.

    This is a heavy library. jExcel is lighter but it only supports the older format.
     
    Stefano Bordini likes this.
  11. Stefano Bordini

    Stefano Bordini Member Licensed User

    Tnx
     
  12. hibrid0

    hibrid0 Active Member Licensed User

    Hi, I want a method to make more bigger the row something like SetColumnWidth but for row.

    How can I do it?
    I want to put an imagen on the exact field.
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    You are looking for PoiSheet.SetColumnWidth
     
  14. StarinschiAndrei

    StarinschiAndrei Active Member Licensed User

    Hi,
    can anybody tell me if JPOI is compatible with office 2016 ?
     
  15. Erel

    Erel Administrator Staff Member Licensed User

    Yes, it is supported.
     
  16. StarinschiAndrei

    StarinschiAndrei Active Member Licensed User

    my released app crash when i try to handle excel file. The computer where my app runs has office 2016. How can i create a crash log?
     
  17. Erel

    Erel Administrator Staff Member Licensed User

    Run your app from the command line with java -jar <yourjar>
     
  18. StarinschiAndrei

    StarinschiAndrei Active Member Licensed User

    thank you ... it was my fault
     
  19. Tayfur

    Tayfur Well-Known Member Licensed User

    Hello;

    is library can support write/change row values?
    is library can support delete sheet?
     
  20. Erel

    Erel Administrator Staff Member Licensed User

    Yes.

    Yes (with a simple JavaObject call).
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice