If Statement not working


#1

attached is code, template, data and results.

my issue:
I have a conditional statement :
image.png (1.5 KB)
I have data that shows my value to be greater than 0
image.png (891 Bytes)
but the wrong text is being printed on the document
and it’s not consistent.
I have other results where the if statement is generating the correct label SAME .dot template:

image.png (621 Bytes)

I am running with Aspose.words version 18.4.

any ideas? fields.zip (25.6 KB)


#2

@conniem

Please note that Aspose.Words mimics the behavior of MS Word. If you perform the same scenario using MS Word and update the field, you will get the same output.

You are facing this issue due to numeric format in B.net_bal field. We suggest you please remove \# “#,##0.00;(#,##0.00)” from the mail merge field to get the correct output.


#3

attached is the updated .dot file.
I am still getting the same results.
test.zip (10.2 KB)


#4

@conniem

Please check the attached modified input document. You need to remove the numeric format from the mail merge field that is inside IF field.

input.zip (18.6 KB)