I am seeking clarification on how the statement “Inside a data band body, the object is resolved to the innermost iteration variable.” from https://docs.aspose.com/words/net/using-contextual-object-member-access/ works when a property on the object in the for each has the same name as a data source passed into
public bool BuildReport(Document document, object dataSources, string dataSourceNames);
I have a template that has a data source called “Record” and a for each item where the Item object also as a property called “Record”.
<<foreach [Items]>><<[Role?.Label]>> <<[Record?.Label]>><</foreach>>
Based statement above from the documentation, I would have expected the
<<[Record?.Label]>> to display the Label of the Record in the item but when I build the template, the LINQ Engine tries accessing the Data Source with the name “Record”.
Which behavior is expected: That “Record” resolves to the iteration variable or to the data source name?
Note: I know that I can work around this by either qualifying the iteration variable or changing the name of the Data Source but this means that all datasource names functionally become reserved words and/or I can not use Contextual Object Member Access because the introduction of any non-unique Data Source name will break existing templates.