Error in AS400 while trying to create an XLSX

I have an RPG program in an AS400 that is currently using Aspose cells, and it is able to create xls files. However whenever I try to create xlsx files I always get the same error;


Message . . . . : Java exception received when calling Java method.
Cause . . . . . : RPG procedure R56A00321 in program WMFGDEV/R56A00321
received Java exception “java.lang.NoSuchMethodError: save” when calling
method “save” with signature “” in class “com.aspose.cells.Workbook”.
Recovery . . . : Contact the person responsible for program maintenance to
determine the cause of the problem.
Technical description . . . . . . . . : If the exception indicates that the
Java class was not found, ensure the class for the method is in the class
path. If the exception indicates that the Java method was not found, check
the method name and signature. If the signature is not correct, change the
RPG prototype for the method, or change the Java method, so that the return
type and parameter types match. You can determine the signatures for all the
methods in class XYZ using command QSH CMD(‘javap -s XYZ’).

Like it is said in the last like I checked what methods the com.aspose.cells.Workbook has, and if it exists the one I am trying to use. All the save methods found are bellow:
public void save(java.io.OutputStream) throws java.io.IOException;
Signature: (Ljava/io/OutputStream;)V
public void save(java.io.OutputStream, int) throws java.io.IOException;
Signature: (Ljava/io/OutputStream;I)V
public void save(java.lang.String) throws java.io.IOException;
Signature: (Ljava/lang/String;)V
public void save(java.lang.String, int) throws java.io.IOException;
Signature: (Ljava/lang/String;I)V
public void save(java.lang.String, char, java.lang.String) throws java.io.IOException;
Signature: (Ljava/lang/String;CLjava/lang/String;)V
public void save(java.io.OutputStream, char, java.lang.String) throws java.io.IOException;
Signature: (Ljava/io/OutputStream;CLjava/lang/String;)V
The problem is that I am trying to use the following code to generate the xls and the xlsx:
*Call a Java program from RPG
H DFTACTGRP(*NO) ACTGRP(*CALLER)

*Declare a variable filePath - Java class type String
D filePath S O CLASS(*JAVA:‘java.lang.String’)
*Declare a variable wrkbook - Java class type Workbook
D wrkbook S O CLASS(*JAVA:
D ‘com.aspose.cells.Workbook’)
*Declare a variable xmlSavOpt - Java class type OoxmlSaveOptions
D xmlSavOpt S O CLASS(*JAVA:
D ‘com.aspose.cells.OoxmlSaveOptions’)

//Prototype for creating a String object
D makestring PR O EXTPROC(*JAVA:
D ‘java.lang.String’:
D *CONSTRUCTOR)
D CLASS(*JAVA:‘java.lang.String’)
D parm 65535A CONST VARYING

//Prototype for creating a Workbook object
D createWB pr O EXTPROC(*JAVA:
D ‘com.aspose.cells.Workbook’:
D *CONSTRUCTOR)
D CLASS(*JAVA:
D ‘com.aspose.cells.Workbook’)

//Prototype for creating the OoxmlSaveOptions
D OoXmlSavOpt pr O EXTPROC(*JAVA:
D ‘com.aspose.cells.OoxmlSaveOptions’:
D *CONSTRUCTOR)
D CLASS(JAVA:
D ‘com.aspose.cells.OoxmlSaveOptions’)

public void save(OutputStream p1)
DSaveAsXLS pr EXTPROC(*JAVA:
D ‘com.aspose.cells.Workbook’:
D ‘save’)
Dp1 O CLASS(JAVA:
D ‘java.lang.String’)
public void save(OutputStream x1, oxmlSaveOptions x2)
DSaveAsXLSX pr EXTPROC(*JAVA:
D ‘com.aspose.cells.Workbook’:
D ‘save’)
Dx1 O CLASS(*JAVA:
D ‘java.lang.String’)
Dx2 O CLASS(*JAVA:
D ‘com.aspose.cells.OoxmlSaveOptions’)



/free
//Call the Workbook constructor
wrkbook = createWB();

//First we do the XLS
filePath = makestring(’//home//ulo012//chart.xls’);
SaveAsXLS(wrkbook:filePath);

//Then the XLSX
filePath = makestring(’//home//ulo012//chart.xlsx’);
xmlSavOpt = OoXmlSavOpt();
SaveAsXLSX(wrkbook:filePath:xmlSavOpt);

*inlr = *on;
return;
/end-free

This program generates the xls without any problems but in the line in red it crashes with the message I put in the beggining of this post. I imagine that the reason for this is that in my aspose cells version I am missing the method where I can use the OoxmlSaveOptions as a parameter.
The aspose cells version I am supposed to be using is this one: aspose-cells-8.3.2.1.jar although at this point I don’t know if I am because I am assuming that this version should include the method that I may be missing? Right?
Or is it another problem?

If you need I can send you all the code and information I have.
Thank you in advance.

Hi Luciano,


Please follow your other thread on the same subject.