running sum
I have 2 fields (ContactPerson & Payment). I want the output as follow:
Date: 01/23/05
ContactPerson Payment TotalAmount
JACKSON 10.00 10.00
JOHN 15.00 25.00
DAVID 5.00 30.00
Date: 01/24/05
ContactPerson Payment TotalAmount
JACKSON 20.00 20.00
MERY 30.00 50.00
how to write code so that the TotalAmount field will have the sum of payment on each date.
Date: 01/23/05
ContactPerson Payment TotalAmount
JACKSON 10.00 10.00
JOHN 15.00 25.00
DAVID 5.00 30.00
Date: 01/24/05
ContactPerson Payment TotalAmount
JACKSON 20.00 20.00
MERY 30.00 50.00
how to write code so that the TotalAmount field will have the sum of payment on each date.
Comments
My report has the following band and fields:
GroupHeader: GroupHeader1 (with only one date field)
MasterData: MasterData1 (with ContactPerson and Payment field)
GroupFooter: GroupFotter1
I had create a variable named totalAmount and drag it to MasterData1 band.
but what is the code I need to put into onBeforePrint of MasterData1 band?
Can you give me more detail on how to add the variable to the report & what is the code that I must write in order to sum the Payment in each group.
Thanks
totalamount := 0;
in opb of mdband
[totalamount] := [totalamount] + [tblmame."fieldname"]