Hi,
According to this link: http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/mail-merge-with-regions-explained.html it's allowed two regions with the same name on document.
I have an issue during merge duplicated regions, just my first table is successfully merged.
My document use two tables like this:
Table 1 Row 1 Cell 1 «TableStart:MyProductTable» «Name» «TableEnd:MyProductTable» Table 2 Row 1 Cell 1 «TableStart:MyProductTable» «Name» Cell 2 «Category» Cell 3 «Price» «TableEnd:MyProductTable»My code:
Products products = entityFrameworkContext.Products.ToList(); document.MailMerge.ExecuteWithRegions(new GenericMailMergeDataSource("MyProductTable", products));GenericMailMergeDataSource:
I use tableName of ctor on IMailMergeDataSource.TableName get
public class GenericMailMergeDataSource : IMailMergeDataSource { public GenericMailMergeDataSource(string tableName, IEnumerable list) { _tableName = tableName; _list = list.ToArray(); _index = -1; } .... }Result: Ok for table 1, but for table 2 nothing happened.
Table 1 Row 1 Cell 1 Product A Row 2 Cell 1 Product B Row 3 Cell 1 Product C Row 4 Cell 1 Product D...Table 2
Row 1
Cell 1
«TableStart:MyProductTable»
«Name»
Cell 2
«Category»
Cell 3
«Price»
«TableEnd:MyProductTable»
What's wrong with my code? I made a mistake about the concept of "duplicated regions"?
Sorry my english.
This message was posted using Page2Forum from Mail Merge with Regions Explained - Aspose.Words for .NET