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

Free Support Forum - aspose.com

How to create a MailMerge template with regions on joined rows?


I need to create a Word template for some kind of report with the following table structure inside:

Customer Name Overpayment (-) or Debt (+) Total Details
Payments Fines Penalties
Customer #1 + 10 2 7 1
- 13 3 6 4
Customer #2 + 7 2 4 1
- 23 13 5 5

I tried to use the markup from the attached document and doc.MailMerge.RemoveEmptyParagraphs = true option but the result was ugly - the table "Details" wasn't joined together with outer table. See it on the attached image. The test on image is in russian. If you have any problems with it I'll translate it.
Please give me an advice how to format the template to get the result like on the table above!

p.s.: Aspose.Words 9.7.0

Hi Sedovav,

Thanks for your inquiry. In your case, I suggest you please create the template document with table’s AutoFit option as ‘Fixed Column width’ and set cell margin values to 0. I have modified your template document and have attached to this post for your kind reference.

Please note that every new release of Aspose.Words comes up with some new features, enhancements in the existing features and bug fixes. We always encourage our customers to use the latest version of Aspose.Words as it contains newly introduced features, enhancements and fixes to the issues that are reported earlier. Please download the latest version of Aspose.Words v13.7.0 from here:

Thank you for your reply Tahir! It really is a big help for me. And it works well except one thing that I’ll describe below. Finally I ended up with the template on the pic.1 (see the first attached image). How the merge result looks you can see on the second attachment. I haven’t found a way to stretch nested table through the height of the outer row of the outer table. So if I have a lot of text in the first column of the parent table I have this gaps in between nested table border and parent cell border. That’s bad. I hope you’ll find a way to place region marks on different rows or another way to avoid using nested tables in such cases like mine.

Hi Sedovav,

Thanks for your inquiry. It would be great if you please share following details for testing purposes. I will investigate the issue on my side and provide you more information.

  • Please create a simple application (for example a Console Application Project) that helps us reproduce the same problem on our end and attach it here for testing.
  • Please supply us with the input document that is causing the issue
  • Please supply us with the output document showing the undesired behavior
  • Please supply us with the expected document showing the desired behavior (You can create this document using Microsoft Word).