Can't print more than 1 copy of the report

AitorEGAitorEG Member Posts: 342
edited 2017-02-22 in NAV Three Tier
Hello everyone.
This issue is getting me mad, because with other reports, I don't have any problem to print more than 1 copy. I use the same estructure and code for this report, but I don't get what I need.
This is my structure:
23kfrxr4rzq9.png
As you can see, I only have one URL, where I would get an image for using it as the background image for this report, that in this case, it will be a sticker.
I will get the number of copies as RequestPage (copias), and the code is this one:
vyqku7trxily.png

The issue is that I am using the same approach for other reports, and it works fine.
What could be my problem? Any hint?
PD: I am using NAV2013R2

Best Answer

  • AitorEGAitorEG Member Posts: 342
    Answer ✓
    Fiddi wrote: »
    That's an RDLC- problem not in C/AL. Did you check the data which transfered to RDLC?

    Thanks, yesterday I realise which was the problem. I didn't insert any of the item elements in the layout, so I couldn't make the grouping. So, I inserted the a table item, with the URL, and the loop started to work. I don't want to show the URL on the report, so, I changed the font color to white, and problem solved.

    Thanks for all your tips!

Answers

  • AitorEGAitorEG Member Posts: 342
    edited 2017-02-22
    I've forced the number of copies to 6, as shown below, to check if it was a problem of he request page, but the same issue...

    b9zgvdo9b49e.png

    I'm thinking about the issue could be found in the layout, but don't understand why.
  • FiddiFiddi Member Posts: 46
    The first question is: Do you want a copy per item or a copy per itemlist?
    second: Do you need to control on which page something is printed?
  • afarrafarr Member Posts: 287
    What properties are set for the integer dataitems?
    Alastair Farrugia
  • AitorEGAitorEG Member Posts: 342
    edited 2017-02-22
    Fiddi wrote: »
    The first question is: Do you want a copy per item or a copy per itemlist?
    second: Do you need to control on which page something is printed?

    1: I want a copy per item. Not jus tone, but the number of copies introduces in the requestPage
    2: No, I don't need to control

    Thanks!
  • AitorEGAitorEG Member Posts: 342
    afarr wrote: »
    What properties are set for the integer dataitems?

    wnodfb4sausd.png
    hoto12hu4fgp.png

    Thanks!
  • afarrafarr Member Posts: 287
    a. Is MaxIteration 0 on both data items? (I know that it should be 0 by default, but just want to be sure.)

    b. If you turn on the debugger, in CopyLoop - OnAfterGetRecord, is the value of Number equal to 1 on the first iteration? And is the filter "Number 1..6" ? I know that the answer should be "Yes" but I don't know what else to check.
    Alastair Farrugia
  • FiddiFiddi Member Posts: 46
    O.K then you should first remove the PageLoop. RDLC does pagebreaks itsself.
    Next:NAV means with copies-> one Original and "copias" additional Copies.

    So you should "SETRANGE(Number,1,1+copias)" in the OnPredataItem.
    The Setting of PAGENO ist not needed. RDLC has it's own page counter, which you have to manage by yourself.
    If you get only the original of your Report then you should leave Number as a Paramter for the RDLC- Report. In the RDLC you should check the grouping, it should be "No_Item" and "Number_Copyloop".
    After checked that, you should get a print wich is sorted by by Item."No." and Number.
  • AitorEGAitorEG Member Posts: 342
    edited 2017-02-23
    afarr wrote: »
    a. Is MaxIteration 0 on both data items? (I know that it should be 0 by default, but just want to be sure.)

    b. If you turn on the debugger, in CopyLoop - OnAfterGetRecord, is the value of Number equal to 1 on the first iteration? And is the filter "Number 1..6" ? I know that the answer should be "Yes" but I don't know what else to check.

    Yes and yes. It's quite extrange whats happening, because when I print as PDF, it generates 2 pages, and in preliminary view, just 1.
    Appart from that, every loop calls to the RUN(I've also changed to RUNMODAL) of the report, but nothing...
  • AitorEGAitorEG Member Posts: 342
    Fiddi wrote: »
    O.K then you should first remove the PageLoop. RDLC does pagebreaks itsself.
    Next:NAV means with copies-> one Original and "copias" additional Copies.

    So you should "SETRANGE(Number,1,1+copias)" in the OnPredataItem.
    The Setting of PAGENO ist not needed. RDLC has it's own page counter, which you have to manage by yourself.
    If you get only the original of your Report then you should leave Number as a Paramter for the RDLC- Report. In the RDLC you should check the grouping, it should be "No_Item" and "Number_Copyloop".
    After checked that, you should get a print wich is sorted by by Item."No." and Number.

    Thanks for your answer, but I have a problem for grouping in the report, because I don't have any row or anything to group. The report as only configured the background image, that is get from an exteral source, an URL.
    How can I do a grouping without any added object?

    Really thanks!
  • AitorEGAitorEG Member Posts: 342
    This is the code from the button that generates the report, may be can help...
    d9ovns5uchyc.png

    I'm getting really mad with this issue, I don't find any clue....
  • FiddiFiddi Member Posts: 46
    That's an RDLC- problem not in C/AL. Did you check the data which transfered to RDLC?
  • AitorEGAitorEG Member Posts: 342
    Answer ✓
    Fiddi wrote: »
    That's an RDLC- problem not in C/AL. Did you check the data which transfered to RDLC?

    Thanks, yesterday I realise which was the problem. I didn't insert any of the item elements in the layout, so I couldn't make the grouping. So, I inserted the a table item, with the URL, and the loop started to work. I don't want to show the URL on the report, so, I changed the font color to white, and problem solved.

    Thanks for all your tips!
Sign In or Register to comment.