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

Mail Merge from multiple DataSet

Thread ID:

Created:

Updated:

Platform:

Replies:

105584 Nov 5,2012 10:08 AM UTC Nov 9,2012 12:44 PM UTC ASP.NET Web Forms (Classic) 1
loading
Tags: DocIO
Administrator [Syncfusion]
Asked On November 5, 2012 10:08 AM UTC

Hi,

I want to generate a Word document from different SQL queries.
I've got X DataSet and I want to inject them in my Word document.

When I try to inject data with this code : 

foreach (DataSet dsQuery in queries)
{
wordDocument.WordDocument.MailMerge.Execute(dsQuery.Tables[0]);
}     

Only my first DataSet has been injected.
How can I do that?

Best regards.

Ramkumar M [Syncfusion]
Replied On November 9, 2012 12:44 PM UTC

Hi Nicolas,

Thank you for your interest in Syncfusion products

Currently in DocIO we have cleared all the merge fields once the Mailmerge.Execute(table) function called. To avoid this please set Mailmerge.ClearFields as false to preserve the remaining mail merge fields once the Mailmerge.Execute(table) function called. For your reference please find the code snippets below.

 

Code snippets:

 

wordDocument. MailMerge.ClearFields = false;

 

foreach (DataSet dsQuery in queries)

   {

     wordDocument.WordDocument.MailMerge.Execute(dsQuery.Tables[0]);

   }  

      

Please let us know if you have any question.

Regards

Ramkumar


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

;