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

Using If-Then-Else statement in a document template

Hi,

I would like to know if it is possible to mailmerge document template that contains formula and rules like IF THEN ELSE statement.

For example,
I have created a .docx document template with the following rule :
{ IF {MERGEFIELD SEX } = "MALE" "Hello Mister" "Hello Miss" }

I have created the document with a csv file that contains the following field names and values :
"SEX";"NAME";"ADRESS"
"MALE";"John";"Paris"

Thanks



template_d8beb69c.zip

3 Replies

PR Poornima R Syncfusion Team April 13, 2010 12:56 PM UTC

Hi eric,

Thank you for your interest in syncfusion products.

Essential DocIO supports updation of If-Then-Else field within the document. Conditional checking is not performed by DocIO.To check the condition and update the field press F9 in the generated document.

Field name and Field values from the csv file can be obtained using XlsIO. We have prepared the sample for your requirement. Could you please find the sample from the below link. Try running the sample and let us know if this helps.

Sample:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=F93880-314068990.zip

Please let us know if you have any queries.

Regards,
Poornima


EM eric menglier April 14, 2010 08:21 AM UTC

Hi,
Thank you for your help.
I tried running the sample and it worked. The problem was that I used a .docx template.

In case of a .doc template, Essential DocIO correctly performs the updation of If-Then-Else field.
Otherwise, if I use a .docx template, the updation of If-Then-Else field does not work.

Regards



PR Poornima R Syncfusion Team April 14, 2010 12:09 PM UTC

Hi Eric,

Thank you for your update.

We were able to reproduce the mentioned issue.We suspect this could be a defect.We have forwarded this issue to our development team for further analysis.

Could you please report this issue through Direct Trac Developer Support System https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported through Direct trac, please ignore this.

Please let us know if you have any queries.

Regards,
Poornima

Loader.
Live Chat Icon For mobile
Up arrow icon