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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing Subreport Part II

Status
Not open for further replies.

Jefftopia

Programmer
Jul 30, 2002
104
US
Need a formula to calculate "Availability".

Here is what I am trying to accomplish:

Activity Balance Availability
600.00 40.00
7.00 607.00 33.00
4.00 611.00 29.00
(1.00) 610.00 30.00

I have been able to calculate balance by using the following method (provided by Ngolem):

use a shared variable to retrieve the beginning account balance.

In the group header for the account (in a subsection before the subreport if the subreport is located in the Group header) place this formula

//@InitBalance (suppressed)

WhilePrintingRecords;
Shared numberVar Balance := 0;

In the subreport footer place this formula in a suitable location (subreport footer??)

//@OpenBal

WhilePrintingRecords;
Shared numberVar Balance := {Table.OpeningBalance};

Now later in the main report detail section place this formula

//@CalcBal

WhilePrintingRecords;
Shared numberVar Balance ;

Balance := Balance + {Table.AccountActivity};

(or Balance := Balance - {Table.AccountActivity};
if the {Table.AccountActivity} is +ve and you want it subtracted)

//@DisplayfinalBalance (placed in a the grup footer)

WhilePrintingRecords;
Shared numberVar Balance ;

Balance ;

PROBLEM-I CAN'T SEEM TO BE ABLE TO MODIFY THE @CALCBAL FORMULA TO CALCULATE 'AVAILABILITY'.

ANYONE? Help appreciated...
 
See my answer in your original problem....and my note at the bottom of it.

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top