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

Mail Merge fails to merge if document has section break

Thread ID:

Created:

Updated:

Platform:

Replies:

105734 Nov 16,2012 10:17 PM UTC Dec 7,2012 08:49 AM UTC Windows Forms 7
loading
Tags: DocIO
Darren
Asked On November 16, 2012 10:17 PM UTC

I am evaluating the DocIO component and have a mail merge that I got working.  However, as soon as I place a section break in the document(not programactially...just in the doc like a user would).  the mail merge fails to merge any fields.  All the merge fields are wrapped in a TableStart and a TableEnd so it merges for each record in the table.  Take out the section break and it works, put it back and it doesn't.  No errors...just the same document out the other end.

Ramkumar M [Syncfusion]
Replied On November 28, 2012 10:34 AM UTC

Hi Darren,

Thank you for your interest in Syncfusion products.

Currently in DocIO while executing group mail merge operations the group fields must be present within in a single text body. If section break inserted in between TableStart and TableEnd, then group fields will be preserved in separate text bodies cause failure in Mail merging Group. So we recommend that for executing group mailmerge, ensure that the group fields are available within a single text body.

Please let us know if you have any questions

Regards

Ramkumar


Darren
Replied On November 28, 2012 02:50 PM UTC

Ok.  I was able to get it to work by just using Execute and passing the table information.  Perhaps you could throw an exception that provides meaningful message in this case.

Ramkumar M [Syncfusion]
Replied On November 30, 2012 01:03 PM UTC

Hi Darren,

 

Thank you for your update.

 

document.Mailmerge.Execute function performs replacements of every merge field in the document, with the corresponding values  from data source

 

document.Mailmerge.ExceuteGroup function performs replacements of merge fields with in a group marked by TableStart and a TableEnd, for each rows of data source. Hence the mail merge fails if the TableStart and TableEnd presents in different text body.

  

Regarding Exception throw:

As per your suggestion we have planned to through exception for this case in our feature release.

 

Please let us know if you have any question.

 

Regards

Ramkumar


Darren
Replied On December 3, 2012 05:10 PM UTC

In response to your comment... "document.Mailmerge.Execute function performs replacements of every merge field in the document, with the corresponding values  from data source".  This appears not to be true if the merge field is in the page header.  How do I run mail merge data into the page header?

Ramkumar M [Syncfusion]
Replied On December 4, 2012 10:48 AM UTC

Hi Darren, 

Thank you for your update.

We are not able to reproduce the mentioned issue with replacement of merge fields in page Header with corresponding values from data source while calling document.Mailmerge.Execute(dataSource).For your reference please find the sample from the attachment that we have used to reproduce mentioned issue.

Could you please provide us the following?

1) Runnable sample along with input document to reproduce the issue.

2) Details of DocIO version that you are currently using.

So that we can analyze on the exact cause of the issue and provide you the proper solution.

Please let us know if you have any question.

Regards

Ramkumar 



Sample_2e7b773e.zip

Darren
Replied On December 4, 2012 04:23 PM UTC

I have attached a sample that demonstrates both issues.  It fails to merge the field in the header and fails to remove the Next Record fields(it actually outputs them as text...notice the commented Replace code that is my workaround for removing those).  The version being used is 10.204.0.56.  If you look in the bin/debug folder at the TestDocOut.docx, you will see what it generated when I ran it....do this before you try to execute it or it will get overwritten.

Also, I ran the sample you attached and the header fields merged properly.


SyncFusionMailMergeTest_e743a803.zip

Ramkumar M [Syncfusion]
Replied On December 7, 2012 08:49 AM UTC

Hi Darren,

Thank you for your update.

Regarding issue with replacement of merge fields in page Header:

Currently in DocIO while calling document.MailMerge.Execute function we perform mail merge starting from body section of document then header section and then footer sections sequentially.

As you have using the NextRecord field to navigate through each record in data source, once if the data source reaches the end of record while merging fields in body section then mail merge process terminated in body section itself, hence the merge field in the header section not merged.

On analyzing your sample we found that you have used the field “ProgramName” commonly for the entire row. If field “ProgramName” is common for all the row means then you can merge that particular field separately. For your reference we have modified you sample code to illustrate this case. Please find the sample from the attachment and let us know if this helps you


Regarding issue with remove NextRecord field:

Could you please report this issue through Direct Trac Developer Support System (https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Please let us know if you have any other questions.

Regards,
Ramkumar



SyncFusionMailMergeTest_fa1fc74a.zip

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

;