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

Merge Reports

12 Answers 273 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Rieni De Rijke
Top achievements
Rank 1
Rieni De Rijke asked on 10 Nov 2011, 01:40 PM
The RichTextBox has got a great merge-function.
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

Sort by
0
Iva Toteva
Telerik team
answered on 14 Nov 2011, 10:36 PM
Hello Rieni De Rijke,

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.

Greetings,
Iva Toteva
the Telerik team

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

0
Rieni De Rijke
Top achievements
Rank 1
answered on 05 Jan 2012, 04:28 PM
is there a way to find out when the next post/row in the merge-datasource is going to be used.
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.
0
Boby
Telerik team
answered on 11 Jan 2012, 02:48 PM
Hello Rieni De Rijke,
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 >>

0
Rieni De Rijke
Top achievements
Rank 1
answered on 11 Jan 2012, 04:51 PM
Thank you so much for your ansver and your example-project. Just what I needed.
I found a way myself using movenext, movenext etc. But this is much better!
0
Rieni De Rijke
Top achievements
Rank 1
answered on 13 Jan 2012, 10:14 PM
But...
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.
0
Iva Toteva
Telerik team
answered on 17 Jan 2012, 05:49 PM
Hi Rieni De Rijke,

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.

Kind regards,
Iva Toteva
the Telerik team

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

0
Rieni De Rijke
Top achievements
Rank 1
answered on 17 Jan 2012, 08:43 PM
 The version of the controls we are using is 2011.3.1116.40.
0
Accepted
Iva Toteva
Telerik team
answered on 18 Jan 2012, 06:35 PM
Hello Rieni De Rijke,

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.

All the best,
Iva Toteva
the Telerik team

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

0
Robert
Top achievements
Rank 1
answered on 04 Jul 2012, 10:23 AM
Hi,

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
0
Robert
Top achievements
Rank 1
answered on 04 Jul 2012, 11:44 AM
Ah I see it does work.

There's a button labelled Action that I didn't notice.
0
Ashutosh
Top achievements
Rank 1
answered on 27 Oct 2012, 12:22 PM
This doesn't work in Silverligth. I tried. As soon as I go in Result Mode and try to type in it removes the data of merge field.
0
Petya
Telerik team
answered on 30 Oct 2012, 07:44 AM
Hi Ashutosh,

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.

Tags
RichTextBox
Asked by
Rieni De Rijke
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Rieni De Rijke
Top achievements
Rank 1
Boby
Telerik team
Robert
Top achievements
Rank 1
Ashutosh
Top achievements
Rank 1
Petya
Telerik team
Share this question
or