Skip to Content
avatar image
Former Member

Passing array values to a sub report

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;






Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 08, 2015 at 10:08 AM

    Hi Nebil,

    What exactly are you trying to do with the array formula on the Main Report - only store 'unique' values that appear on the Group #2?

    And, what exactly do you do with the array formula inside the Subreport? Display it somewhere?


    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 08, 2015 at 09:47 AM


    Try Using Join And Pass it as Text .

    ToText(Join( ({YourArray}) , ","))

    I use Below Code for Passing in Open Doc .

    Replace(Replace( ToText(Join( ({YourArray}) , "],[")),"&","%26"),"+","%2B")+"]"

    Add comment
    10|10000 characters needed characters exceeded