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
close icon

Nested Object Mail Merge

I would like an example how to code (C#) and construct a mail merge document based on the following requirements:

  • one object passed to the MailMerge function which has multiple properties that are all Collections/Lists types
  • each item in any list may have nested Collections/Lists
  • all nested Collections/Lists and parent Collections/Lists should be populated into the document

If I pass this object to the ExecuteNestedGroup method as part of a MailMergeDataTable, the first table or group populates correctly from the appropriate Collection but the second table or group throws a NullReferenceException.

The syntax of my current mail merge document appears as:
<<BeginGroup:DataSource>>

<TableStart:Collection1>>

<<property>>

<<TableStart:property2>>
     <<nested_property>>
<<TableEnd:property2>>

<TableEnd:Collection1>>

<TableStart:Collection2>>

<<property3>>

<TableEnd:Collection2>>

<<EndGroup:DataSource>>




3 Replies

MJ Mohanaselvam Jothi Syncfusion Team July 12, 2019 01:13 PM UTC

Hi Steve,

Thank you for contacting Syncfusion support.

We have tried to reproduce the reported problem using the given details, but it works properly at our end. For your reference we have prepared a sample application to perform Mail merge based on your requirement. Please find the sample from the below link:
https://www.syncfusion.com/downloads/support/forum/145878/ze/Mail_Merge_ASP_MVC-1357594053

Note: Please find the input Word document in “Home/Data” folder of above sample location.

We suspect that the reported problem might be due to the contents inside the input Word document which used at your end. So, could you please provide us the following things from your end:
  1. Input Word document.
  2. Code snippets or modified sample of above to reproduce the issue.
  3. Syncfusion product version used at your end.

Based on the above details, we will analyze further at our end and provide you the appropriate solution at the earliest.

Please let us know if you have any other questions.

Regards,
Mohanaselvam J
 



SM Steve Mumma July 18, 2019 05:14 PM UTC

Thanks.
The problem exists in the version I was using (14.3.0.52). 
Updating to the latest build fixed the issue I was having.


PR Poorani Rajendran Syncfusion Team July 19, 2019 08:40 AM UTC

Hi Steve,

Thank you for your update.

We are glad to hear that the issue was fixed at your end.
Please let us know if you need any further assistance. We are happy to assist you as always.

Regards,
Poorani Rajendran


Loader.
Live Chat Icon For mobile
Up arrow icon