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.

Merge an inner table

Thread ID:

Created:

Updated:

Platform:

Replies:

59810 Apr 23,2007 11:34 AM Sep 3,2014 08:02 AM ASP.NET Web Forms (Classic) 7
loading
Tags: DocIO
Mehdi
Asked On April 23, 2007 11:34 AM

Hi,

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

«TableStart:Student»
«StudentName»

«TableStart:Teachers»
«TeacherName»
«TableEnd:Teachers»

«TableEnd:Student»

Thanks in advance

Sarath Kumar G [Syncfusion]
Replied On April 23, 2007 11:56 PM

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,

http://websamples.syncfusion.com/samples/DocIO.Windows/F_59810/main.htm

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.

Regards,
Sarath

Mehdi
Replied On April 24, 2007 10:48 AM

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 07:17 PM

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.

http://www.syncfusion.com/Support/user/uploads/Sample_c70535d6.zip

Here is the sample program for your reference.

http://websamples.syncfusion.com/samples/DocIO.Windows/F_59810_1/main.htm

Please let me know if you face any issues.

Regards,
Sarath

Mehdi
Replied On April 26, 2007 04:32 AM

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.

Mehdi.

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

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);
conn1.Open();
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
document.MailMerge.Execute(dataReader1);

Herewith I have attached the sample for your reference:
Sample

Herewith I have attached the generated document for your reference:
http://websamples.syncfusion.com/samples/DocIO.Windows/F59810_3//main.htm

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,
Bhuvaneswari.

Mehdi
Replied On May 4, 2007 06:38 AM

Thanks Bhuvaneswari,

It works like I wanted.

Good Work.

bhuvana wp [Syncfusion]
Replied On May 4, 2007 09:07 AM

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,
Bhuvaneswari

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.

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.

;