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

Merge an inner table

Thread ID:





59810 Apr 23,2007 03:34 PM UTC Sep 3,2014 12:02 PM UTC ASP.NET Web Forms (Classic) 7
Tags: DocIO
Asked On April 23, 2007 03:34 PM UTC


I need to merge an inner merge fields table inside another merge fields table, here is an example of my word document :




Thanks in advance

Sarath Kumar G [Syncfusion]
Replied On April 24, 2007 03:56 AM UTC

Hi Mehdi,

Thank you for your interest in Syncfusion products.

It is possible to perform MailMerge inside another Mail Merge declaration. The sample attached makes use of two databases and the Merge fields of one table are merged inside
another Merge fields of another table. Here is the sample for your reference,


Hope so my understanding is correct. If not please explain me the issue in details, so that it will more helpful to investigate further.

Please let me know if you face any issues.


Replied On April 24, 2007 02:48 PM UTC

Hi Sarath,

Thnks for the quick answer but I think you misunderstood me.

In your case the teacher and the student are independent. In fact I need to show all the teachers for one student

Here is my database :

<---- Table Student : ---->

StudentNo StudentName StudentAge
100 Allan 21
101 Bravo 22
102 Charles 21

<---- Table Teachers: ---->
TeacherID TacherName
1 Christy
2 Maria
3 Kerry

<---- Table StudentTeachers: ---->
StudentNo TeacherID
100 1
100 2
100 3

My exported word file should look like this :

Student Name : Allan

Teacher Name : Christy
Teacher Name : Maria
Teacher Name : Kerry

Student Reg. No : 100
Student Age : 21

Thanks once again for the support.

Sarath Kumar G [Syncfusion]
Replied On April 25, 2007 11:17 PM UTC

Hi Mehdi,

Thanks a lot for detailed explanation and Sorry for the confusion caused.

I have created a Sample which meats your requirements partially. I used two tables "Student" and "Teacher" to perform MailMerge as per the requirements. Since the table "StudentTeacher" is a link of the other two tables normalization is maintained. Hope so this helps you. Please let me know if you face any issues.

Here is the generated sample document for your reference.


Here is the sample program for your reference.


Please let me know if you face any issues.


Replied On April 26, 2007 08:32 AM UTC

Hi Sarath,

Thanks for the answer. As you said you resolved my issue partially. Your solution show all teachers for each Student or the teachers are not the same for each student.

StudentNo TeacherID
100 1
100 2
100 3
200 1
300 1
300 2

Sorry for the confusion and thanks again for the support.


Bhuvaneswari P [Syncfusion]
Replied On May 2, 2007 09:37 AM UTC

Hi Mehdi,

Thanks for your update.

I have modified the sample as you expect.

Code Snippet:
//Getting Data from the database
conn1 = new OleDbConnection(connString1);
OleDbCommand cmd1 = new OleDbCommand("SELECT StudentName,TeacherName1,TeacherName2,TeacherName3,StudentTable.StudentID,StudentAge FROM StudentTable, Teachertable1 WHERE StudentTable.StudentID=Teachertable1.StudentID", conn1);

//Excute Query
IDataReader dataReader1 = cmd1.ExecuteReader();
//Excute MailMerge

Herewith I have attached the sample for your reference:

Herewith I have attached the generated document for your reference:

Please take a look into this and let me know if you have any other Queries.

Thank you for your interest in Syncfusion products.

Best Regards,

Replied On May 4, 2007 10:38 AM UTC

Thanks Bhuvaneswari,

It works like I wanted.

Good Work.

bhuvana wp [Syncfusion]
Replied On May 4, 2007 01:07 PM UTC

Hi Mehdi,

Thank you for your interest in Essential DocIO. Glad to know that it helps you. Please let me know if you have any queries.

Best Regards,


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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