how to mailmerge nested group

i want to do mailmerge in silverlight using DocIO that output will look like this,

--Page 1
Name : Parent 1
Age  : xx

Childrens
| No. |   Name   | Age |
| 1.  | Child 1  |  a  |
| 2.  | Child 2  |  b  |

--Page 2

Name : Parent 2
Age  : xx

Childrens
| No. |   Name   | Age |
| 1.  | Child 3  |  c  |
| 2.  | Child 4  |  d  |

Could someone please tell me how do i do this.

3 Replies

RM Ramkumar M Syncfusion Team July 19, 2012 06:50 PM UTC

Hi Aman,

Thank you for your interest in Syncfusion products.

We have prepared a sample to meet your requirement of perform nested mail merge in Silverlight using DocIO. Please do find the sample from the attachment and let us know if this helps you.

Please let us know if you have any questions.

Regards                                                                                  

Ramkumar



NestedMailMerge_fd064e.zip


AM Aman July 23, 2012 10:30 AM UTC

Hi Ramkumar,

Thank u for your sample, it helps me so much.
Actually I have tried to build something like what you have given, and i code it before i post this question.
When i read your code, i found that my code is no different with yours. but its make me confuse why does the result is different.

I attached my apps that i make. and the result is like this

--Page 1
Name : Parent 1
Age  : xx

Childrens
| No. |   Name   | Age |
| 1.  | Child 1  |  a  |
| 2.  | Child 2  |  b  |
| 3.  | Child 3  |  c  |
| 4.  | Child 4  |  d  |

--Page 2

Name : Parent 2
Age  : xx

Childrens
| No. |   Name   | Age |
| 1.  | Child 1  |  a  |
| 2.  | Child 2  |  b  |
| 3.  | Child 3  |  c  |
| 4.  | Child 4  |  d  |

Can you please show me what i've missed.

Thanks.


Syncfusion.MailMerge_c93db4a2.zip


RM Ramkumar M Syncfusion Team July 24, 2012 04:55 AM UTC

Hi Aman,

Thank you for your update.

We have analyzed your sample and found that you have mentioned table name “Parent” instead of “Parents” in the command argument. Hence the result comes with all the data in child table. Also provide proper space between the operands in the argument as like below

Mentioned:

DictionaryEntry cmd2 = new DictionaryEntry("Childs", "ParentId=%Parent.Id%");

 

It should be:

DictionaryEntry cmd2 = new DictionaryEntry("Childs", "ParentId = %Parents.Id%");

 

For your reference we have modified your sample to meet your requirement. Please do find the sample from the below link and let us know if this helps you.

Sample Link:

http://www.syncfusion.com/downloads/Support/DirectTrac/96727/Syncfusion.MailMerge498637745.zip

Please let us know if you have any questions.

 

Regards

Ramkumar


Loader.
Up arrow icon