We are very pleased with this feature.
Now and then we need a sort of master-detail possibility in our merge-letters.
Think about a mailmerge-letter to your customers.
We could use the mergefields for name, address and so on.
But you would like to use a mergefield to view a list of orders which is different for every customer. Master-detail!
Have you thought about something like that?
And how about combining the mailmerge in the RichTextBox with Telerik Reporting?
12 Answers, 1 is accepted
Thank you for the positive feedback.
We have thought about master-detail mailmerge and we have it on our to-do list. However, the timeline of this feature has not been set yet, so I cannot provide any details of when it is going to be implemented.
I hope this answers your question.
Iva Toteva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Maybe a type of BeforeNextDataRowEvent or something like that.
If we know which row is to be used in the merge-process, we could create a table/text and insert it in the document.
You can use custom merge fields to achieve such behaviour, as demonstrated in the attached project:
public class CustomMergeField : MergeField{ private const string CustomFieldName = "CustomField"; static CustomMergeField() { CodeBasedFieldFactory.RegisterFieldType(CustomMergeField.CustomFieldName, () => { return new CustomMergeField(); }); } public override string FieldTypeName { get { return CustomMergeField.CustomFieldName; } } public override Field CreateInstance() { return new CustomMergeField(); } protected override DocumentFragment GetResultFragment() { Customer customer = this.Document.MailMergeDataSource.CurrentItem as Customer; if (customer == null) { return null; } if (this.PropertyPath == "Orders") { Table table = new Table(); foreach (Order order in customer.Orders) { Span span = new Span(order.ProductName); Paragraph paragraph = new Paragraph(); paragraph.Inlines.Add(span); TableCell cell = new TableCell(); cell.Blocks.Add(paragraph); TableRow row = new TableRow(); row.Cells.Add(cell); table.AddRow(row); } Section section = new Section(); section.Blocks.Add(table); RadDocument document = new RadDocument(); document.Sections.Add(section); document.MeasureAndArrangeInDefaultSize(); return new DocumentFragment(document); } return null; }Don't hesitate to contact us if you have other questions.
Greetings,
Boby
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I found a way myself using movenext, movenext etc. But this is much better!
I use your eksample and I click the Finish-MailMerge-button. I save the merged document as a word-docx.
Now when I open the word-document in Word it looks very weird.
It looks like the lines have been shrinked. I cannot read the text.
When I open the file in your eksample again, it looks fine.
There was such a bug in one of the internal builds before the service pack. Could you tell us the exact version of the controls you are using, e.g. 2011.3.1220.40, so that we can test the behavior?
Looking forward to your reply.
Iva Toteva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
The bug that I mentioned in my previous post is actually present in the version of the controls you quoted - 2011.3.1116.40. The only solution would be to upgrade to the service pack - 2011.3.1220.40.
We are sorry for the inconvenience.
Iva Toteva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I've tried your example, but there is no data present in the mail merge list, the document is blank.
Please see my attached images.
I'm using Telerik WPF version 2012.2.607.40.
Thanks,
Rob
There's a button labelled Action that I didn't notice.
We are not observing the behavior you described on our end. Please find attached the same demo project Boby attached below, but converted to Silverlight.
All the best,
Petya
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
