debet, credit, saldo in fast report

edited 6:50PM in FastReport 4.0
need advice, I want to make a statement of cash I have to calculate the balance constraint
so this is the case
================
debit | credit | balance
================
500 | 0 | 500
0 | 1000 | -500
750 | 0 | 250
existing data just continues to debit the same credit how to make a statement like that yes with sql server database. thank you

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 6:50PM
    use a variable in the balance memo
    write code in obp event of band to set the variables value.
    Balance := Balance + ((<datasetname."debit">) - (<datsetname."credit">));
    declare your variable at the top of the code page not within in the procedure.
    you will also need to initialize the variable in a group header band.
  • edited 6:50PM
    I've found another example how to make it by using FR agregate functions.
    The documentaction (I use one of 4.6 dated 2008) says about it in chapter 3.6 "Agregate functions".

    If you use (see there are only TWO actual params to function SUM):

    [SUM(<Groups."ItemsTotal">, MasterData1)]

    then you get result like in the first picture. But if you use (see there are THREE actual params to function SUM):

    [SUM(<Groups."ItemsTotal">, MasterData1,2)]

    then you get result like in the second picture.


    Mick
  • gordkgordk St.Catherines On. Canada.
    edited 6:50PM
    Mick you are showing him how to use it in a group footer not in each line of the masterdata
  • edited 6:50PM
    Thanks GordK, you're right :-)
    I didn't notice this should be print on masterband :-(

    Mick
  • edited 6:50PM
    I just have the same problem.Hope can be solved soon.

Leave a Comment