We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Updating IF fields in word with DocIO won't work correctly

Hello,

I have a problem with updating field values for dates. I saw a similar case in thread ID 121128 but it won't work for me, although I think it should.
Here is what I am doing:

Have a word template that needs filling in fields from database on runtime.
Fields are in tables. In case there is no date I set that value in column to 0 and all values go to their places in rows of table.
Then I call:
document.MailMerge.ExecuteGroup(table)
document.UpdateDocumentFields()

If I try to set field from quick parts -> fields -> IF
like this:
IF «ProjectEndDate» = 0 "ongoing" «ProjectEndDate»
I get «ProjectEndDate» everywhere, so no update. Tried also experimenting with quotes on 0 and projectenddate.

If I try to use ctrl+f9 and write it like this
{ IF «ProjectEndDate» = 0 "ongoing" «ProjectEndDate» \*MERGEFORMAT }
I get the result returned but also the whole expression:
01.2017 - 0 = "0" "ongoing" 0 \* MERGEFORMAT ongoing
or
12.2016 - 8/22/2017 2:00:00 AM = "0" "ongoing" 8/22/2017 2:00:00 AM \* MERGEFORMAT 8/22/2017

Anyone can help about this?


3 Replies

SY Sethumanikkam Yogendran Syncfusion Team April 25, 2017 04:47 AM UTC

Hi Cubrilo,

Thank you for contacting Syncfusion support.

We are unable to reproduce the mentioned issue with the given details. Please find the below sample which we have tried at our end to reproduce the issue.
Sample link

Kindly provide us sample or modified sample of above along with input template, and product version of Essential Studio which will helpful to reproduce the issue at our end and to provide you the appropriate solution at the earliest.

Please let us know if you have any other questions.

Regards,
Sethumanikkam.Y



CM Cubrilo Milos April 25, 2017 06:35 AM UTC

Thank you for your sample, yes it works, and it made me realize that the problem is that after filling bookmark sections I format all bookmarks as html and re-append it to
document because I have html on some places, so that is the problem. I'll have to be selective about what is formatted an what is not.

Thank you for your help.


SY Sethumanikkam Yogendran Syncfusion Team April 26, 2017 05:03 AM UTC

Hi Cubrilo,

Thank you for your update.

We are happy to hear that the provided sample resolved your requirement. Please let us know if you need any further assistance on this. We will be happy to assist you as always.

Please let us know if you have any other questions.

Regards,
Sethumanikkam.Y


Loader.
Live Chat Icon For mobile
Up arrow icon