Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

Request page number of copies

Posted on by 20
Hi all,
 
I have created the following report to print labels. With the following code, I get the number of copies I address in the request page, which is good. 
However, I would like to have the copies all on a different page. Can anyone help me? 
 
report 60128 riemetiket
{
    ApplicationArea = All;
    Caption = 'Riemetiketten';
    UsageCategory = Documents;
    DefaultRenderingLayout = riemetiketsmal;
    PreviewMode = PrintLayout;
 
    dataset
    {
        dataitem(CopyLoop; Integer)
        {
            DataItemTableView = sorting(Number);
            column(Number; Number)
            {
 
            }
            dataitem(/Sales Header/; /Sales Header/)
            {
                DataItemTableView = sorting(/Document Type/, /No./) where(/Document Type/ = const(Order));
                RequestFilterFields = /No./;
                column(No_SalesHeader; /No./)
                {
                    IncludeCaption = true;
                }
                column(ExternalDocumentNo; /Sales Header/./External Document No./) { }
 
                dataitem(SalesLine; /Sales Line/)
                {
                    DataItemLink = /Document Type/ = field(/Document Type/), /Document No./ = field(/No./);
                    DataItemTableView = sorting(/Document Type/, /Document No./, /Line No./) where(type = const(Item));
                    RequestFilterFields = /Line No./;
                    RequestFilterHeading = 'Verkoopregel';
 
                    column(Line_No_; /Line No./)
                    {
                    }
                    column(Description; Description)
                    {
                    }
                    column(Description2; /Description 2/)
                    {
                    }
                    column(No; /No./)
                    {
                    }
                    column(DocumentNo; /Document No./)
                    {
                    }
                    column(DocumentType; /Document Type/)
                    {
                    }
                    dataitem(Item; Item)
                    {
                        DataItemLink = /No./ = field(/No./);
                        DataItemLinkReference = SalesLine;
                        column(Common_Item_No; /Common Item No./)
                        { }
                        column(Barcode; EncodedText)
                        { }
                        trigger OnAfterGetRecord()
                        begin
                            GenerateBarcode();
                        end;
                    }
 
                }
            }
 
            trigger OnPreDataItem()
            begin
                SetRange(Number, 1, NoOfCopies + 1);
            end;
        }
    }
    requestpage
    {
        SaveValues = true;
        layout
        {
            area(content)
            {
                group(Opties)
                {
                    field(/Aantal Exemplaren/; NoOfCopies)
                    {
                        ApplicationArea = All;
                        Caption = 'Aantal kopies';
                        ToolTip = 'Hoeveel kopies van een exemplaar er afgedrukt worden';
                    }
 
                }
            }
        }
        actions
        {
            area(processing)
            {
            }
        }
    }
 
    rendering
    {
        layout(Riemetiketmiddel)
        {
            Type = RDLC;
            Caption = 'Riemetiket Middel';
            Summary = 'Riemetiket geprint op middel formaat';
            LayoutFile = './layouts/riemetiketmiddel.rdl';
        }
        layout(Riemetiketsmal)
        {
            Type = RDLC;
            Caption = 'Riemtetiket smal';
            Summary = 'Riemetiket geprint op smal formaat';
            LayoutFile = './layouts/riemetiketsmal.rdl';
        }
        layout(RiemetiketAlvoen)
        {
            Type = RDLC;
            Caption = 'Riemtetiket Alvoen';
            Summary = 'Riemetiket geprint voor Alvoen';
            LayoutFile = './layouts/riemetiketalvoen.rdl';
        }
 
    }
    local procedure GenerateBarcode()
    var
        BarcodeSymbology: Enum /Barcode Symbology/;
        BarcodeFontProvider: Interface /Barcode Font Provider/;
        BarCodeString: Text;
    begin
        BarcodeFontProvider := Enum::/Barcode Font Provider/::IDAutomation1D;
        BarcodeSymbology := Enum::/Barcode Symbology/::Code39;
        BarCodeString := Item./Common Item No./;
        BarcodeFontProvider.ValidateInput(BarCodeString, BarcodeSymbology);
        EncodedText := BarcodeFontProvider.EncodeFont(BarCodeString, BarcodeSymbology);
    end;
 
    var
        EncodedText: Text;
        NoOfCopies: Integer;
        CopyText: Text[30];
 
    procedure InitializeRequest(NewNoOfCopies: Integer)
    begin
        NoOfCopies := NewNoOfCopies;
    end;


 
}
Categories:
  • Verified answer
    Kamal Khakhkhar Profile Picture
    Kamal Khakhkhar 290 on at
    Request page number of copies
    Hii There,
    as per your question, You can apply group for it and Page Break between each instance of group. i have attached Snapshot for your reference.
     
    Thank You.
    Kamal Khakhkhar.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans