I have a problem in Navision 5.0 report customization, I created a new report trying to pass the Sales invoice line items to an array. My problem is I want my report to print only 15 sales invoice items per page, what I have done now it prints the first 15 items in the first page but it does not show the 2nd page and so on. It only shows the first page every time I generate the report. Any help will be appreciated…
Welcome to the Dynamics User Group!
How have you structured your report - i.e. what dataitem is printing the array?
Another way it to use the sales invoice line table as a dataitem and make the header/footer big enough that it will print only 15 lines.
I only added the Sales Invoice Header section, I cannot apply the header/footer because i need my report to print a fixed 15 items even example if the invoice have a 10 line items only my report will add an additional 5 blank items just to make it 15 so the boxes will not be shortened. And if i have a greater than 15 items the other items after 15 will be printed in the next page. example I have 20 items, the 16 to 20 will be printed in the next page plus another 10 blank to make it 15 in the first page and 15 in the second. Here is my print screen of the report, thank you for your quick reply I really appreciate it.
Here’s how i code it:
Sales Invoice Header, Body (2) - OnPreSection()
TotalAmt := 0;
TotalVAT := 0;
TotalIncVAT := 0;
TReport.SETRANGE(“Document No.”,“Sales Invoice Header”.“No.”);
IF LineNos = 16 THEN CurrReport.NEWPAGE;
Array4[LineNos]:=TReport.“Unit of Measure Code”;
TotalAmt := TotalAmt + TReport.“Line Amount”;
TotalIncVAT := TotalIncVAT + TReport.“Amount Including VAT”;
UNTIL TReport.NEXT = 0;
TotalVAT := TotalIncVAT - TotalAmt;
TotalCap := 'Total ’ + “Sales Invoice Header”.“Currency Code”;
TotalCap1 := ‘Total ’ + “Sales Invoice Header”.“Currency Code” + ’ Incl. VAT’;
I dont think this design will work for you as the Body section is for the header and you will always have only one header. Add a second dataitem for sales invoice line and link it to the header and this will loop around the sales invoice lines for you. You can still count up the line and use CurrReport.NEWPAGE; or create a footer and extend the size until Nav automatically breaks on ever 15 lines.
Would you mind if you give me a sample of this solution, actually I’m new to Navision. Where could i do the coding?
I tried to add the Sales Invoice Line item, what happened was it printed my array as many time as the line items. 16 items is equal to 16 pages, that’s what happened.
I would let alone the array. Add just two dataitems - Sales Invoice Header and Sales Invoice Line, indented and linked to Sales Invoice Header through Invoice No.
Design four sections:
Sales Invoice Header, Body - where you put the print header (Invoice No., Customer No. Customer Name, and such…)
Sales Invoice Line, Transheader - where you put an exact replica of the print header, so that, wwhenever a new page will start, the header will be printer again.
Sales Invoice Line, Body - where you you just print the invoice line
Sales Invoice Line Footer - where you put the print footer (Total amount, VAT and so on…), set the section properties “Print On Every Page” and “Place in Bottom” to Yes.
This will not solve all your problems at once, but will help you to understand how Navision reports work. Try and come back for next lesson. [:)]