Hello there,
I am having a doubt regarding what will be the best way to implement Mail Merge - ExecuteWithRegions in my scenerio -
I have a Main collection object called Properties with two child collections: Applicants, Vendors.
In first scenerio:
1. Source template is having Merge Fields for Property + Vendor and region defined one child collection say Applicants as
{<!–[if gte mso 10]>
<![endif]–><span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>MERGEFIELD TableStart:Applicants}
…
{<!–[if gte mso 10]>
<![endif]–><span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>MERGEFIELD TableStart:Applicants}
and for second child collection Vendors, mail merge needs to be repeated for each vendor under a property object as:
<Property[0]>
<Vendors[0.1]> mail merge executed with region Property[0].<span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>Applicants
<Vendors[0.2]> mail merge executed with region Property[0].<span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>Applicants
</Property[0]>
<Property[1]>
<Vendors[1.1]> mail merge executed with region Property[1].<span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>Applicants
<Vendors[1.2]> mail merge executed with region Property[1].<span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>Applicants
<Vendors[1.3]> mail merge executed with region Property[1].<span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>Applicants
</Property[1]>
So, In above scenerio, my output report will have 5 pages considering the source template is of one page.
Similary in second scenerio, region is defined for Vendors and mail Merge is repeated for Property Applicants:
2. In second type of template, I have Merge Fields for Property+Applicant and have region defined for one child collection say Vendors as
{<!–[if gte mso 10]>
<![endif]–><span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>MERGEFIELD TableStart:Vendors}
…
{<!–[if gte mso 10]>
<![endif]–><span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>MERGEFIELD TableStart:<span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>Vendors}
and for second child collection Applicants mail merge needs to be repeated for each Applicant under a property object as:
<Property[0]>
<Applicant[0.1]> mail merge executed with region Property[0].Vendors
<Applicant[0.2]> mail merge executed with region Property[0].Vendors
<Applicant[0.3]> mail merge executed with region Property[0].Vendors
</Property[0]>
<Property[1]>
<Applicant[1.1]> mail merge executed with region Property[1].Vendors<br>
<Applicant[1.2]> mail merge executed with region Property[1].Vendors<br>
<Applicant[1.3]> mail merge executed with region Property[1].Vendors<br>
</Property[1]>
So, In above scenerio, my output report will have 6 pages considering the source template is of one page.
I am thinking to implement it by creating run time collection as mentioned in this thread:
<a href="https://forum.aspose.com/t/81934
Do you think of any other way to achieve above?
P.S. attached are the sample docs for above scenerios