Hi, I have a document template and have it merged it to a single datatable. The document is created properly.
Now I have a situation where the data would be for 10 different criterias and for each criteria I want the document to have a seperate page with the relevant data. So the merge field has to happen 10 times for each criteria, but I want to use the same doc object and create different pages.
Kindly suggest.
Thanks
-Praveen
Hi,
Thank you for considering Aspose.
It would be great if you attached a sample document template and/or a resulting document you want to achieve. Anyway, here are some hints:
-
If you want to work with repeatable merge fields, use MailMerge.ExecuteWithRegions.
-
You can control merging process and make appropriate corrections according to some criteria inside an event handler for the MailMerge.MergeField event.
-
Starting new page is performed via the DocumentBuilder.InsertBreak method by passing it BreakType.PageBreak.