I sent you an email with the files, meanwhile can you send me the link to download the cells version you are talking about?
Hi Luciano Oliveira,
With Aspose 8.3.2.1 I still have the same problem xlsx is corrupted.
Hi,
loliveira8:I am sending you in attachment the java source code and the xlsx that was produced by that code in windows using the newest version of aspose cells. In the as400 if I try to mimic the same code as the one in java I get the corruption error
I have received your generated Excel file on Windows which is fine as you mentioned and sample JAVA code segment. Could you provide the complete error trace (when you try to use the similar code of AS400), so we could evaluate it on our end soon.Thank l you.
There is no error trace because the program in AS400 doesn’t actually fail. It runs but creates a file corrupted like the one I sent you before and to which you said looked like a plain text file.
Hi,
Would you please try the method Workbook.save(nameOfFile) without involving the second parameter to see whether you can get the correct result or not? We think this method should work for your situation. The constant value 6 is one type of save format which is defined in the interface SaveFormat, please pay attention to the value if you have to use the inner int value of those constants defined in Java interface because they may be changed in different versions of the product. To make sure you are using the correct value, please use Java program to first print out the correct value corresponding to specific version of Aspose.Cells that you are using, e.g., code like:
e.g.
Sample code:
System.out.println(SaveFormat.XLSX); // or any other Save Format defined in this interface
Also you can print out the version info of Aspose.Cells component to make sure you are using the correct one:
e.g.
Sample code:
CellsHelper.getVersion()
Thank you.
I sent you an email explaining that using save only with nameOfFile produced another XLSX with corrupted data.
Hi,
Hello again,
Utils.java
I sent this to the AS400 and after I runned it doing in qshell:
java com.TestAsposeCells.Main
This created the file in the folder described without any problem //home//ulo012//chart.xls
And I have this error…
So now I don’t know what else I can do… because I am either not using the constructor for the OoxmlSaveOptions correctly or something odd is on the classes with the version I am using. Can you please help me out with this?
Hi,
Thanks for using Aspose.Cells.
Do you mean that on the same machine and environment your program can work fine if only use the Workbook for saving xls file but gave error when in the code you use class OoxmlSaveOptions? Commonly signer issue of the classes is caused by that there are some other classes using the package com.aspose.cells out of the Aspose.Cells.jar. Please check your classpath used when running your program. Maybe there are some other jar/class files are included in your default class path and in those files there are another copy of aspose.cells related classes.
You can try to put only three files(with their directory structure for your two classes): com/TestAsposeCells/Utils.class, com/TestAsposeCells/ Main.class and aspose-cells-8.3.2.1.jar into one empty directory and then in this directory execute your program again by command:
java -cp .:aspose-cells-8.3.2.1.jar com.TestAsposeCells.Main
to see whether you can get the expected result. If not, please check your JDK and JRE’s lib directory and make sure there is no jar or classes of aspose.cells in it(if your AS400 has installed multiple versions of JDK/JRE, please check all of them or confirm you have checked at least the one you used to run your program).
Hello again,
loliveira8:....Now I have other problems but that is regarding methods that were on Workbook before and now they don't exist. For example setCalculationMode and setCalculateBeforeSave are not in the version aspose-cells-8.3.2.1.jar. Is there any place where I can check what is the equivalent of this method now?Please try using WorkbookSettings.setCalcMode() and WorkbookSettings.setReCalculateBeforeSave() methods in the newer versions of the product for your needs. Please see the sample line of code for your reference:e.gSample code:..........workbook.getSettings().setReCalculateBeforeSave(true);Thank you.
Hello again,
Hi,
Thanks for your posting and using Aspose.Cells.
Please see the section General API Set from the following document. It should help you in migrating your code from the older to newer version.
( How to Migrate to Aspose.Cells 7.0.0 or Higher|Documentation )
Thank you for the document it really is helping a lot.
Hi,
Thanks for your posting and using Aspose.Cells.
Please provide us portions of your old sample code using these classes so that we could look into it and find the alternative replacement code compatible with new version.
Thanks for your cooperation.
Hello,
Having another look at this issue after Some time, I still believe the method is missing in the Java version of aspose.cells.
Is this “overload” of the “save”-method available as public method ?
“Workbook.save” (javastring;OoxmlSaveOptions) is not available as usable method !!
Can this be checked please ?
Thanks
Hi,
Thanks for your posting and using Aspose.Cells.
OoxmlSaveOptions is a derived class of SaveOptions, so you should use the following method instead.
void save(java.lang.String fileName, SaveOptions saveOptions)
Please see the following sample code which works fine for your reference.
Java
OoxmlSaveOptions opts = new OoxmlSaveOptions(SaveFormat.XLSX);
workbook.save(“output.xlsx”, opts);