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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using If-Then-Else statement in a document template

Thread ID:





93880 Apr 9,2010 09:37 AM UTC Apr 14,2010 12:09 PM UTC ASP.NET Web Forms (Classic) 3
Tags: DocIO
eric menglier
Asked On April 9, 2010 09:37 AM UTC


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 :



Poornima R [Syncfusion]
Replied On 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.


Please let us know if you have any queries.


eric menglier
Replied On April 14, 2010 08:21 AM UTC

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.


Poornima R [Syncfusion]
Replied On 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.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon