Free Support Forum - aspose.com

OoxmlSaveOptions problem

Hello,

I'm trying to save an Excel file as xlsx, but am receiving an error.

"java.lang.UnsupportedClassVersionError: com/aspose/cells/OoxmlSaveOptions"

Am I using an incorrect version of aspose.cells ?

Thanks a lot !

[quote user=“HGOAS4”]

Hello,

I’m trying to save an Excel file as xlsx, but am receiving an error.

"java.lang.UnsupportedClassVersionError: com/aspose/cells/OoxmlSaveOptions"

Am I using an incorrect version of aspose.cells ?

Thanks a lot !

[/quote]

Was due to an incorrect version of aspose.cells !!

Sorry

Hi,


Good to know that your issue is sorted out. We recommend you use our latest version of the product Aspose.Cells for Java v7.7.2 if possible where we made some further enhancements and included more fixes in it. Feel free to contact us any time if you need further help or have some other queries or issue, we will be happy to assist you soon.

Thank you.



For the moment I'm using some constants to specify the xls-format

1 --> Excel97

2---> Excel2000

...

Which value should I use for xlsx ? 7 ?

Can I use Workbook.save("Filename.xlsx", OoxmlSaveOptions) ? (signature ?)

[quote user=“HGOAS4”]

For the moment I’m using some constants to specify the xls-format

1 --> Excel97

2—> Excel2000

Which value should I use for xlsx ? 7 ?

Can I use Workbook.save(“Filename.xlsx”, OoxmlSaveOptions) ? (signature ?)

[/quote]

Workbook.save with this signature does not work

–> Save(java.lang.String, com.aspose.cells.OoxmlSaveOptions) … !?

Hi,


Could you provide the code snippet here, we will check it soon.

Thank you.

Hello,

I calling the java-methods from within RPGLE (iSeries).

Workbook$saveAsXlsx...
pr extproc(*java
:'com.aspose.cells.Workbook'
:'save')
p1 o class(*java:'java.lang.string')
p2 o class(*java:'com.aspose.cells.OoxmlSaveOptions')

This is the signature I use to save as xlsx.

Maybe I should use

Workbook$saveAsXlsx...
pr extproc(*java :'com.aspose.cells.Workbook' :'save')
p1 o class(*java:'java.lang.string')
p2 o class(*java:'com.aspose.cells.SaveOptions')

Still signature problems

Why is the signature not correct ?

When I check the available overloads in the class, I see this signature ...

In my opinion I should be able to use signature ('java.lang.String', 'com.aspose.cells.OoxmlSaveOptions');

But this one is not available in the jar.

Are you working on this issue ?

Thanks a lot !

setFormat is missing in the SaveOptions class ....

Hi,


Well, I am afraid, as you are calling the JAVA APIs within RPGLE (iSeries), we are not sure about it. We have also no such kind of environment to test your issue, also we have no knowledge about it. I think since you could not find setFormat for SaveOptions, so instead you may try to use the following if it sorts out your issue:
e.g
Sample code:
[JAVA]
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions(SaveFormat.XLSX);
you have to convert this code or call this API in your RPGLE (iseries) accordingly.

Thank you.

Hi,


The (converted) code you provided works on iSeries (RPGLE).
But the save fails !!
–> save(string, saveoptions) does not work

can you try if this works from within a java program ?

Thanks !

Hi,


Well, it works fine in simple JAVA program here. You may try it in simple JAVA program and let us know the result here.


If you still find the issue, kindly provide us JAVA sample code (runnable) to reproduce the issue on our end, we will check it soon. For your information, we are using Aspose.Cells for Java v7.7.2 with JDK1.7 on Windows 7/8.

Thank you.




This is the message we receive :


It seems to me that the overload for the “save” method is missing in the jar !?

Can you provide your sample code ?

(1-Creation an OoxmlSaveOptions object , 2-saving as xlsx)

Thanks a lot.

What’s the correct enumeration for saveformat.xlsx ? I have to pass this as a constant. I now use value “6”.

Hi,


This should be simple:
e.g
Sample code:

String stringFilePath = “out1.xlsx”;
//…
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
workbook.save(stringFilePath, saveOptions);

Thank you.

Hello I think I might have a similar problem


I am having some problems with some corrupted files when generating XLSX.
Here is the situation:

I have a program in an AS400 that can generate the XLS without any problems. I am trying to convert the programs so that it could also generate them in XLSX but everytime I generate one the file comes up with a corrupted message.

I am using aspose-cells-7.7.2.jar
I builted a simple java program just to see if the problem was with aspose and I tried to create a xlsx like this:

String stringFilePath = “C://Users//ulo012//Documents//Chart.xlsx”;
workbook.save(stringFilePath, 6);
I am unsing the 6 because I saw that FileFormatType.XLSX is an int with 6 as a value.
And in this situation there is an XLSX created without any corruption.

The problem is, when I try to do exactly the same process in AS400 the generated file comes up as corrupted. I know that the version of aspose in the AS400 is the same that I have in my local machine and that I did the test in java.
However I am not sure if the java version itself that is installed in AS400 is compatible with aspose or with these types of functions.

I would like to know if you could help me with this because I have already tried all the other solutions that were posted online.

Thank you in advance.
Luciano

Hi Luciano Oliveira,


Well, Aspose.Cells for Java does support OpenJDK and Sun JDK. Please check JDK version(s) and make sure you have similar JDK version installed on your AS400 as per your working terminal (in a simple JAVA program).

Moreover, we recommend you to kindly try our latest version/fix: Aspose.Cells for Java v8.3.2.1 if it makes any difference.
(Note: you need to have JDK1.6 or above to work with this version/fix).

Thank you.


Hello,


I am not sure if either I didn’t understand your response or if I wasn’t able to explain the problem correctly.

This is the problem, I am unable to create an XLSX file in an AS400 machine, everytime I try to do it the file comes up as corrupted.

In order to try and find the reason of this problem I created a Java program in my Windows machine using the same .jar that is on the AS400 machine. As I told you in my previous post, in the windows machine there wasn’t any problem.
The problem only occurs when we try to do it in the AS400 machine.

This being said, what is the JDK version needed to run aspose-cells-7.7.2.jar? Is it also JDK 1.6 or previous versions also work.

Please I only need help to understand and fix the problem in the AS400 machine.

Thank you.

Hi Luciano Oliveira,


We are not very sure what caused your issue on AS400. It might be due to the different zip implementation of the JDKs on different platforms or may be the streams did not be flushed or closed correctly. We recommend you to just give our latest version/fix v8.3.2.x a try to check whether you can get positive results or not. Moreover, could you give us the generated XLSX files produced on different platforms with the same application, data and version of Aspose.Cells, we will try to check the files and try to find some clue for the issue.

Thank you.