Android Question Use Jpoi in B4a . bad class file magic (cafebabe) or version

JOHN NG

Member
Licensed User
Longtime User
I tried JExcel Api , but Jexcel can only output max row of 65000 .
Jpoi can support more than 65000 row ?
Can I use this JPOI in B4a ? I trying to add the library into B4a , but I getting the error below :

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lorg/apache/xmlbeans/xml/stream/Location;
at com.andr


I am using B4a version 6.50 .
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

JOHN NG

Member
Licensed User
Longtime User
Any recommend to solve the problem of Excel library only can output 65000 row of data?
Tried multiple sheet , but same error .
 
Upvote 0

JOHN NG

Member
Licensed User
Longtime User
This is the error i getting : jxl.write.biff.RowsExceededException: The maximum number of rows permitted on a worksheet been exceeded
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Code based on jExcel that creates a workbook with 300,000 rows:
B4X:
Dim ws As WritableWorkbook
ws.Initialize(File.DirApp, "test.xls")

For i = 0 To 300000
   Dim row As Int = i Mod 65000
   If i Mod 65000 = 0 Then
       Dim sheet As WritableSheet = ws.AddSheet("sheet " & i, ws.NumberOfSheets + 1)
   End If
   Dim cell As WritableCell
   cell.InitializeText(1, row, i)
   sheet.AddCell(cell)
Next
ws.Write
ws.Close

Tested in B4J but should work the same in B4A.
 
Upvote 0
Top