Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

report display and prints wrong count values

Status
Not open for further replies.

unknownly

Programmer
Jul 7, 2003
181
US
Hi all,

I am trying to do the first 2 parts(which i got it easily) the last part Netvalues Iam trying to read into array and it works fine to a extend.

Its printing wrong count and totals for the last row in the NETValue part. Below is the ex:
for tag :200 I have count to 2( if assest and liab. count is added) but it prints 3 and even the amt is added 2 times from the liab.section Can you please tell where it going worng:






Unit tag tagdescr count of tag sum(amount) //heading


Assets //grouping on @type

11111 150 AAAAAAAAA 14 4556759931
11111 200 BBBBBBBBB 1 -2230095

---------------------------------
15 4554529836

Liab.

11111 150 AAAAAAAAA 29 -4556759931
11111 200 BBBBBBBBB 1 5174536

---------------------------------
30 -4551585395


Net Value //grouping on unit

11111 150 AAAAAAAAA 43 0
11111 200 BBBBBBBBB 3 8118977
---------------------------------
45 -4551585395


--------------------------------------------------------------------------
//@tag_array drop this formula in details section.

evaluateafter({@initialize_arrays});
global StringVar Array tag_array;
global stringvar array tag_descr;
global numbervar array tag_count;
global numbervar array tag_sum;
global numbervar array tag_sum_dr;
global numbervar array tag_sum_cr;

local numbervar x;
local numbervar y;
local numbervar open_spot;
local numbervar my_tag_position;
local stringvar array_value;


// Initialize Array
redim preserve tag_array[15];
redim preserve tag_descr[15];
redim preserve tag_count[15];
redim preserve tag_sum[15];
redim preserve tag_sum_dr[15];
redim preserve tag_sum_cr[15];

// Clear out the arrays if we changed Node or BU groups
if (previous({@NODE_OR_BU}) <> {@NODE_OR_BU} or OnFirstRecord)
then
(for x := 1 to ubound(tag_array)
do (
tag_array[x] := "";
tag_descr[x] := "";
tag_count[x] := 0;
tag_sum[x] := 0;
tag_sum_dr[x] := 0;
tag_sum_cr[x] := 0;
)
);


if not ({CGF_FR_GARSRPT8A_2.GC_MATCH_CODE.B} in tag_array)
then
(
// Find the next open position in the array
(
for x := 1 to ubound(tag_array)
do (
if tag_array[x] = ""
then (
open_spot := x;
exit for
)
);
);

// Fill the array with the match codes
// Fill the descr array with descrs

if not ({CGF_FR_GARSRPT8A_2.GC_MATCH_CODE.B} in tag_array)
then (
tag_array[open_spot] := {CGF_FR_GARSRPT8A_2.GC_MATCH_CODE.B});
tag_descr[open_spot] := {CGF_FR_GARSRPT8A_2.DESCR.I};
// tag_count[open_spot] := {CGF_FR_GARSRPT8A_2.GC_MATCH_CODE.I};
) ;


if ({CGF_FR_GARSRPT8A_2.GC_MATCH_CODE.B} in tag_array)
then
(
for y := 1 to ubound(tag_array)
do (
if {CGF_FR_GARSRPT8A_2.GC_MATCH_CODE.B} = tag_array[y]
then my_tag_position := y;
// exit for
);
tag_count[my_tag_position] := tag_count[my_tag_position] + {CGF_FR_GARSRPT8A_2.GC_MATCH_CODE.I};
tag_sum[my_tag_position] := tag_sum[my_tag_position] + {CGF_FR_GARSRPT8A_2.POSTED_TOTAL_AMT};
tag_sum_dr[my_tag_position] := tag_sum_dr[my_tag_position] + {CGF_FR_GARSRPT8A_2.DEBIT_AMT};
tag_sum_cr[my_tag_position] := tag_sum_cr[my_tag_position] + {CGF_FR_GARSRPT8A_2.CREDIT_AMT};
);

tag_sum[my_tag_position];
-----------------------------------------------------------------------------------------------
then in group 2 used insert section 10 times and drop the formulas in each of a,b,c,...section in GF2
//@tag2_count for tag count

evaluateafter ({@Tag_Array});

global numberVar Array tag_count;

//redim preserve tag_array[15];
tag_count[2];

//@tag2_sum for sum

evaluateafter ({@Tag_Array});

global numberVar Array tag_sum;

//redim preserve tag_array[15];
tag_sum[2];

any help is appericated

TIA,

Sweetie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top