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
0
Comments
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.
be smart before being a clever.
This may help you.
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