× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I decided to undertake the updating of Scott Klement’s fantastic HSSF POI Excel-generating system to the most recent release of Apache’s POI 4.0.0 which is current as of 9/2018. I have 95% of it running just fine. Most of our POI 3.6 spreadsheets (with minimal code changes) will run just fine on POI 4.0.0 and JAVA 8.

The final piece of the migration is the image-processing section. I have most of the necessary JAVA methods defined and working. I am becoming “delayed” more than I prefer to be on one particular change that occurred in POI 3.14.

The “SSClientAnchor_setAnchorType()” method requires a different parameter that is of type “ClientAnchor.Anchortype”. It is an enumerated type in the ClientAnchor interface.

As I dd in similar situations with other enums, I used POI’s _valueOf method calls to pass the enum constant. Those all worked well. This one for some reason does not.

As it is writing in the POI documentation… the ClientAnchor.Anchortype is defined in org.apache.poi.ss.usermodel.ClientAnchor.AnchorType


Here’s how I have this set up in the HSSF_H source. Similar to all the other enum-based classes I had to set up.

D ANCHORTYPE_CLASS...
D C 'org.apache.poi.ss.usermodel-
D .ClientAnchor.AnchorType’

D SSAnchorType S O CLASS(*JAVA: ANCHORTYPE_CLASS)


D SSAnchorType_valueOf...
D PR like(SSAnchorType) static
D EXTPROC(*JAVA
D : ANCHORTYPE_CLASS
D : 'valueOf')
D aType_enum like(jstring) const


D SSClientAnchor_setAnchorType...
D PR ExtProc(*JAVA
D : CLIENTANCHOR_CLASS
D : 'setAnchorType')
D type like(SSAnchorType)


D SS_ANCHOR_MOVESIZE...
D C 'MOVE_AND_RESIZE'
D SS_ANCHOR_SIZE...
D C 'DONT_MOVE_DO_RESIZE'
D SS_ANCHOR_MOVE...
D C 'MOVE_DONT_RESIZE'
D SS_ANCHOR_FIXED...
D C 'DONT_MOVE_AND_RESIZE’

———————————

This is a section of my RPG code that sets up and initiates the call:

D at s like(SSAnchorType)
at = SSAnchorType_valueOf(new_string(SS_ANCHOR_MOVESIZE));
SSClientAnchor_setAnchorType(imgAnchor: at);

—————————————————


The result is the program bombs saying the class could not be found. I’ve gotten this same error on other classes and have always resolved them. This particular one is different as it appears to be a class within a class. Here is the error message in case it helps.

received Java exception "java.lang.NoClassDefFoundError:
org.apache.poi.ss.usermodel.ClientAnchor.AnchorType" when calling method
"valueOf" with signature
"(Ljava.lang.String;)Lorg.apache.poi.ss.usermodel.ClientAnchor.AnchorType;"
in class "org.apache.poi.ss.usermodel.ClientAnchor.AnchorType". Recovery .

———————————————

Any idea would be greatly appreciated. It’s pretty cool running (finally) on the most recent version of POI. Quite a few issues we’ve had with POI3.6 and functionality issues with Excel and XSSF have been resolved now.

Thanks in advance!

Eddie

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.