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

Free Support Forum - aspose.com

Problem with Master-details execute region

I have written a sample program with 2 data tables, 1 master & 1 details. When I generated the report, only the master portion is generated correct but all details reports in master portion are not populated.

A template IHCTemplate2.docx is included in the project, please copy to the root prior to run the program.

Please review if I have built the template or datatables incorrectly.

Thanks in advance for your help.

Hello,


Thanks for your request. The error was in your template. TableEnd was missing. I corrected your template, please see attachments.

Best regards,

Hi,


Thanks for inquiry.Issue seems to be with the merge fields names in child region in IHCTemplate2.docx.For details please see following link:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/mail-merge-with-regions-explained.html

I also have attached the wroking IHCTemplate2.docx template.

____________

Regards,

Nabeel Ahmad

Support Developer,

Aspose Sialkot Team

http://www.aspose.com/

Aspose - Your File Format Experts

Thanks for correcting the template. The program merges correctly. Now, I have added the IFieldMergingCallBack to change the color of each row in the details table to specific color based on Score column value of that row. To pull the Score value of current row, I use e.RecordIndex. However, the e.RecordIndex does not point to the actual row in the DataTable but rather the row being output.

In this case, the document outputs 3 tables so e.RecordIndex is always 0 and Score value is at the 1st row of details DataTable. Is there a way to determine actual row index where the field value comes from?

See my attached project and copy the IHCTemplate3.docx to root c:\ prior to run.

Hi there,

Thanks for your inquiry.

I think the following thread maybe useful to you: http://www.aspose.com/community/forums/328806/possible-bug-in-ifieldmergingcallback.fieldmerging-using-mailmerge.executewithregions/showthread.aspx#328806

If you need any further assistance please feel free to ask.

Thanks,