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

Mail Merge List

6 Answers 154 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 30 Jun 2012, 01:19 AM
Hi,

Is it possible to create a list using mail merge?

For example, I wish to create a "summary page" listing pricing details for an order. It would be great if mail merge could take my pricing list/collection and create tables and rows.

If not then I guess I could either create a Document table and populate the cells with my data. Another option may be to use the UI Element feature of RadDocument and insert a RadGridView.

Thank you for your time.

6 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 04 Jul 2012, 10:01 AM
Hi Robert,

The idea of InlineUIContainers is to be able to show UIElements for presentation purposes. Embedding a RadGridView in the document and exporting/importing it together with the data in the grid is not supported.

However, the behavior you have described can be achieved using the other mechanism you have mentioned - custom merge fields. Here is a forum post where this is discussed. There is an attached sample solution in Boby's answer which you can check. 

I hope this helps.


Regards,
Martin
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:54 AM
Hi Martin,

Thanks for getting back to me. On the surface it appears to be exactly what I'm looking for.
Unfortunately, the example demo doesn't work. The list data isn't visible when I execute the mail merge preview. I tried using libraries 2012.2.607.40 & 2012.1.326.40, but neither made a difference.

I have posted a response on the thread regarding my issue.

0
Robert
Top achievements
Rank 1
answered on 04 Jul 2012, 11:44 AM
Ok it does work.
there was a hidden button that I didn't notice.
0
Robert
Top achievements
Rank 1
answered on 04 Jul 2012, 03:58 PM
Good afternoon,

I'm having trouble Importing a XAML Template that uses the Custom Table List Merge Field.

I get the following error when executing my import method:

XamlParseException occurred
'Cannot create unknown type '{clr-namespace:TemplateEditor;assembly=TemplateEditor}CustomMergeFieldPricingList'.' Line number '69' and line position '86'.


Below you can see the saved XAML document that I'm trying to import (the problem is in the CustomMergeFieldPricingList tags).
<t:Section PageMargin="25,25,25,25" PageOrientation="Rotate90" PageSize="793,1123">
  <t:Paragraph>
    <t:FieldRangeStart AnnotationID="1">
      <t:CustomMergeFieldPricingList DisplayMode="Code" PropertyPath="PricingList" xmlns:t="clr-namespace:TemplateEditor;assembly=TemplateEditor" />
    </t:FieldRangeStart>
    <t:Span Text="{}{ CUSTOMFIELD PricingList }" />
    <t:FieldRangeEnd AnnotationID="1" />
  </t:Paragraph>
</t:Section>


I should explain that my Solution is made up of 3 projects. One is called TAS2, another called TAS2Database and the final proejct is named TemplateEditor.

The TemplateEditor project is simply a full UI application of RadRichTextBox. The TemplateEditor is used to create any document templates, such as front pages, customer detail pages etc. TAS2 Project then imports the templates as and when they a required at a later date.

As you can see the error message appears to be relating to the TemplateEditor namespace.


My Import Medthod is like so (works fine for evertyhing else except my Custom Merge Field):
public static RadDocument ImportXAML()
{
    RadDocument document = null;
    IDocumentFormatProvider provider = new XamlFormatProvider();
    //IDocumentFormatProvider provider = DocumentFormatProvidersManager.GetProviderByExtension(".xaml");
    OpenFileDialog openDialog = new OpenFileDialog();
    openDialog.Filter = "Documents|*.xaml";
    openDialog.Multiselect = false;
    bool? dialogResult = openDialog.ShowDialog();
    if (dialogResult == true)
    {
        using (Stream stream = openDialog.OpenFile())
        {
            document = provider.Import(stream);
        }
        return document;
    }
    else
    {
        return null;
    }
}


Do you have any idea how I can overcome this?

Thank you for your time,

Rob







0
Robert
Top achievements
Rank 1
answered on 04 Jul 2012, 07:28 PM
Ok the problem is now solved providing the Custom Merge Field class is within one of the projects that is accessible/linked to the project that opens the template XAML document.
0
Martin Ivanov
Telerik team
answered on 05 Jul 2012, 01:11 PM
Hello Robert,

You are right - XamlFormatProvider will not be able to deserialize the document if it contains document elements that are not accessible in the project. We are glad to hear that you have found out the cause of the problem and solved it.

All the best,
Martin
the Telerik team

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

Tags
RichTextBox
Asked by
Robert
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Robert
Top achievements
Rank 1
Share this question
or