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

Free Support Forum - aspose.com

NEXT field does not work with nested mail merge region using .NET

Hello.

I am trying to perform mail merge with nested merge region.
The template looks like this
TableStart:outer
outer_field
TableStart:inner
inner_field
TableEnd:inner
{NEXT}
outer_field
TableStart:inner
inner_field
TableEnd:inner
{NEXT}
TableEnd:outer

The problem is that inner table is not referencing correct datasource if I use {NEXT} in the template. I tried to implement own datasource and it seems that inner table is being processed after outer loop processed all {next} records.And since the iterator of the outer loop is pointing to some next record - when the inner loop starts processing it starts not from the first record but from the 1+number_of_{next}.
Hi Yuri,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please attach the expected output Word file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we'll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click 'Reply' button that will bring you to the 'reply page' and there at the bottom you can include any attachments with that post by clicking the 'Add/Update' button.

@oxygenych

We suggest you please use the NEXT field introduced in Aspose.Words 16.8 to LINQ Reporting.

This field instruct the engine to force movement to the next item within a data band using a next tag. The Clients is a DataTable instance having a field named “Name” in the following syntax.

<<foreach [c in Clients]>>
<<[c.Name]>><<next>><<[c.Name]>><<next>><<[c.Name]>> 
<</foreach>>