I have the datasubset A shows all managers of my firm . i am showing inside a paging grid .
Data subset A has a key value Manager ID
for each manager i am querying employees ( Data Subset B ) who reports to that manager . which i am getting by passing the manager ID from the Datasubset A
I have to display managers and their direct reports in a single paging grid . as shown below
I did the following steps
1) Wrote an expression rule to query all the managers and stored in Datasubset A
2) For each manager ID in Datasubset A , i wrote another expression rule to query direct reports
So i have two data subsets which i have to display in one grid . do you know how to accomplish this ?
Discussion posts and replies are publicly visible
for your Direct Reports column, something like this template should work well:
a!gridTextColumn( data: a!forEach( local!managerDataSubset, with( local!reportsForThisManager: rule!queryReportsForMgr(mgrId: fv!item.mgrId), concat( a!forEach( local!reportsForThisManager, fv!item.FirstName & " " & fv!item.LastName & if(fv!isLast, null(), char(10)) ) ) ) ) )
Sorry - I made a small mistake. The inner a!forEach() needs to be wrapped inside a concat(). My original example is now updated.