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

Mail Merge

5 Answers 343 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 28 Jul 2020, 01:58 PM
We want to have a formatted word document that is templated/mail merged.  It will be populated a main object with children objects. This would replace functionality currently done in SSRS but would allow our clients to create their own in Word. Ideally we would like certain parts of the word document to not display if there is no data. Is this possible to accomplish with Kendo?

5 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 30 Jul 2020, 01:01 PM

Hello,

The described behavior can be achieved by using Telerik Document Processing in MVC and Core scenarios on the server side in a similar way as it is shown in this demo - https://demos.telerik.com/aspnet-mvc/wordsprocessing/mail-merge. On the server we can filter the content of the word document according to our needs

If your scenario is somehow different please elaborate it so we could be more helpful.

Regards,
Plamen
Progress Telerik

0
Craig
Top achievements
Rank 1
answered on 30 Jul 2020, 02:08 PM
Hi,

Thanks for the reply. Looking at the example you seem to be defining the template document in code (Mail_MergeController.cs) but is it possible to upload the template as a word doc, then perform the mail merge on that uploaded template, using predefined merge tags or areas?

Is something like the replace component better suited for this?
0
Plamen
Telerik team
answered on 31 Jul 2020, 12:50 PM

Hi,

We can upload a doc file by using our Upload component.

You can also check our mail merge document processing documentation here and our sdk example here.

Regards,
Plamen
Progress Telerik

0
Craig
Top achievements
Rank 1
answered on 04 Aug 2020, 04:09 PM
Is there an example of performing a mail merge on an existing word document that resides on the web server, where the document contains conditional if statements and lists? Can you please provide the code and the source word document in the example. 
Thank you.
0
Tanya
Telerik team
answered on 05 Aug 2020, 12:49 PM

Hi Craig,

You can load the file from the server through the Import() method of the format provider:

Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider provider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider(); 
using (Stream input = File.OpenRead(pathToFile)) 
{ 
    RadFlowDocument document = provider.Import(input); 
} 

The conditional statements and nested merge fields, however, are currently not supported in WordsProcessing. We have logged requests about these functionalities and you can vote for their implementation using the related public items:

You can also subscribe to the items using the Follow button so you can get notifications of status updates on them.

Hope this information is useful.

Regards,
Tanya
Progress Telerik

Tags
General Discussions
Asked by
Craig
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Craig
Top achievements
Rank 1
Tanya
Telerik team
Share this question
or