I need to create subtotals for sales persons based on business categories. For each person I need to print the results.
Here is what I have sofar
1) --------- Formula to initialize arrays
whileprintingrecords ;
shared stringvar array catDes := MakeArray("Hardware","Software","");
shared numbervar array catVal := MakeArray(0,0,0);
shared numbervar numCat := 3;
2) ----- Formula to increment the amount
// numCat is the number of business categories
// catDes = Business category description
// catval = the accumulated amount for each category
whileprintingrecords ; shared numbervar numCat ;
shared stringvar array catDes ;
shared numbervar array catVal ;
numbervar num;
// Accumulate amount for each category
for num := 1 to numCat do
if {Sales.Code} = catDes[num] then catVal[num] := catVal[num] + {Sales.Amount})
else // to handle "undefined" or blank categories
catVal[num] := catVal[num] + {Sales.Amount})
3) ---------- Formula to print all amounts and provide a header
??? How do I print the array results in a footer section from 1 to numCat
Here is what I have sofar
1) --------- Formula to initialize arrays
whileprintingrecords ;
shared stringvar array catDes := MakeArray("Hardware","Software","");
shared numbervar array catVal := MakeArray(0,0,0);
shared numbervar numCat := 3;
2) ----- Formula to increment the amount
// numCat is the number of business categories
// catDes = Business category description
// catval = the accumulated amount for each category
whileprintingrecords ; shared numbervar numCat ;
shared stringvar array catDes ;
shared numbervar array catVal ;
numbervar num;
// Accumulate amount for each category
for num := 1 to numCat do
if {Sales.Code} = catDes[num] then catVal[num] := catVal[num] + {Sales.Amount})
else // to handle "undefined" or blank categories
catVal[num] := catVal[num] + {Sales.Amount})
3) ---------- Formula to print all amounts and provide a header
??? How do I print the array results in a footer section from 1 to numCat