on 10-22-2014 1:33 AM
I have successfully created running totals based upon the logic below.
reset --- goes in group header
whileprintingrecords;
numbervar x := 0;
calc goes next to what is being calcualted
whileprintingrecords;
numbervar x := x + {field or formula};
display goes where you would like the value to show
whileprintingrecords;
numbervar x;
x
At the end of each Group, is there anyway to capture the group total for later use? My report is currently working as follows:
Group 1: Total 500
Group 2: Total 1000
Group 3: Total 600
Report Footer: Grand Total: 2100
I need to capture Group Total 1: 500, Group Total 2: 1000 and Group Total 3: 600 each separately.
I have a calculation that I need to perform on each Group total but do not know how to capture that number to be able to use it in another formula.
Thanks for your help.
Hi Terry,
Here's what you need to do:
1) Create a formula with this code and place it beside the 'calculation' formula:
whileprintingrecords;
numbervar array arr;
numbervar y := y + 1;
redim preserve arr[y];
arr[y] := {@calculation_formula}
2) Now that the array is populated with the group totals, you can create separate formulas to access the values it holds. E.g:
whileprintingrecords;
numbervar array arr[1]; //This will show 500
whileprintingrecords;
numbervar array arr[2]; //This will show 1000
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
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.