Options

Delivery Note only prints One Copy

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?

1iabzjy7vaqt.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?

Answers

  • Options
    krikikriki Member, Moderator Posts: 9,096
    [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!


  • Options
    elnowakoelnowako Member Posts: 12
    Hi,
    Show a printscreen from the Dataset Designer.
  • Options
    catiamatos1991catiamatos1991 Member Posts: 158
    0m701r3cxe43.png
  • Options
    KarenhKarenh Member Posts: 209
    There is a property for DataItems - MaxIteration. Make sure that is not set to 1.
    Is the CopyLoop data item indented?
  • Options
    catiamatos1991catiamatos1991 Member Posts: 158
    i don't have the MaxIterarion property filled in my data items.. And Copy Loop is well indented as you can see below

    ctemwztsgeoa.png
  • Options
    KarenhKarenh Member Posts: 209
    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.
  • Options
    catiamatos1991catiamatos1991 Member Posts: 158
    I put a message and it's printing 0
Sign In or Register to comment.