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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Nested MailMerge with Plain Objects

Thread ID:

Created:

Updated:

Platform:

Replies:

109920 Jul 10,2013 09:30 PM UTC Dec 26,2014 10:02 AM UTC ASP.NET Web Forms (Classic) 5
loading
Tags: DocIO
Marco
Asked On July 10, 2013 09:30 PM UTC

Hi, I've the following two classes:

public class T1
{
    public int SupplierID { get; set; }    
    public T2 T2 { get; set; }
    public T1() 
    {
        T2 = new T2();
        T2.IO = "XXX";
    }
}

public class T2 
{
    public string IO { get; set; }
}

Inside my report, I want to display a List of T1 instances. So I did it in this way:
List<T1> list = new List<T1>();
foreach(...){T1 t1 = new T1(); list.Add(t1);}
document.MailMerge.ExecuteGroup(new MailMergeDataTable("Suppliers", list));

The MailMerge operation works perfectly and the property SupplierID of T1 is correctly filled. 
What i can't do instead, is to show the property IO of T2 instace. 
More precisely, T1 -> T2 -> IO (T1.T2.IO). I see few examples of nested MailMergeField, but I can't do anything with objects, it works only with SQL query. 
Does exists a method to print public Properties of referenced objects likes my example?

Thank's 
 Marco

Siva Subramanian [Syncfusion]
Replied On July 12, 2013 12:44 PM UTC

Hi Marco,

 

Thank you for your interest in Syncfusion products.

 

We have prepared a sample to meet your requirement to use plain objects for performing nested mail merge using DocIO. Please find the same from below link:

 

Sample link:

http://www.syncfusion.com/downloads/Support/DirectTrac/General/GenerateWord_Web-225466537.zip

 

In the above sample, we have modified the code to perform nested mail merge successfully by feeding T1 and T2 instance collection as a separate mail merge data table (as MailMergeDataSet) along with command array to specify the relation.

 

Note:

For successful mail merge, the property name of the object must be equal to the name of the field in the word document.

 

For more information on nested mail merge, refer below UG links:

http://help.syncfusion.com/ug/asp.net/docio/documents/nestedmailmerge.htm

 

Kindly try the sample and let us know if this helps you.

 

Regards,

Sivasubramanian


Marco
Replied On July 12, 2013 01:50 PM UTC

Thank's for the reply. Unfortunately the solution it isn't exactly what i was looking for.... i try to explain better my problem:
I'm using Microsoft EntiyFramework with its lazy loading functionality. For example I can have a main class "Suppliers" and inside a Reference (or a List) to another object of type "Products".
In this case, the join query is automatically executed by the framework and at runtime I have, for example, an instance of the object "Suppliers" which has a List of "Products". This is a classic master detail relationship, managed only with objects. What I want is only a mechanism to print the master object (this is what i already did) and all the child objects contained in the respective List (this step is what i can't do).

Siva Subramanian [Syncfusion]
Replied On July 16, 2013 06:14 AM UTC

Hi Marco,

 

Thank you for your update.

 

Currently DocIO does not have support to perform mail merge for child objects used as a reference in the master object. As we stated before, we can feed the Child objects collection as a separate mail merge data table along with commands for successful mail merge. Kindly refer the sample provided in our previous response.

 

Please let us know if you have any other questions.

 

Regards,

Sivasubramanian


Jernej Jerin
Replied On October 3, 2014 11:36 AM UTC

Hi Marco,

 

Thank you for your update.

 

Currently DocIO does not have support to perform mail merge for child objects used as a reference in the master object. As we stated before, we can feed the Child objects collection as a separate mail merge data table along with commands for successful mail merge. Kindly refer the sample provided in our previous response.

 

Please let us know if you have any other questions.

 

Regards,

Sivasubramanian


Is this feature now supported?

Ayswarya Krishna Kumar [Syncfusion]
Replied On December 26, 2014 10:02 AM UTC

Hi Jernej,

We appreciate your patience.

We have implemented the support to perform mail merge for child objects used as a reference in the master object and this support has been included in our 2014 Volume 4 release.
Essential Studio Vol 4, 2014 is available for download under the following link.

http://www.syncfusion.com/forums/117834/essential-studio-2014-volume-4-final-release-v12-4-0-24-available-for-download

Please refer the below UG link for more details on Nested Mail Merge.
http://help.syncfusion.com/ug/windows%20forms/#!documents/nestedmailmerge.htm

Please refer the below online sample to illustrate the same.
http://asp.syncfusion.com/demos/reporting/DocIO/Mail%20Merge/NestedMailMerge/CS/NestedMailMerge.aspx

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Please let us know if you have any other questions.

Regards,
Ayswarya


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

;