Hi,
Using Aspose Cells for Java, version 19.9.
Using LoadOptions.setParsingFormulaOnOpen
seems to have an undesirable side-effect, resulting in inconsistent formula representations.
Sample code:
LoadOptions loadOptions = new LoadOptions();
loadOptions.setParsingFormulaOnOpen(false);
Workbook workbook = new Workbook("input.xlsx", loadOptions);
WorksheetCollection worksheets = workbook.getWorksheets();
Worksheet worksheet = worksheets.get(0);
Cells cells = worksheet.getCells();
System.out.println("cells.get(0, 1).getFormula(): " + cells.get(0, 1).getFormula());
System.out.println("cells.get(1, 1).getFormula(): " + cells.get(1, 1).getFormula());
If ParsingFormulaOnOpen
is set to true
, the output will be:
cells.get(0, 1).getFormula(): =OR(A1:A5="a")
cells.get(1, 1).getFormula(): =SUM(A1:A5)
If ParsingFormulaOnOpen
is set to false
, the output will be:
cells.get(0, 1).getFormula(): =OR(A1:A5="a")
cells.get(1, 1).getFormula(): SUM(A1:A5)
Note that the leading =
character for the formula in A2
is missing if ParsingFormulaOnOpen
is set to false
.
This is trivial to work around, but seems needlessly inconsistent.
The issue also affects other Aspose Cells features, for instance the export to HTML.
Kind regards,
Taras
input.zip (5.6 KB)
@TarasTielkes,
We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.
This issue has been logged as
CELLSJAVA-43046 – LoadOptions.setParsingFormulaOnOpen(false) causes undesired results while calling getFormula()
@TarasTielkes,
This is to inform you that we have fixed your issue “CELLSJAVA-43046” now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.
@Amjad_Sahi,
Oh, that’s nice 
The work-around was a trivial one-liner, but it’s always nice to remove those.
Kind regards,
Taras
@TarasTielkes,
Right. We will inform you once release will be ready.
@TarasTielkes,
Please try our latest version/fix: Aspose.Cells for Java v19.11.2:
aspose-cells-19.11.2.zip (6.6 MB)
Your issue should be fixed in it.
Let us know your feedback.
Hi @Amjad_Sahi,
I’ve tried the 19.11.2 version that you provided, but the observed behavior is unchanged.
Kind regards,
Taras
@TarasTielkes,
You are right, the issue is still there. It still omits “=” from B2 formula in the template file. I have reopened the issue and we will evaluate it and figure it out soon.
We are sorry for any inconvenience caused!
@TarasTielkes,
Please try our latest version/fix: Aspose.Cells for Java v19.11.3 (attached)
Your issue “CELLSJAVA-43046” should be fixed in it.
Let us know your feedback.
Aspose_Cells_Java_v19.11.3.zip (6.6 MB)
Hi @Amjad_Sahi,
Version 19.11.3 does indeed fix the reported problem.
Thank you.
Kind regards,
Taras
@TarasTielkes,
Good to know that your issue is sorted out by the new fix/version. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.
The issues you have found earlier (filed as CELLSJAVA-43046) have been fixed in Aspose.Cells for Java v19.12. This message was posted using Bugs notification tool by ahsaniqbalsidiqui