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

MailMerge removing content in document

I have a question about performing Mail merge with business objects, as described in help.syncfusion.com.

I made a word template to report Employees Orders's, as your template here http://asp.syncfusion.com/demos/reporting/DocIO/Mail%20Merge/NestedMailMerge/CS/NestedMailMerge.aspx

For some orders, all informations are not given. In this case, I don't want to display the label if there is no data (ie, remove the line "Shipped Date" if there is no shipped date for this order).

Some employees don't have orders. In this case, I want to report employee's informations without displaying an empty block "Order" 
(ie                    Order No Number
                        Order Date : empty
                        Shipped Date : empty
                        Required Date : empty).

I think I have to use MergeField event. But I don't know how to proceed.

Thank for your help and information.


1 Reply

VR Vijay Ramachandran Syncfusion Team June 26, 2017 06:25 AM UTC

Hi lalleman,

Thank you for contacting Syncfusion support.

Yes, you can remove the merge field label text (text before/After the merge field) when the field value is empty using Merge field event. We have prepared sample to remove the label text by removing the owner paragraph of merge field when the field value is empty. You can download the sample from here and let us know if it helps.

Note: We have used Execute() method in this sample and this event is common to ExecuteGroup(), ExecuteNestedGroup() methods.

Let us know if you have any concern.

Vijay R

Live Chat Icon For mobile
Up arrow icon