You could use a background thread that executes the Merge operation. In order to pass the document to execute on the background, you will need to export it and pass the result string to the other thread, which then could import it to create a RadDocument instance and merge the desired record from the source collection. Keep in mind that the thread must be with ApartmentState.STA.
Here is a sample code that uses a separate thread to perform a Mail Merge and save the document to the file system:
XamlFormatProvider provider =
editorDocument = provider.Export(
Thread thread =
RadDocument document = provider.Import(editorDocument);
// The MailMerge() method will merge all the records in the MailMergeDataSource. If you need to merge only a single record, you could use MailMergeCurrentRecord()
RadDocument result = document.MailMerge();
PdfFormatProvider pdfProvider =
(FileStream stream = File.OpenWrite(
Hope this helps.
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer
and share your thoughts.