Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Delivery Note only prints One Copy

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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?

8750.report.png

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?

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans