I'm assuming the {charge/allowance} data is all in the same database field, with the difference being if it is positive or negative. To create a running total, right click on the data field in the detail section and select Running Total. Choose "sum" as type of summary. Under "Evaluate" choose "On a Formula" and click the formula button. The formula sets the condition for evaluating the formula. Under "Reset" select "Never"
You should create two separate RT's, one for the positive values with conditional evaluation on
and one for the negative values with conditional evaluation on
Place the RT fields in the report footer.
If these RT's are in a subreport, you should use two shared variables to bring them to the main report. In a formula in the subreport, declare:
Code:
shared NumberVar nPosTotal := {RTPosTotal); //use the name of your RT field
shared NumberVar nNegTotal := {RTNegTotal}
Place this formula in a second subreport footer below the RT's.
Then in the main report footer, insert two formulas:
Code:
shared NumberVar nPosTotal
and
Code:
shared NumberVar nNegTotal
to display the totals in the main report
If the subreports are run more than once and you want totals for all the subreport instances, you should put another fromula in your report header to initialize the shared variables to zero and change the subreport footer formulas to:
Code:
shared NumberVar nPosTotal;
shared NumberVar nNegTotal;
shared NumberVar nPosTotal:= shared NumberVar nPosTotal +{RTPosTotal);
shared NumberVar nNegTotal := shared NumberVar nNegTotal + {RTNegTotal}
Be sure to use ":=" to assign values to the variables and to separate staements in a formula with semicolons.