Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

No. Of copies option in RDLC report - NAV 2016

(0) ShareShare
ReportReport
Posted on by 1,893

Hello Experts, 

I have prepared the rdlc report. i want to show the no. of copies option in this report.
always it is showing the error. Please give some idea to create a report in nav 2016. I am using
the below data items.

6724.uu.png

*This post is locked for comments

  • Community Member Profile Picture
    on at
    RE: No. Of copies option in RDLC report - NAV 2016

    I'm having the same issue.. can you help me pls?

    community.dynamics.com/.../796544

  • manish.yadav Profile Picture
    1,893 on at
    RE: No. Of copies option in RDLC report - NAV 2016

    Dear Sir,

    Without support it was not possible for me.

    very thanks.

  • Marcellus Profile Picture
    2,735 on at
    RE: No. Of copies option in RDLC report - NAV 2016

    Great news, well done!!

  • manish.yadav Profile Picture
    1,893 on at
    RE: No. Of copies option in RDLC report - NAV 2016

    Now, It is resolved Sir.

  • Verified answer
    Marcellus Profile Picture
    2,735 on at
    RE: No. Of copies option in RDLC report - NAV 2016

    Hi MKY,

    I can't see the indentation property on your data items so just to make sure:

    Posted Whse. Receipt Header:  Indentation = 0

    CopyLoop:  Indentation = 1

    Posted Whse. Receipt Line:  Indentation = 2

    After you executed the report can you go the Help/About this page (CTRL+ALT+F1) and see if your dataset looks similar to what I posted before? Can you share a screenshot of that?

    In the report layout after you created your tablix and group, make sure you insert the new lines inside the group with the Insert Row/Inside Group option.

  • manish.yadav Profile Picture
    1,893 on at
    RE: No. Of copies option in RDLC report - NAV 2016

    Dear Sir, 

    I have followed your suggestion but its always comes single print. I have attached the property of data item. I thing there is some problem in data item property . Plz look in it.

    uu11.png

    Data Items are below:

    Expanded Data Type Data Source Name Include Caption
    1 DataItem Posted Whse. Receipt Header <Posted Whse. Receipt Header> No
    0 Column "Posted Whse. Receipt Header"."No." No No
    0 Column "Posted Whse. Receipt Header"."Posting Date" PostingDt No
    1 DataItem Integer CopyLoop No
    0 Column NoOfLoops Loops No
    1 DataItem Posted Whse. Receipt Line <Posted Whse. Receipt Line> No
    0 Column "Posted Whse. Receipt Line"."No." WhsNo No
    0 Column "Posted Whse. Receipt Line"."Line No." lineno No
    0 Column "Posted Whse. Receipt Line"."Item No." ItemNo No
    0 Column "Posted Whse. Receipt Line".Quantity Qty No
    0 Column "Posted Whse. Receipt Line".Description ItDesc No
    0 Column "Posted Whse. Receipt Line"."Variant Code" Variant No
    0 Column Lotno LotNo No

    The codes are below:

    OnInitReport()

    OnPreReport()

    OnPostReport()

    Posted Whse. Receipt Header - OnPreDataItem()

    Posted Whse. Receipt Header - OnAfterGetRecord()
    NoOfLoops:=0;

    Posted Whse. Receipt Header - OnPostDataItem()

    CopyLoop - OnPreDataItem()
    SETRANGE(Number,1,NoOfCopies+1);

    CopyLoop - OnAfterGetRecord()
    NoOfCopies+=1;

    CopyLoop - OnPostDataItem()

    Posted Whse. Receipt Line - OnPreDataItem()

    Posted Whse. Receipt Line - OnAfterGetRecord()
    RecItem.RESET;
    RecItem.SETRANGE("No.","Posted Whse. Receipt Line"."Item No.");
    IF RecItem.FIND('-') THEN BEGIN
    //intSNo+=1;
    txtItem:=RecItem.Description;
    END;

    recWhsEntry.RESET;
    recWhsEntry.SETRANGE("Entry Type",recWhsEntry."Entry Type"::"Positive Adjmt.");
    recWhsEntry.SETRANGE("Whse. Document No.","Posted Whse. Receipt Line"."No.");
    recWhsEntry.SETRANGE("Source Line No.","Posted Whse. Receipt Line"."Source Line No.");
    recWhsEntry.SETRANGE("Source No.","Posted Whse. Receipt Line"."Source No.");

    recWhsEntry.FINDFIRST;
    Lotno:= recWhsEntry."Lot No.";

    Posted Whse. Receipt Line - OnPostDataItem()

    Output are:

    uu11.png

    Plz help me to resolve it sir.

  • Suggested answer
    Marcellus Profile Picture
    2,735 on at
    RE: No. Of copies option in RDLC report - NAV 2016

    Hi MKY,

    I created a report based on the same tables.

    This is the data item link property from the Receipt Line: No.=FIELD(No.)

    Data.png

    Here is the code:

    I added NoOfLoops and NoOfCopies with type Integer to the Global Variables.

    7563.Code.png

    When I run the report:
    Requestpage.png

    I get this data:
    As you can see I have the original and three copies and the three lines on the warehouse receipt are repeated.

    Data.png

    In the RDLC Layout I created a table with one group:
    RDLC-GRoup.png

    This is the output:

    output.png

    I hope this helps.

  • Marcellus Profile Picture
    2,735 on at
    RE: No. Of copies option in RDLC report - NAV 2016

    Hi,

    Can you share your report as a txt file?

  • manish.yadav Profile Picture
    1,893 on at
    RE: No. Of copies option in RDLC report - NAV 2016

    Dear Sir,

    I am unable to resolve it...

    the code is below

    Posted Whse. Receipt Header - OnPreDataItem()

    Posted Whse. Receipt Header - OnAfterGetRecord()

    Posted Whse. Receipt Header - OnPostDataItem()

    CopyLoop - OnPreDataItem()

    NoOfLoops := ABS(NoOfCopies) + 1;
    IF NoOfLoops <= 0 THEN
    NoOfLoops := 1;
    CopyText := '';
    SETRANGE(Number,1,NoOfLoops);
    OutputNo := 1;

    CopyLoop - OnAfterGetRecord()

    IF Number > 1 THEN BEGIN
    CopyText := Text003;
    OutputNo += 1;
    END;
    CurrReport.PAGENO := 1;

    CopyLoop - OnPostDataItem()

    <IntegerHeader> - OnPreDataItem()

    <IntegerHeader> - OnAfterGetRecord()

    PWRL.RESET;
    PWRL.SETRANGE("No.", PWRL."No.");
    //PWRL.FINDFIRST;

    InitVariables;

    <IntegerHeader> - OnPostDataItem()

    Posted Whse. Receipt Line - OnPreDataItem()

    Posted Whse. Receipt Line - OnAfterGetRecord()
    RecItem.RESET;
    RecItem.SETRANGE("No.","Posted Whse. Receipt Line"."Item No.");
    IF RecItem.FIND('-') THEN BEGIN
    //intSNo+=1;
    txtItem:=RecItem.Description;
    END;

    recWhsEntry.RESET;
    recWhsEntry.SETRANGE("Entry Type",recWhsEntry."Entry Type"::"Positive Adjmt.");
    recWhsEntry.SETRANGE("Whse. Document No.","Posted Whse. Receipt Line"."No.");
    recWhsEntry.SETRANGE("Source Line No.","Posted Whse. Receipt Line"."Source Line No.");
    recWhsEntry.SETRANGE("Source No.","Posted Whse. Receipt Line"."Source No.");

    recWhsEntry.FINDFIRST;
    Lotno:= recWhsEntry."Lot No.";

    Posted Whse. Receipt Line - OnPostDataItem()

    InitVariables()
    // Initialize Variables

    RecNo := '';
    //RecDt := '';
    ItemNo := '';
    Qty := 0;
    ItemDesc := '';
    lineno := '';
    ItDesc := '';
    Lotno := '';
    VariantCD := '';

    2185.variables.png

    2185.variables.png

    5810.uu1.png

    Help me to resolve it.

  • Marcellus Profile Picture
    2,735 on at
    RE: No. Of copies option in RDLC report - NAV 2016

    HI MKY,

    Did you check the tutorial video I linked for you previously?

    In that video at 9:10 you can see how the copyloop is done.

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 the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics NAV (Archived)

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2

#1
mmv Profile Picture

mmv 2

#1
Amol Salvi Profile Picture

Amol Salvi 2

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans