This is a migrated thread and some comments may be shown as answers.

Mail Merge Example

3 Answers 170 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
homer
Top achievements
Rank 1
homer asked on 23 Feb 2012, 05:41 PM
Hi.  I am looking for an example that would allow me to programatially perform a mail merge and display the merged output in the RadRichTextBox.  The merge template was created in the RadRichTextEditor and all the data is available for the datasource. Is this possible to do ?  I am currently using the Rad Controls for Silverlight 4 but will soon be upgrading to the version for Silverlight 5.

Thanks a lot.

3 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 29 Feb 2012, 10:02 AM
Hi O'Neill,

There is no difference between the way mail merge works in Silverlight 4 and Silverlight 5. With both versions, you can perform programmatic mail merge and show the resulting document in RadRichTextBox in the following way:
this.editor.Document = document.MailMerge();

The prerequisites is that the mail-merge document used as template is contained in the "document" variable (it can also be the document in the editor, i.e. this.editor.Document) and that the mail merge data source of document is set.

I hope this helps.

All the best,
Iva Toteva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
homer
Top achievements
Rank 1
answered on 17 May 2012, 08:23 PM
Thanks.  The above example worked great.  I am attempting to make a mailing label screen.  I tried to test a merge with multiple data records and the merge produced a new label per record but displayed the same data in each record.  What did I miss that would allow the merge to itterate the dataset I am passing ?

As well, is it possible to set up a table or grid or something that would create two columns on the page and multiple rows to deliniate and contain each label so that there are lines to use to cut the lables out when they are printed ?

Thanks for your help.
d
0
Boby
Telerik team
answered on 22 May 2012, 09:54 AM
Hello D,
MailMerge method produce document containing documents with merge fields replaced with corresponding data source items.
Please refer to this forum thread for more information on how to create custom master-details mail merge fields.

Regards,
Boby
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
homer
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
homer
Top achievements
Rank 1
Boby
Telerik team
Share this question
or