Error Description:
Library:
The error occurs in version 22.7 of Aspose Word for Java. In our current version 13.9.0 we have no problems.
Scenario:
• In our customers report there is a bookmark called “Anwendungsgrenze” which is set to value 1 computed before. Additionally it is formatted with the number format “#.###,0”.
• {Set Anwendungsgrenze {=1 \# #.###,0}}
• Later on the bookmark is referenced within an If-Formula and compared to 1.
• {If {Ref Anwendungsgrenze \*CHARFORMAT \*MERGEFORMAT} = 1 “1“ “0“}
• Expected Result: 1
• Actual Result: 0
Notes:
• All fields and formulas are preconfigured in MS Word and are not generated by our code.
• Updating all fields by F9 helps and is a possible temporary workaround for generating Word Documents, but not for the generation of PDF documents.
• Changing the number format in the set Statement to “#,0” fixes the problem, so we assume that the bug has something to do with the format and the problem is not in the computations before.
Reproduction:
Unfortunately I do not know exactly how to reconstruct the problem because I’m very new to Aspose. I have prepared a simple example which shows the important section of our customers report, so you can generate and debug the document yourself. The input document is “Testdokument.docx” and the output will be saved to “Output_Textdokument.docx”. ComparisonErrorWithFormattedNumber.zip (42.7 KB)
Did I miss something? Do not hesitate to ask me if you need more information.
I would be very glad for a fast solution. Thank you in advance!
Best regards,
Carlo Rissmöller
Eudemonia Solutions AG