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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

The value of an image field is replaced by the value of the parent if it is null during mailmerge

Thread ID:

Created:

Updated:

Platform:

Replies:

127452 Nov 16,2016 01:50 PM UTC Nov 21,2016 09:23 AM UTC ASP.NET Core 3
loading
Tags: DocIO
Delphine Lacour
Asked On November 16, 2016 01:50 PM UTC

Hello

I have a class DataModel with a name, an image and a property Children containing a list of DataModel.
In my template Word, I want to display the image of each child. I am using a mailmerge (ExecuteNestedGroup) to do that.

If the property Image of the child returns a value, the image is well displayed. But, if the child does not have an image and the property Image returns null (if it is a System.Drawing.Image) or "" (if it is a string), the field is filled with the Image of the parent.

I don't want this behaviour. If my child does not have any image, I will just display nothing. What can I do to avoid that ?

I have created a solution to help you understand the problem.

Thanks

Attachment: ChildFieldWithParentValue_8b4e8c18.zip

Vijay Ramachandran [Syncfusion]
Replied On November 17, 2016 03:48 PM UTC

Hi Delphine,

Thank you for contacting Syncfusion support.

As per the behavior of the ExecuteNestedGroup() method, if the inner table field value is null and at the same time outer table have same field name with proper value then DocIO uses the outer table data. If it multiple nested table means this process continou untill the root table reached or untill reach the value for the field.

If your requiremnet is using inner table value only means you could specify particular table name as prefix of the Merge field in your template document as like below:

 
Children:assemblyName 
Image:Children:assemblyImage 
We have also modified the given input template document, please find the modified template document from below link:
http://www.syncfusion.com/downloads/support/forum/127452/ze/ModifiedTemplate1950556623.zip

If we misunderstood any of your requirement then kindly elaborate the actual requirement with detailed description.   Thereby we will analyze further on the mentioned case and will provided you appropriate solution.

Let us know if you have any concern.

Regards,
Vijay R


Delphine Lacour
Replied On November 21, 2016 08:54 AM UTC

Hi Vijay,

Thanks for the help. I used "Image:Children:assemblyImage" and it works perfectly.

Regards

Sethumanikkam Yogendran [Syncfusion]
Replied On November 21, 2016 09:23 AM UTC

Hi Delphine,

Thank you for your update.

Please let us know if you need any further assistance on this. We will be happy to assist you as always.

Thanks,
Sethumanikkam.Y


CONFIRMATION

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.

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

;