Skip to Content
0
Former Member
Jan 08, 2015 at 09:03 AM

Passing array values to a sub report

180 Views

Hi everyone,

I had a little problem with passing values to a sub report through array.

I have two groups in my main report. And in the second group I want to store the values being printed out in the array and pass them to the sub report.

I created a formula in the main report and placed it in the second group footer.

Then I placed the sub report in the first group footer and created a formula to retrieve the values of the array. But the same value printed on every page.

What am I missing?

Thank you.

Here's the formula I created in the main report: This is the formula in the sub report:

WhilePrintingRecords; WhilePrintingRecords;

shared numberVar array values; shared numberVar i;

shared numberVar i; local numberVar j;

i:=i+1; numbervar v;

redim preserve values[i]; shared numberVar array values;

if i=1 then for j:=1 to i step 1 do

values[i]:={@total} v:=values[j];

else if not({@total} in values[1 to i]) then v;

values[i]:={@total}

else

(

i:=i-1;

)