LINQ Reporting Engine - Nested loop not working in aspose.word

Hello,
I am trying to implement nested loop using LINQ functionality in aspose word.

    <<foreach [m in cdgabr]>>
        <<foreach [n in cdgabr_ackatabr.Where(x => 
                         x.SettlementDocumentCondominiumDistributionGroupDto_Key == 
                        m.SettlementDocumentCondominiumDistributionGroupDto_Key)]>>

    <<[n.UmlagekostenartDruckreihenfolge]>>
    <<[n.Umlagekostenart]>>


    << /foreach>>
    << /foreach>>

But it is not printing expected result. but If I try only one loop its working. Can you please let me know if I am making any mistake while implementing nested loops?

@abhales

Could you please share your code and data in addition to the templte, so we could check the scenario on our end? It would be perfect, if you could provide a standalone console app reproducing the issue.

Hello,
I have created repository for my application.

https://github.com/aspose-words/Aspose.Words-for-.NET

Template and data details provided in readme.md

@ivan.lyagin

@abhales

Unfortunately, the link you provided returns 404 error. Maybe, the repository is made private?

Hi @ivan.lyagin,
I changed the visibility, can you please check now

@abhales

When using access to members without specifying object names, Contextual Object Member Access rules apply. That is, within a data band, a member reference is resolved for the innermost iteration variable. Since CDGABR does not have a member named CDGABR_ACKATABR and your code allows using of missing members, CDGABR_ACKATABR is processed as a null literal by the engine, which is an expected behavior.

To reference CDGABR_ACKATABR coming from a data source object instead, you may take the following steps:

  1. Use a name for the data source object in your code as follows:
engine.BuildReport(doc, source, "s");
  1. Use the name when accessing the data source’s member within a data band in a template as follows:
<<foreach [n in s.cdgabr_ackatabr.Where(x => x.SettlementDocumentCondominiumDistributionGroupDto_Key == m.SettlementDocumentCondominiumDistributionGroupDto_Key)]>>