B4J Question [SOLVED] Error on upgrade to jPOI v5.01

bdunkleysmith

Active Member
Licensed User
Longtime User
After upgrade to jPOI v5.01 on installation of B4J v9.00 BETA I am encountering an error on an existing project.

Despite jPOI now being an internal library, I assumed I still needed to copy the dependencies into the additional libraries folder and have done so.

The relevant code begins:

B4X:
Sub SaveTable
    Dim wb As PoiWorkbook
    wb.InitializeNew(True) 'create new xlsx workbook
    Dim sheet1 As PoiSheet = wb.AddSheet("Users by Company", 0)

and the error thrown is:


Changing

B4X:
wb.InitializeNew(True)

to

B4X:
wb.InitializeNew(False)

changes the error thrown to:


I can continue to use jPOI v1.21 by putting the "old" jPOI.jar and jPOI.xml in the internal library folder as per @Erel's post, but I'd prefer to avoid that given I don't believe I'm using any features impacted by the limited backwards compatibility.

Any suggestions on what I've missed in implementing this update?
 

bdunkleysmith

Active Member
Licensed User
Longtime User
Yes, as I mentioned in the original post, "I assumed I still needed to copy the dependencies into the additional libraries folder and have done so."

My additional libraries folder is set to:



and contains:



I'm not sure if it is relevant, but I noted that while the zip contained the above jars, the dependencies listed in jPOI.xml did not include poi-ooxml-lite-5.0.0.jar, but just:

<version>5.01</version>
<dependsOn>poi-5.0.0</dependsOn>
<dependsOn>poi-ooxml-5.0.0</dependsOn>
<dependsOn>xmlbeans-4.0.0</dependsOn>
<dependsOn>commons-collections4-4.4</dependsOn>
<dependsOn>commons-compress-1.20</dependsOn>
<dependsOn>commons-math3-3.6.1</dependsOn>
<dependsOn>commons-codec-1.15</dependsOn>
<dependsOn>SparseBitSet-1.2</dependsOn>
 
Upvote 0

bdunkleysmith

Active Member
Licensed User
Longtime User
Thanks @Erel. That fixed the first error and I now realise the second error was due to the change in the way colors are passed, referred to in this post.

I had:
B4X:
HeaderStyle.ForegroundColor = fx.Colors.LightGray
which I changed to:
B4X:
HeaderStyle.ForegroundColor = XL.COLOR_GREY_25_PERCENT
but it doesn't shade the row light grey, but black. So I'll investigate that further and start a new thread if I need to.
 
Upvote 0

bdunkleysmith

Active Member
Licensed User
Longtime User
Thanks @Erel again for your great support. I've followed your general suggestion and in the midst of updating the code to use XLUtils.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…