Summing in Reports

oioi007oioi007 Member Posts: 41
Hello

In Sections, I have added a Column with SourceExpr:
"Cust. Ledger Entry"."Original Amount"-"Cust. Ledger Entry"."Remaining Amount"

now I want to sum this Column, this is not a field in a table, so how can I total them? ](*,)

Answers

  • JedrzejTJedrzejT Member Posts: 267
    You can use variable SomeSum
    OnAfterGetRecord
    SomeSum:="Cust. Ledger Entry"."Original Amount"-"Cust. Ledger Entry"."Remaining Amount"
    CurrReport.CREATETOTALS(SomeSum)

    Use SomeSum in sourceexp.

    Regards
  • oioi007oioi007 Member Posts: 41
    Thanks a Lot!
  • Revolution1210Revolution1210 Member Posts: 161
    Or put this OnPreDataItem()
    CurrReport.CREATETOTALS("Original Amount","Remaining Amount");
    

    And copy your existing field from your body section with the SourceExpr into your footer section:
    "Original Amount"-"Remaining Amount"
    

    You may also need to do CALCFIELD on the amount fields.
    Ian

    www.NextEqualZero.com
    A technical eye on Dynamics NAV
Sign In or Register to comment.