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.


Comments

  • gordkgordk St.Catherines On. Canada.
    edited 3:33PM
    create a var and add to it in obp event of detail band 0 it on each group header band.
    ;)
  • edited 3:33PM
    Thank you for replying. You given me a solution but I'm not able to solve it.

    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
  • gordkgordk St.Catherines On. Canada.
    edited 3:33PM
    In obp of header
    totalamount := 0;
    in opb of mdband
    [totalamount] := [totalamount] + [tblmame."fieldname"]
    ;)
  • edited 3:33PM
    thank you. I will try it.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.