I have created a Report to count Shipment headers and lines, I now want to loop through the lines to create a Total Value of all the Sales Shipment Lines on the report but i'm not sure what code to put in.
I used Michael's solution which works fine, but when i do the same for Sales Credit Memo's (same report different data item) I get the inccorect total, would it need to be calculated differently?
If you manually calc the totals, then if at some section you have SHOWOUTPUT(..)
then you might get unprinted records that participate in the total. You have to look at the general picture of the report mechanism to figure out what to do.
You could also move your code at a post section trigger. Also if you need to print totals in Groupfooters and TransferFooters (or headers) you might end up with wrong results...
Comments
Then in the data item enter
TotalAmount := TotalAmount+"Shipment lines" ;
In the sections enter a footer with a text box. I properties ad the source expression "TotalAmount".
Regards
Michael M
I used Michael's solution which works fine, but when i do the same for Sales Credit Memo's (same report different data item) I get the inccorect total, would it need to be calculated differently?
If you manually calc the totals, then if at some section you have SHOWOUTPUT(..)
then you might get unprinted records that participate in the total. You have to look at the general picture of the report mechanism to figure out what to do.
You could also move your code at a post section trigger. Also if you need to print totals in Groupfooters and TransferFooters (or headers) you might end up with wrong results...