Hi Naveen,
Here's what you need to do:
1) Use this code in the Subreport:
StringVar IncidentID := "" & {PBM_Investigation_Associations.Request_ID01};
Shared StringVar array IncidentIDs;
If not(IncidentID in IncidentIDs) then
(
numbervar x := x + 1;
redim preserve IncidentIDs[x];
IncidentIDs[x] := IncidentID;
);
"";
2) Use this code in the Main Report to access the array variable:
Shared StringVar array IncidentIDs[1];
Notice how the array has been 'subscripted' by writing IncidentIDs[1];
If you use IncidentIDs[2], it will show the second value in the array and so on..
If you wish to show a comma separated string in the Main Report with the array values, then use this:
Shared StringVar array IncidentIDs[1];
Join(IncidentIDs, ", ");
3) Make sure this formula in the Main Report is placed in a section below the section that holds the Subreport. Otherwise the formula will return blank.
-Abhilash