We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Use Regions And Break Page On Each Record

I have a document that has multiple regions, and I use ExecuteWithRegions multiple times to execute the different regions, which have different DataTables. But I want one of the regions to be able to direct Aspose to break into multiple pages, each page having the next record. Not sure how to organize this. With simpler merges, I know I can use the "Page Break Before" option under Format...Paragraph...Line and Page Breaks, but that is not the scenario. I'm not sure if this is a situation to use a Next field either. How can an ExecuteWithRegions, that has multiple records in it, and is located anywhere in the document, be the main region to direct the document to only show one record per page (not necessarily one page, just a page break that happens and copies the whole page again, like a traditional mail merge).

Thank You,

Derek

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I think that paragraph option “Page Break Before” and “Page Break” should work in this case. Why do you think that this will not work for you?

Would you please attach your template for testing? Also you can create document using MS Word that will show me what you are trying to achieve and attach this document here.

Best regards.

Here is the document. The document is not set up to do this exactly, so let me described what I need to happen. Notice that all the TableStart TableEnd regions are dispersed in very small fonts, but they are there, before and after the tables. Where I need to make this change is in the right quadrant, where the fields MailNameTypeB, AddressTypeB,... ZipTypeB are located. This would be the only grouping of data items that uses a different .Net DataTable to do the merging, and it will have multiple records. So that would make the page break at each one. Cannot figure this one out.

Derek

Also, I know that if I wrapped a new DataTable around the right quadrant, as stated in the previous post, that the current regions would need to be moved into the cell, and not sit above and below the table. Please let me know if this is all possible.

Derek

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. In your template I can see three regions. As I understand you need to repeat whole first page for each record in first region.

So if you data in the second and third regions are the same for each record in first region then you can do the following:

1. Remove TableStart/End of first region.

2. Execute mail merge with regions for second and third regions.

3. Execute simple mail merge for first region (Execute method).

In this case first section of your document will be repeated for each record in your first region.

Best regards.

Is there any possibility of using ExecuteWithRegions, but telling Aspose to make the multiple copies? Any possibility of doing this in code? It keeps the process very generic.

Derek

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. During simple mail merge the whole section is repeated for each data row and every repeated copy is populated with the corresponding data. During mail merge with regions only region is repeated for each row.

So I think that you should use simple mail merge to repeated whole section and mail merge with regions to fill regions with data.

Best regards.