Delivery Note only prints One Copy
catiamatos1991
Member Posts: 158
Hi everyone, I'm struggling trying to find why my delivery note only prints one page when I put value 2 or 3 in my request page. I'm using the copy loop triggers as i saw in documentation.
So below there's a image of my problem where in my report print I only have one page, when it was supposed to have 2 or 3 understand?

So I need to have in my document 3 pages that are the same, but one is the original, the second is double and third page is triplicated.
Code:
OnInitReport()
NoOfCopies := 1;
LactCopyText := SIH_Original;
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;
IF LactCopyText <> '' THEN BEGIN
TextOrig2Via := SIH_Original;
END;
MESSAGE('%1',NoOfCopies); //here it prints 2
IF Number = 1 THEN
IF LactCopyText <> '' THEN
TextOrig2Via := LactCopyText
ELSE
TextOrig2Via := SIH_Original;
IF Number = 2 THEN
TextOrig2Via := SIH_Duplicated;
IF Number = 3 THEN
TextOrig2Via := SIH_Triplicated;
IF Number > 3 THEN
TextOrig2Via := SIH_Copy;
CurrReport.PAGENO := 1;
TotalQty := 0; // Item Tracking
HeaderGroup := 1;
LineNumber := 0;
CopyLoop - OnPostDataItem()
So what I'm missing?
So below there's a image of my problem where in my report print I only have one page, when it was supposed to have 2 or 3 understand?

So I need to have in my document 3 pages that are the same, but one is the original, the second is double and third page is triplicated.
Code:
OnInitReport()
NoOfCopies := 1;
LactCopyText := SIH_Original;
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;
IF LactCopyText <> '' THEN BEGIN
TextOrig2Via := SIH_Original;
END;
MESSAGE('%1',NoOfCopies); //here it prints 2
IF Number = 1 THEN
IF LactCopyText <> '' THEN
TextOrig2Via := LactCopyText
ELSE
TextOrig2Via := SIH_Original;
IF Number = 2 THEN
TextOrig2Via := SIH_Duplicated;
IF Number = 3 THEN
TextOrig2Via := SIH_Triplicated;
IF Number > 3 THEN
TextOrig2Via := SIH_Copy;
CurrReport.PAGENO := 1;
TotalQty := 0; // Item Tracking
HeaderGroup := 1;
LineNumber := 0;
CopyLoop - OnPostDataItem()
So what I'm missing?
0
Answers
-
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi,
Show a printscreen from the Dataset Designer.0 -

0 -
There is a property for DataItems - MaxIteration. Make sure that is not set to 1.
Is the CopyLoop data item indented?0 -
i don't have the MaxIterarion property filled in my data items.. And Copy Loop is well indented as you can see below

0 -
I would suspect the No. of Invoice Copies in the customer record. For testing, create a variable for no of copies and put it on the request page. Try that.0
-
I put a message and it's printing 00
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions