on 01-08-2015 9:03 AM
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;
)
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?
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, basically it will store values that are results of a calculation so they are surely unique.
To give you an example, if I have an item A in group #2, there will be a calculation performed for that item and finally stored in some variable, in this case the array. So the array will store the values for each available item in group #2.
Inside the sub report there will be items that correspond to items in the main report. So for item A in sub report the array will assign a value that was stored in it. Then perform another calculation in the sub report with the passed value.
I hope it makes sense. Otherwise i will upload a picture of the work I'm doing.
Hi Abhilash,
That's so helpful of you. It works like magic.
But is it possible to display the values only with the matching items in the main report.
For example let items A,B and C are in the main report and have values.If item B doesn't exist in the sub report,ignore the value at index 2 of the array and assign the value at index 3 to item C.
If it's not possible I'll manage that mark it as an answer
But again thank you
Hi,
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")+"]"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.