I am a beginner for Navision, I need your help, Now I meet some trouble for design the report. I want to design a report for invoice. The table source is sales header and sales line. I want to sum the field of “Sales line.Line amount” for each page . I use the section type is transfooter. But the last page is not sum. If I add a section type is footer. Then I sum the “Sales line.Line Amount”. The result is all of pages sum. Please help me how to solve the problem? Thanks!
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I want to sum "Sales line.line amount" at the end page but not whole pages
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
- forget the automatic sums, sum stuff up in variables i.e. having a decimal variables, increasing it in OnAfterGetRecord
- basically you want to clear the variable after it's displayed on one page, so it starts from zero on the second page. If I remember correctly my solution was something like that that when it's displayed, in the OnPreSection of the transfooter I set a boolean TotalDisplayed variable to true. Then in the OnAfterGetRecord if it's true, then set it back to false and clear the decimal variable. It is before adding the current line to it. Not 100% sure it works perfectly but the general idea is this and then you can try to refine it. If it doesn't seem to work right another thing that worked with a similar requirement is having two decimals, TotalAmount and TotalAmountToDisplay and the second one got assigned the from the first one in some trigger and it helped but I don't remember the details either.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.