Link to home
Start Free TrialLog in
Avatar of LoloyDinorog
LoloyDinorog

asked on

Sum a non-field column in crystal reports v10

How would I sum the non-field columns in my crystal reports. Error message is
"A field is required here."
By the way the column figures on my crystal reports which I wanted to sum up are results of formulas using visual basic syntax.
Thanks a lot.

Example:
How can I obtain sum of the following basic syntax code:
 
shared cAmountSched as currency
shared cAmountSchedBranch as  currency
cAmountSchedBranch = cAmountSchedBranch + cAmountSched
formula = cAmountSched - {ZZ_LAPO_Arrear.arrearamt}

Open in new window

Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

shared cAmountSched as currency
shared cAmountSchedBranch as  currency
Dim Tot as currency
cAmountSchedBranch = cAmountSchedBranch + cAmountSched
Tot= Tot+cAmountSched - {ZZ_LAPO_Arrear.arrearamt}
formula = cAmountSched - {ZZ_LAPO_Arrear.arrearamt}


Then create a new formula field to display Tot
Avatar of LoloyDinorog
LoloyDinorog

ASKER

peter57r:

Thanks. But the figures that would display on my new formula field named Tot is
the last entry or line of the column being summed. Hope you can further analyze
the problem.
Sorry...the variable declaration should be:
Global Tot as currency
peter57r
Kindly review my formulas peter57r, where did I go wrong? And
if you can give me your suggested 'scripting' then I will appreciate
it very much.
1. I created a column named IntBalArrears which worked so fine by:

    shared cAmountSched as currency
    shared cAmountSchedBranch as  currency
    cAmountSchedBranch = cAmountSchedBranch + cAmountSched
    formula = cAmountSched - {ZZ_LAPO_Arrear.arrearamt}

2.Then I made a column total or sum by using your suggestions which
   unfortunately did not work:

  shared cAmountSched as currency
  shared cAmountSchedBranch as  currency
  Global Tot as currency
  cAmountSchedBranch = cAmountSchedBranch + cAmountSched
  Tot= Tot+cAmountSched - {ZZ_LAPO_Arrear.arrearamt}
  formula = cAmountSched - {ZZ_LAPO_Arrear.arrearamt}

  Thank you and more power.
peter57r:
For further info,  I placed formula 1 above within Group Footer #2 section of the report,
and formula 2 within Group Footer #1.
I do not know if it has bearing to the results or outcome of the computations.
Thanks.
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
peter57r:
Thankssssssssssssssssssssssssssssssssssssssss!!!