Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8357

Re: Passing Arrays parameter from Sub report to Mainreport

$
0
0

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


Viewing all articles
Browse latest Browse all 8357


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>