We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Xamarin DOCIO

Hello,

can I merge from datasource inclusive images, it will better when you have an example.

Thanks
Louai

5 Replies

SY Sethumanikkam Yogendran Syncfusion Team January 20, 2017 06:50 AM UTC

Hi Louai,

Thank you for contacting Syncfusion support.

Essential DocIO provides support to insert an image to the Word document using Mail merge. You can achieve this by creating a template (Input) Word document which contains the merge field with prefix “Image:” and perform Mail merge using Essential DocIO. It will populate the retrieved data (image from datasource) in the corresponding merge fields during Mail merge.

The following screenshot shows how to insert a merge filed with prefix “Image:” in the Word document by using the Microsoft Word.


We have prepared a sample to meet your requirement. Please find the sample from the following link, and let us know if it helps you.

Sample Link:
http://www.syncfusion.com/downloads/support/forum/128414/ze/GettingStarted_DocIO-1233025910.zip

Note: Please find the input template Word document and image from “Data” folder inside the Getting Started application.

Please find the following UG documentation link on MergeImageField event.
UG Documentation Link:
https://help.syncfusion.com/file-formats/docio/working-with-mailmerge#mergeimagefield-event

If the above-mentioned solution does not resolve your problem then kindly provide the following details to reproduce the mentioned issue at our end which will helpful to provide you the solution at the earliest.
     1. Working scenario along with the sample or complete code snippet used at your end.
     2. Input template document (Word document) used.
     3. Data set used for Mail merge process.
     4. Screenshot of your output or expected output document.

Please let us know if you have any other questions.

Regards,
Sethumanikkam.Y



LD Louai Dakhel February 2, 2017 03:01 PM UTC

Hi Sethumanikkam,

I have made the following like i have wrote in attached file but i got a wrong result, what was wrong I did???




Attachment: MailMergeDataSet_dataSet_34d83dca.rar


SY Sethumanikkam Yogendran Syncfusion Team February 3, 2017 06:16 AM UTC

Hi Louai,

Thank you for your update.

On further analyzing with provided Word document, we suspect your requirement is to execute Mail merge in nested group but the input template which you have used do not having nested group for the provided DataTable values.

We have modified your input template Word document to meet your requirement with below code snippet modifications. Please find the input template from here, and let us know if this helps you.

Code snippet:
 
WordDocument wordDocument = new WordDocument("Template.docx");
MailMergeDataSet dataSet = new MailMergeDataSet();
MailMergeDataTable dataTable = new MailMergeDataTable("Persons", GetPerson());
dataSet.Add(dataTable);
dataTable = new MailMergeDataTable("Languages", GetLanguage());
dataSet.Add(dataTable);
List<DictionaryEntry> commands = new List<DictionaryEntry>();
DictionaryEntry entry = new DictionaryEntry("Persons", string.Empty);
commands.Add(entry);
entry = new DictionaryEntry("Languages", string.Empty);
commands.Add(entry);
wordDocument.MailMerge.ExecuteNestedGroup(dataSet, commands);
wordDocument.Save("Sample.docx");
 

If we misunderstand any of your requirement, then kindly update us requirement with sample for clear description along with Input document and screenshot/output Word document of the expected result which will helpful to provide you the appropriate solution at the earliest.

Please let us know if you have any other questions.

Regards,
Sethumanikkam.Y



LD Louai Dakhel February 3, 2017 06:38 AM UTC

Thank you very much, it work great

Thanks a lot
Louai


RP Ranjani Prabhakaran Syncfusion Team February 6, 2017 05:36 AM UTC

Hi Louai, 
  
We are glad to know that the given solution work. Please reach us if you need any further assistance. 
  
Regards, 
Ranjani 


Loader.
Up arrow icon