1

I'm trying to create a shipment order but when I put 2 in my Number of Copies the report only prints one page.. and must have 3 pages understand?

So I have in Request Page

Expanded Type SubType SourceExpr Name Caption 0 Field NoOfCopies N.º Cópias

And in my Code:

CopyLoop - OnPreDataItem()
NoOfLoops := 1 + ABS(NoOfCopies);
CopyText := '';
SETRANGE(Number,1,NoOfLoops);
OutputNo := 1;

CopyLoop - OnAfterGetRecord()
IF Number > 1 THEN BEGIN
  CopyText := Text001;
  OutputNo += 1;
END;
CurrReport.PAGENO := 1;
TotalQty := 0;           // Item Tracking

CopyLoop - OnPostDataItem()


PageLoop - OnPreDataItem()
// Item Tracking:
IF ShowLotSN THEN BEGIN
  TrackingSpecCount := 0;
  OldRefNo := 0;
  ShowGroup := FALSE;
END;

PageLoop - OnAfterGetRecord()

PageLoop - OnPostDataItem()

I cant figure what I need to do more.. Anyone can help?

enter image description here

Cátia Matos
  • 820
  • 1
  • 8
  • 26

2 Answers2

0

This code work fine for NAV 2009 version "Classic" report. From NAV 2013 onwards you need perform some changes in layout (visual studio).

In body section all your content it has to be inside List object. Then this List object add a group and then you should group by "key" and "No of Copies".

To see this you can check standard report 206.

enter image description here

Jonathan Bravetti
  • 2,228
  • 2
  • 15
  • 29
0

I hope you have copied the code from other report. Fist you have to create a dataitem integer for copies, "NoCopies" in your case. The follow the Jonathan answer and in the table of the report group by that NoOfCopies Variable. You have to pass that variable to the report.

As Jonathan said, check the standard reports for documents to show how the standard works.

AFR
  • 105
  • 4