web
You’re offline. This is a read only version of the page.
close
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

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

I have the same question (0)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans