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

DataReader and MailMerge

Thread ID:

Created:

Updated:

Platform:

Replies:

92463 Jan 16,2010 12:34 AM UTC Feb 18,2010 03:39 AM UTC ASP.NET Web Forms (Classic) 5
loading
Tags: DocIO
Chris Ladewig
Asked On January 16, 2010 12:34 AM UTC

Hello,

I'm trying to use the overload method for MailMerge.ExecuteGroup(IDataReader) and I can't seem to get it to work... here's what I'm matching up.

Database:
TableName: Contacts
Columns: FirstName, LastName, CellNumber, JobTitle

On the Word Template (.dot) I've tried different ways of creating a MergeField to get this to work, that I have found in the examples on your website. Here are the different ways:

<>
<>
<>
<>
<>
<>

I've also tried with this:

<>
<>
<>
<>
<>
<>

Here's how I'm setting up the call in code (DataClass is a class I made to return a IDataReader which reads the above database):

IWordDocument doc = new WordDocument( @"C:\Sample Report.dot");
doc.MailMerge.ClearFields = true;
DataClass data = new DataClass();
IDataReader Contacts = data.GetContact(); doc.MailMerge.ExecuteGroup(Contacts);
doc.Save(@"C:\AfterSectionMerge.doc", FormatType.Doc);

I know I'm missing something, but can't seem to find it in the examples. I see that the examples set the table name on a datatable, but I don't believe I can do that on a IDataReader. Any ideas?

Vijayakumar S [Syncfusion]
Replied On January 19, 2010 02:54 PM UTC

Hi Chris,

Thank you for your interest in Syncfusion products.

We are sorry for the delay in responding. We were able to reproduce the mentioned issue. We suspect this could be a defect. We have forwarded this issue to our development team for further analysis.

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 me know if you have any queries.

Regards,
Vijay

Chris Ladewig
Replied On January 19, 2010 04:08 PM UTC

Looks like my tags got removed in the original post, just imagine these in the merge fields:

DataTableBegin:Contacts
FirstName
LastName
CellNumber
JobTitle
DataTableEnd:Contacts

and

BeginGroup:Contacts
FirstName
LastName
CellNumber
JobTitle
EndGroup:Contacts

Then I tried to be creative to try and get it to work:

IDataReaderBegin:Contacts
FirstName
LastName
CellNumber
JobTitle
IDataReaderEnd:Contacts



So that method isn't working? If it was how should I setup the group with MergeFields in the Word template and where do I need to set the name "Contacts" to tell the IDataReader which group to execute?

-Chris

Vijayakumar S [Syncfusion]
Replied On January 29, 2010 07:32 AM UTC

Hi Chris,

We are sorry for the delay in responding. Please do find the sample to perform Mail merge with DataReader from the below link. Could please have a look at the sample and let us know if this helps.

Sample:
http://help.syncfusion.com/support/DocIO.Windows/samples/MailmergeWithReader.zip

Please let us know if you have any questions.

Regards,
Vijay

Chris Ladewig
Replied On February 16, 2010 04:48 PM UTC

That helped! Thank you!

Vijayakumar S [Syncfusion]
Replied On February 18, 2010 03:39 AM UTC

Hi Chris,

Thank you for your update.

Please let us know if you have any questions.

Regards,
Vijay

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

;