How to show the total amount on header

liizzliizz Member Posts: 125
Hello,

I have made a report based on Sales Invoice Header which uses the properties GroupTotalFields and TotalFields.
A grouping is made on Posting Date and the field Amount is being used on TotalFields.

The grand total for amount is ok on the footer.
Now, user wants to show the total amount also on header.

Can anybody suggest how to display also the total amount on the header section for the report.

Thanks
Plz help
Liizz

Comments

  • sendohsendoh Member Posts: 207
    just create a function that total the amount of sales invoice and call it in the header.

    similar to this.

    paramaters
    Var Name DataType Subtype Length
    Yes SalesHeader Record Sales Header

    Local Var
    lSalesline Record Sales Line
    lAmt Decimal


    GetTotalAmt(VAR SalesHeader : Record "Sales Header") : Decimal
    lAmt := 0;
    clear(lSalesline);
    lSalesline.setrange("Document type",SalesHeader."Document type");
    lSalesline.setrange("Document no.",SalesHeader."No.");
    if lSalesline.findset then
    repeat
    lAmt += lSalesline."Line amount";
    until lSalesline.next = 0;
    exit(lAmt);

    or you can use the Amount field in the heade but you need to released the document first.
    Sendoh
    be smart before being a clever.
  • navuser1navuser1 Member Posts: 1,329
    There is a field in Sales Line Table Called Amount To Customer .
    This may help you.
    Now or Never
  • liizzliizz Member Posts: 125
    Thanks for ur replies.

    But when I call the function in the section part of the report, should i define a new global record variable for Sales Header to pass as parameter while calling the function?


    Thanks
    Plz advise.

    Liizz
Sign In or Register to comment.