The aspose formula cannot be calculated for a long time, and the lower version 20.1 is very fast

The static Excel file calls the formula calculation method and gets stuck in a dead loop, unable to calculate the result for a long time. Currently, there is still an issue with the latest version 24.1, while the lower version 20.1 can work normally
image.png (37.3 KB)

this is my excel:
EPPR_72801.zip (2.5 MB)

this is my code

Workbook workbook =  new Workbook("D:\\Smartbi_WorkSpace\\Personal_WorkSpace\\aspose\\data\\EPPR_72801\\EPPR_72801.xlsx");
	    System.out.println("===start===:" + new Date());
		workbook.calculateFormula(false);
	    System.out.println("===finish===:" + new Date());
		workbook.save("D:\\Smartbi_WorkSpace\\Personal_WorkSpace\\aspose\\data\\EPPR_72801\\output", SaveFormat.HTML);

Could you please take a look at the reason? If there are any avoidance plans, they can be provided first. There are similar phenomena in a large number of reports

@xhaixia
By testing with the latest version v24.1, we can reproduce the issue. The program hangs when saving the file to HTML. Please refer to the attachment. result.png (19.0 KB)

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSJAVA-45840

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

I have looked at the pictures on your end and found that there is a difference between my program and yours. My program is stuck in the calculateFormula process, specifically in the AL46 cell formula calculation, but yours is stuck in the save process

I found that when calculating formulas, set option. setCalcStackSize (0); The program can execute normally, but it is uncertain what other impacts this will have

@xhaixia,

Yes, on our end, it is stuck on Workbook.save() method for a while (I found it takes 1 minute or more time to complete the save to HTML process) and not on Workbook.calculateFormula() method. Probably you are using an older version of the API, so kindly try using latest version (Aspose.Cells v24.1).

I used the latest jar package corresponding to 24.1 for verification
image.png (75.0 KB)

@xhaixia
Thanks for your feedback and details. We will investigate your issue further. Hopefully we can figure it out soon. Once we have an update on it, we will let you know.

@xhaixia

For calculating formula, specifying the stack size as 0(in fact 1 is same) will make it impossible to calculate formula which depends on another one and you may get unexpected result or even exception. We will enhance our api and the api reference for it soon.

By our test, we found the formula can be calculated without performance issue. We think available memory should be the most possible reason for the performance. So would you please check whether the specified memory limit for you JVM is suitable and enough for your application? Stack size is also another possible reason, so please set it to a proper(smaller one than the default value of 200) value, such as 30, to check whether you can solve the performance issue for formula calculation.

For the performance of saving html, we will investigate it soon.

There have been attempts to modify the stack size, with a minimum limit of 108, but there are still issues
image.png (36.3 KB)

@xhaixia

For the screenshot, you are also using some other options such as monitor. Would you please provide us the runnable project so we can perform the test same with you? And how about calculating the workbook directly without any options?

By the way, from the screenshot we found you just remove the code of specifying stack size, then how the message “The stack size speci… at least 108k” be produced? And is the “108k” representing the code of setCalcStackSize (108)?

JDK8+20.12 can reproduce this issue

Is there a way to avoid this issue in JDK8+20.12 version
After verification on my end, the issue should have been fixed on version 21.2 and the same issue on version 21.1. Can you provide a replacement class based on version 20.12 to avoid this issue

@xhaixia
Sorry, if you keep using an older version (Aspose.Cells for Java v20.12), it won’t help you much. We couldn’t use the old version to evaluate the issue, nor could the old version include fixes or enhancements. All enhancements and fixes are based only on the latest API set. We’ve been extending the API over the years, so don’t try to trace the release notes to see where name definition issues were first fixed.

In short, try to upgrade to the latest version and use it. Please let us know if you still find any issues. We will check it shortly.

@xhaixia ,

We are pleased to inform you that your issue has been resolved. The fix will be included in an upcoming release (Aspose.Cells v24.2) that we plan to release next week. You will be notified when the next version is released.
Attached is the result after fix for your reference: output.zip (3.1 MB)

The issues you have found earlier (filed as CELLSJAVA-45840) have been fixed in Aspose.Cells for Java 24.2.