Splitting a report into two

kolaboykolaboy Member Posts: 446
Hi Experts,
How can one split a report into two. I have a printer that cuts receipt once, and now i want it to cut it twice. I guess splitting the report into two the printer will cut it twice at the end of each report.

So,how can i split a report into two. Can someone explain the steps for me. Please!!
Thanks.

Comments

  • krikikriki Member, Moderator Posts: 9,110
    Can you explain a little better what exactly you want to do.
    This is quite unclear:
    I have a printer that cuts receipt once, and now i want it to cut it twice
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • kolaboykolaboy Member Posts: 446
    What i mean is i am having a printer that can only be set to cut a receipt only once. When a client post and print, the receipt is printed once and cuts at the end of the print job, hence giving only one copy of the receipt.

    If you want to have two copies of the receipt and when the printer is asked to print two copies, it print two copies but cuts the receipt at the end of the second copy, hence cutting once.

    The client wants to have two copies of the receipt and wants the printer to cut the receipt at the end of each copy thereby giving two copies which are cut, hence the printer cuts twice. This is what the client wants. I hope you understand now.
    Thanks.
  • slmaluwaslmaluwa Member Posts: 366
    I dunno exact way of doing this in navision

    But, a general advice is to excute the print command twice instead of printing 2 copies.

    The printer may be set to cut at the end of the print job, rather than at end of each page, like in some fax machines.

    regards
    "A bove maiore discit arare minor"-"From the old ox, the young one learns to plow."
  • kolaboykolaboy Member Posts: 446
    The problem is the receipt prints when the cashier post the payment. when the payments are posted, they go to the Cust. ledger Entry Table.

    You don't see any payment when they are posted hence you will not be about to post again to have another print job. Unless you enter another payment. you can't print twice for one posting. you can only go to the copy of the customers reciept to have a second copy.

    i suggested this method, but they said its too tedious. they want it print two copies in one posting and the printer should cut the receipt after each copy.

    Thanks.
  • kolaboykolaboy Member Posts: 446
    Hi all,
    I am looking for a code that can make a report to copy twice when printed.

    the report is created from Cust. ledger Entry Table.
    Any idea Please?
    Thanks.
  • todrotodro Member Posts: 117
    kolaboy wrote:
    Hi all,
    I am looking for a code that can make a report to copy twice when printed.

    the report is created from Cust. ledger Entry Table.
    Any idea Please?
    Thanks.
    Create an outer loop dataitem. You will find this implemented in various standard reports, e.g. 206 Sales Invoice. Have a look at CopyLoop.
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
  • AlbertvhAlbertvh Member Posts: 516
    HI
    I don't know where this report is called from but maybe you could create
    a processing only report with the filters set and then from this report
    call the printing report

    eg
    from posting call processing report to call print report

    in C/AL maybe something like this

    Post & Print routine

    Processreport.RUNMODAL(Rec); // Rec has all the filters set

    Processreport
    OnAFterGetRecord
    FOR I := 1 to 2 DO
    PrintReport.RUN(Rec):


    Hope this helps


    Albert
  • kolaboykolaboy Member Posts: 446
    Hi Expert,
    Here is what i have tried so far, but it not working:
    OBJECT Report 50000 Cust. Reciept
    {
    OBJECT-PROPERTIES
    {
    Date=29/08/07;
    Time=11:08:02;
    Modified=Yes;
    Version List=;
    }
    PROPERTIES
    {
    UseReqForm=Yes;
    UseSystemPrinter=Yes;
    }
    DATAITEMS
    {
    { PROPERTIES
    {
    DataItemTable=Table21;
    DataItemTableView=SORTING(Entry No.);
    NewPagePerRecord=Yes;
    OnAfterGetRecord=BEGIN
    IF "Cust. Ledger Entry"."Amount (LCY)" < 0 THEN
    "Cust. Ledger Entry"."Amount (LCY)":="Cust. Ledger Entry"."Amount (LCY)" * -1;

    IF Customer.GET("Cust. Ledger Entry"."Customer No.") THEN
    CustName := Customer.Name
    ELSE
    CustName := '';
    IF Cashier.GET("Cust. Ledger Entry"."User ID") THEN
    CashName := Cashier.Name
    ELSE
    CashName := '';
    END;

    ReqFilterFields=Document No.;
    }
    SECTIONS
    {
    { PROPERTIES
    {
    SectionType=Header;
    PrintOnEveryPage=Yes;
    SectionWidth=18150;
    SectionHeight=2538;
    OnPreSection=BEGIN
    COMPINFO.GET;
    COMPINFO.CALCFIELDS(Picture);
    END;

    }
    CONTROLS
    {
    { 1000000002;TextBox;15000;0 ;3150 ;423 ;HorzAlign=Right;
    SourceExpr=FORMAT(TODAY,0,4) }
    { 1000000004;TextBox;17700;423 ;450 ;423 ;CaptionML=ENU=Page;
    SourceExpr=CurrReport.PAGENO }
    { 1000000005;Label ;16950;423 ;750 ;423 ;ParentControl=1000000004 }
    { 1000000006;TextBox;15900;846 ;2250 ;423 ;HorzAlign=Right;
    SourceExpr=USERID }
    { 1000000022;Label ;0 ;1692 ;3150 ;423 ;FontSize=9;
    FontBold=Yes;
    FontUnderline=Yes;
    CaptionML=ENU=Official Receipt }
    { 1000000034;Label ;0 ;0 ;5400 ;1692 ;Border=No;
    BorderStyle=Normal;
    FontSize=12;
    FontBold=Yes;
    MultiLine=Yes;
    CaptionML=ENU="SOCIAL SECURITY AND HOUSING FINANCE CORPORATION " }
    }
    }
    { PROPERTIES
    {
    SectionType=Body;
    SectionWidth=18150;
    SectionHeight=8037;
    }
    CONTROLS
    {
    { 1000000008;TextBox;3150 ;0 ;4650 ;423 ;HorzAlign=Left;
    SourceExpr="Document No." }
    { 1000000009;Label ;0 ;0 ;3000 ;423 ;ParentControl=1000000008;
    CaptionML=ENU=Receipt No. }
    { 1000000011;TextBox;3150 ;423 ;2700 ;423 ;HorzAlign=Left;
    SourceExpr="Posting Date" }
    { 1000000012;Label ;0 ;423 ;3000 ;423 ;ParentControl=1000000011;
    CaptionML=ENU=Date }
    { 1000000014;TextBox;3150 ;846 ;3450 ;423 ;HorzAlign=Left;
    SourceExpr="Customer No." }
    { 1000000015;Label ;0 ;846 ;3000 ;423 ;ParentControl=1000000014 }
    { 1000000017;TextBox;3150 ;2115 ;3750 ;423 ;HorzAlign=Left;
    SourceExpr=["Amount (LCY)" ] }
    { 1000000018;Label ;0 ;2115 ;3000 ;423 ;ParentControl=1000000017;
    CaptionML=ENU=Amount (GMD) }
    { 1000000023;TextBox;3150 ;2538 ;4950 ;423 ;HorzAlign=Left;
    SourceExpr=Description }
    { 1000000024;Label ;0 ;2538 ;3000 ;423 ;ParentControl=1000000023;
    CaptionML=ENU=Desc }
    { 1000000026;TextBox;3150 ;2961 ;4950 ;423 ;HorzAlign=Left;
    SourceExpr="Dimension Name" }
    { 1000000027;Label ;0 ;2961 ;3000 ;423 ;ParentControl=1000000026;
    CaptionML=ENU=FUND }
    { 1000000000;TextBox;3150 ;1269 ;4650 ;423 ;HorzAlign=Left;
    SourceExpr=CustName }
    { 1000000007;Label ;0 ;1269 ;3000 ;423 ;ParentControl=1000000000;
    CaptionML=ENU=Customer Name }
    { 1000000010;TextBox;3150 ;3807 ;2700 ;423 ;HorzAlign=Left;
    SourceExpr="Start Period Name" }
    { 1000000013;Label ;0 ;3807 ;3000 ;423 ;ParentControl=1000000010;
    CaptionML=ENU="Start Period " }
    { 1000000019;Label ;0 ;5499 ;4650 ;423 ;HorzAlign=Left;
    CaptionML=ENU=___________________________________ }
    { 1000000025;Label ;0 ;5922 ;4650 ;423 ;HorzAlign=Left;
    CaptionML=ENU=Cashier's Stamp & Signature: }
    { 1000000016;TextBox;3150 ;4230 ;2700 ;423 ;HorzAlign=Left;
    SourceExpr="End Period Name" }
    { 1000000020;Label ;0 ;4230 ;3000 ;423 ;ParentControl=1000000016;
    VertAlign=Center;
    FontBold=Yes;
    MultiLine=Yes;
    CaptionML=ENU=End Period }
    { 1000000001;TextBox;3150 ;3384 ;4950 ;423 ;HorzAlign=Left;
    SourceExpr="Global Dimension 2 Code" }
    { 1000000003;Label ;0 ;3384 ;3000 ;423 ;ParentControl=1000000001;
    VertAlign=Center;
    FontBold=Yes;
    MultiLine=Yes }
    { 1000000029;Label ;0 ;7191 ;7050 ;423 ;VertGlue=Top;
    HorzAlign=Left;
    VertAlign=Center;
    CaptionML=ENU=______________________________________________________________________________ }
    { 1000000030;TextBox;1500 ;6768 ;3450 ;423 ;HorzGlue=Left;
    VertGlue=Top;
    HorzAlign=Left;
    SourceExpr=CashName }
    { 1000000031;Label ;0 ;6768 ;1500 ;423 ;HorzGlue=Left;
    VertGlue=Top;
    ParentControl=1000000030;
    HorzAlign=Left;
    VertAlign=Center;
    FontSize=9;
    FontBold=Yes;
    MultiLine=Yes;
    CaptionML=ENU=Cashier : }
    { 1000000032;TextBox;3150 ;1692 ;4650 ;423 ;HorzAlign=Left;
    SourceExpr="External Document No." }
    { 1000000033;Label ;0 ;1692 ;3000 ;423 ;ParentControl=1000000032;
    HorzAlign=Left;
    VertAlign=Center;
    FontBold=Yes;
    MultiLine=Yes;
    CaptionML=ENU=Cheque No. }
    }
    }
    }
    }
    { PROPERTIES
    {
    DataItemIndent=1;
    DataItemTable=Table2000000026;
    DataItemTableView=SORTING(Number);
    NewPagePerGroup=No;
    NewPagePerRecord=Yes;
    DataItemVarName=CopyLoop;
    OnPreDataItem=BEGIN
    NoOfLoops := ABS(NoOfCopies) + Cust."Invoice Copies" + 1;
    IF NoOfLoops <= 0 THEN
    NoOfLoops := 1;
    CopyText := '';
    SETRANGE(Number,1,NoOfLoops);
    END;

    OnAfterGetRecord=BEGIN
    IF Number > 1 THEN
    // FOR I := 1 to 2 DO
    CopyText := Text003;
    CurrReport.PAGENO := 1;

    //Processreport.RUNMODAL(Rec)
    //FOR I := 1 to 2 DO
    //PrintReport.RUN(Rec):
    END;

    }
    SECTIONS
    {
    { PROPERTIES
    {
    SectionType=Body;
    SectionWidth=18150;
    SectionHeight=846;
    }
    CONTROLS
    {
    }
    }
    }
    }
    }
    REQUESTFORM
    {
    PROPERTIES
    {
    Width=9020;
    Height=3410;
    }
    CONTROLS
    {
    { 1000000000;Label ;0 ;0 ;3300 ;440 ;ParentControl=1000000003;
    CaptionML=ENU=Number of copies }
    { 1000000003;TextBox;3410 ;0 ;1650 ;440 ;CaptionML=ENU=No. of Copies;
    SourceExpr=NoOfCopies }
    }
    }
    CODE
    {
    VAR
    CustName@1000000000 : Text[100];
    Customer@1000000001 : Record 18;
    COMPINFO@1000000002 : Record 79;
    dimen@1000000003 : Record 349;
    DimenName@1000000004 : Text[50];
    DimenCode@1000000005 : Code[10];
    Cashier@1000000006 : Record 2000000002;
    CashName@1000000007 : Text[100];
    Amount@1000000008 : Text[30];
    GenJnlTemplate@1000000009 : Record 80;
    CustLedgEntry@1000000010 : Record 21;
    TempJnlBatchName@1000000011 : Code[10];
    I@1000000012 : Integer;
    Text003@1000000014 : TextConst 'ENU=COPY';
    GLSetup@1000000053 : Record 98;
    ShipmentMethod@1000000052 : Record 10;
    PaymentTerms@1000000051 : Record 3;
    SalesPurchPerson@1000000050 : Record 13;
    CompanyInfo@1000000049 : Record 79;
    Cust@1000000048 : Record 18;
    VATAmountLine@1000000047 : TEMPORARY Record 290;
    PostedDocDim1@1000000046 : Record 359;
    PostedDocDim2@1000000045 : Record 359;
    RespCenter@1000000044 : Record 5714;
    Language@1000000043 : Record 8;
    SalesInvCountPrinted@1000000042 : Codeunit 315;
    FormatAddr@1000000041 : Codeunit 365;
    SegManagement@1000000040 : Codeunit 5051;
    SalesShipmentBuffer@1000000039 : TEMPORARY Record 7190;
    PostedShipmentDate@1000000038 : Date;
    CustAddr@1000000037 : ARRAY [8] OF Text[50];
    ShipToAddr@1000000036 : ARRAY [8] OF Text[50];
    CompanyAddr@1000000035 : ARRAY [8] OF Text[50];
    OrderNoText@1000000034 : Text[30];
    SalesPersonText@1000000033 : Text[30];
    VATNoText@1000000032 : Text[30];
    ReferenceText@1000000031 : Text[30];
    TotalText@1000000030 : Text[50];
    TotalExclVATText@1000000029 : Text[50];
    TotalInclVATText@1000000028 : Text[50];
    MoreLines@1000000027 : Boolean;
    NoOfCopies@1000000026 : Integer;
    NoOfLoops@1000000025 : Integer;
    CopyText@1000000024 : Text[30];
    ShowShippingAddr@1000000023 : Boolean;
    NextEntryNo@1000000021 : Integer;
    FirstValueEntryNo@1000000020 : Integer;
    DimText@1000000019 : Text[120];
    OldDimText@1000000018 : Text[75];
    ShowInternalInfo@1000000017 : Boolean;
    Continue@1000000016 : Boolean;
    LogInteraction@1000000015 : Boolean;

    BEGIN
    END.
    }
    }

    can you please check what i am not doing correctly.
    thanks.
  • todrotodro Member Posts: 117
    kolaboy wrote:
    Hi Expert,
    Here is what i have tried so far, but it not working:

    can you please check what i am not doing correctly.
    thanks.
    You did not set the DataItemLinkReference between the COPYLOOP (parent) and your regular dataitem (child, indented)
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
  • kolaboykolaboy Member Posts: 446
    You did not set the DataItemLinkReference between the COPYLOOP (parent) and your regular dataitem (child, indented)

    I did not understand the above can u explain it step by step to my please.
    DataItemLinkReference = <Cust. ledger entry> This is what is there.

    Right now i am using requist form but the second copy is not picking up the Data. only heading is captured, the body is not.

    Any idea. please?
    Thanks
  • todrotodro Member Posts: 117
    kolaboy wrote:
    You did not set the DataItemLinkReference between the COPYLOOP (parent) and your regular dataitem (child, indented)

    I did not understand the above can u explain it step by step to my please.
    DataItemLinkReference = <Cust. ledger entry> This is what is there.

    Right now i am using requist form but the second copy is not picking up the Data. only heading is captured, the body is not.

    Any idea. please?
    Thanks
    repost the code but this time use CODE not QUOTE and make sure it keeps all spaces etc. The above can not be imported.
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
  • kolaboykolaboy Member Posts: 446
    Here is the Code;
    OBJECT Report 50000 Cust. Reciept
    {
      OBJECT-PROPERTIES
      {
        Date=29/08/07;
        Time=12:42:44;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        UseReqForm=Yes;
        UseSystemPrinter=Yes;
      }
      DATAITEMS
      {
        { PROPERTIES
          {
            DataItemTable=Table21;
            DataItemTableView=SORTING(Entry No.);
            NewPagePerRecord=Yes;
            OnAfterGetRecord=BEGIN
                               IF "Cust. Ledger Entry"."Amount (LCY)" < 0 THEN
                                 "Cust. Ledger Entry"."Amount (LCY)":="Cust. Ledger Entry"."Amount (LCY)" * -1;
    
                               IF Customer.GET("Cust. Ledger Entry"."Customer No.") THEN
                                 CustName := Customer.Name
                               ELSE
                                 CustName := '';
                               IF Cashier.GET("Cust. Ledger Entry"."User ID") THEN
                                  CashName := Cashier.Name
                               ELSE
                                  CashName := '';
                             END;
    
            ReqFilterFields=Document No.,Customer No.;
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=2538;
                OnPreSection=BEGIN
                               COMPINFO.GET;
                               COMPINFO.CALCFIELDS(Picture);
                             END;
    
              }
              CONTROLS
              {
                { 1000000002;TextBox;15000;0    ;3150 ;423  ;HorzAlign=Right;
                                                             SourceExpr=FORMAT(TODAY,0,4) }
                { 1000000004;TextBox;17700;423  ;450  ;423  ;CaptionML=ENU=Page;
                                                             SourceExpr=CurrReport.PAGENO }
                { 1000000005;Label  ;16950;423  ;750  ;423  ;ParentControl=1000000004 }
                { 1000000006;TextBox;15900;846  ;2250 ;423  ;HorzAlign=Right;
                                                             SourceExpr=USERID }
                { 1000000022;Label  ;0    ;1692 ;3150 ;423  ;FontSize=9;
                                                             FontBold=Yes;
                                                             FontUnderline=Yes;
                                                             CaptionML=ENU=Official Receipt }
                { 1000000034;Label  ;0    ;0    ;5400 ;1692 ;Border=No;
                                                             BorderStyle=Normal;
                                                             FontSize=12;
                                                             FontBold=Yes;
                                                             MultiLine=Yes;
                                                             CaptionML=ENU="SOCIAL SECURITY AND  HOUSING FINANCE CORPORATION " }
              }
               }
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18150;
                SectionHeight=8037;
              }
              CONTROLS
              {
                { 1000000008;TextBox;3150 ;0    ;4650 ;423  ;HorzAlign=Left;
                                                             SourceExpr="Document No." }
                { 1000000009;Label  ;0    ;0    ;3000 ;423  ;ParentControl=1000000008;
                                                             CaptionML=ENU=Receipt No. }
                { 1000000011;TextBox;3150 ;423  ;2700 ;423  ;HorzAlign=Left;
                                                             SourceExpr="Posting Date" }
                { 1000000012;Label  ;0    ;423  ;3000 ;423  ;ParentControl=1000000011;
                                                             CaptionML=ENU=Date }
                { 1000000014;TextBox;3150 ;846  ;3450 ;423  ;HorzAlign=Left;
                                                             SourceExpr="Customer No." }
                { 1000000015;Label  ;0    ;846  ;3000 ;423  ;ParentControl=1000000014 }
                { 1000000017;TextBox;3150 ;2115 ;3750 ;423  ;HorzAlign=Left;
                                                             SourceExpr=["Amount (LCY)" ] }
                { 1000000018;Label  ;0    ;2115 ;3000 ;423  ;ParentControl=1000000017;
                                                             CaptionML=ENU=Amount (GMD) }
                { 1000000023;TextBox;3150 ;2538 ;4950 ;423  ;HorzAlign=Left;
                                                             SourceExpr=Description }
                { 1000000024;Label  ;0    ;2538 ;3000 ;423  ;ParentControl=1000000023;
                                                             CaptionML=ENU=Desc }
                { 1000000026;TextBox;3150 ;2961 ;4950 ;423  ;HorzAlign=Left;
                                                             SourceExpr="Dimension Name" }
                { 1000000027;Label  ;0    ;2961 ;3000 ;423  ;ParentControl=1000000026;
                                                             CaptionML=ENU=FUND }
                { 1000000000;TextBox;3150 ;1269 ;4650 ;423  ;HorzAlign=Left;
                                                             SourceExpr=CustName }
                { 1000000007;Label  ;0    ;1269 ;3000 ;423  ;ParentControl=1000000000;
                                                             CaptionML=ENU=Customer Name }
                { 1000000010;TextBox;3150 ;3807 ;2700 ;423  ;HorzAlign=Left;
                                                             SourceExpr="Start Period Name" }
                { 1000000013;Label  ;0    ;3807 ;3000 ;423  ;ParentControl=1000000010;
                                                             CaptionML=ENU="Start Period " }
                { 1000000019;Label  ;0    ;5499 ;4650 ;423  ;HorzAlign=Left;
                                                             CaptionML=ENU=___________________________________ }
                { 1000000025;Label  ;0    ;5922 ;4650 ;423  ;HorzAlign=Left;
                                                             CaptionML=ENU=Cashier's Stamp & Signature: }
                { 1000000016;TextBox;3150 ;4230 ;2700 ;423  ;HorzAlign=Left;
                                                             SourceExpr="End Period Name" }
                { 1000000020;Label  ;0    ;4230 ;3000 ;423  ;ParentControl=1000000016;
                                                             VertAlign=Center;
                                                             FontBold=Yes;
                                                             MultiLine=Yes;
                                                             CaptionML=ENU=End Period }
                { 1000000001;TextBox;3150 ;3384 ;4950 ;423  ;HorzAlign=Left;
                                                             SourceExpr="Global Dimension 2 Code" }
                { 1000000003;Label  ;0    ;3384 ;3000 ;423  ;ParentControl=1000000001;
                                                             VertAlign=Center;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 1000000029;Label  ;0    ;7191 ;7050 ;423  ;VertGlue=Top;
                                                             HorzAlign=Left;
                                                             VertAlign=Center;
                                                             CaptionML=ENU=______________________________________________________________________________ }
                { 1000000030;TextBox;1500 ;6768 ;3450 ;423  ;HorzGlue=Left;
                                                             VertGlue=Top;
                                                             HorzAlign=Left;
                                                             SourceExpr=CashName }
                { 1000000031;Label  ;0    ;6768 ;1500 ;423  ;HorzGlue=Left;
                                                             VertGlue=Top;
                                                             ParentControl=1000000030;
                                                             HorzAlign=Left;
                                                             VertAlign=Center;
                                                             FontSize=9;
                                                             FontBold=Yes;
                                                             MultiLine=Yes;
                                                             CaptionML=ENU=Cashier : }
                { 1000000032;TextBox;3150 ;1692 ;4650 ;423  ;HorzAlign=Left;
                                                             SourceExpr="External Document No." }
                { 1000000033;Label  ;0    ;1692 ;3000 ;423  ;ParentControl=1000000032;
                                                             HorzAlign=Left;
                                                             VertAlign=Center;
                                                             FontBold=Yes;
                                                             MultiLine=Yes;
                                                             CaptionML=ENU=Cheque No. }
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemIndent=1;
            DataItemTable=Table2000000026;
            DataItemTableView=SORTING(Number);
            NewPagePerGroup=No;
            NewPagePerRecord=Yes;
            DataItemVarName=CopyLoop;
            OnPreDataItem=BEGIN
                            NoOfLoops := ABS(NoOfCopies) + 1;
                            IF NoOfLoops <= 0 THEN
                              NoOfLoops := 2;
                            CopyText := '';
                            SETRANGE(Number,2,NoOfLoops);
                          END;
    
            OnAfterGetRecord=BEGIN
                               IF Number > 1 THEN
                               //  FOR I := 1 to 2 DO
                                 CopyText := Text003;
                                CurrReport.PAGENO := 1;
    
                               //Processreport.RUNMODAL(Rec)
                               //FOR I := 1 to 2 DO
                               //PrintReport.RUN(Rec):
                             END;
    
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18150;
                SectionHeight=846;
              }
              CONTROLS
              {
              }
               }
          }
           }
      }
      REQUESTFORM
      {
        PROPERTIES
        {
          Width=9020;
          Height=3410;
        }
        CONTROLS
        {
          { 1000000000;Label  ;0    ;0    ;3300 ;440  ;ParentControl=1000000003;
                                                       CaptionML=ENU=Number of copies }
          { 1000000003;TextBox;3410 ;0    ;1650 ;440  ;CaptionML=ENU=No. of Copies;
                                                       SourceExpr=NoOfCopies }
          { 1000000001;CheckBox;3410;770  ;440  ;440  ;Name=LogInteraction;
                                                       ShowCaption=No;
                                                       CaptionML=ENU=Log Interaction;
                                                       SourceExpr=LogInteraction }
          { 1000000002;Label  ;0    ;770  ;3300 ;440  ;ParentControl=1000000001 }
        }
      }
      CODE
      {
        VAR
          CustName@1000000000 : Text[100];
          Customer@1000000001 : Record 18;
          COMPINFO@1000000002 : Record 79;
          dimen@1000000003 : Record 349;
          DimenName@1000000004 : Text[50];
          DimenCode@1000000005 : Code[10];
          Cashier@1000000006 : Record 2000000002;
          CashName@1000000007 : Text[100];
          Amount@1000000008 : Text[30];
          GenJnlTemplate@1000000009 : Record 80;
          CustLedgEntry@1000000010 : Record 21;
          TempJnlBatchName@1000000011 : Code[10];
          I@1000000012 : Integer;
          Text003@1000000014 : TextConst 'ENU=COPY';
          GLSetup@1000000053 : Record 98;
          ShipmentMethod@1000000052 : Record 10;
          PaymentTerms@1000000051 : Record 3;
          SalesPurchPerson@1000000050 : Record 13;
          CompanyInfo@1000000049 : Record 79;
          Cust@1000000048 : Record 18;
          VATAmountLine@1000000047 : TEMPORARY Record 290;
          PostedDocDim1@1000000046 : Record 359;
          PostedDocDim2@1000000045 : Record 359;
          RespCenter@1000000044 : Record 5714;
          Language@1000000043 : Record 8;
          SalesInvCountPrinted@1000000042 : Codeunit 315;
          FormatAddr@1000000041 : Codeunit 365;
          SegManagement@1000000040 : Codeunit 5051;
          SalesShipmentBuffer@1000000039 : TEMPORARY Record 7190;
          PostedShipmentDate@1000000038 : Date;
          CustAddr@1000000037 : ARRAY [8] OF Text[50];
          ShipToAddr@1000000036 : ARRAY [8] OF Text[50];
          CompanyAddr@1000000035 : ARRAY [8] OF Text[50];
          OrderNoText@1000000034 : Text[30];
          SalesPersonText@1000000033 : Text[30];
          VATNoText@1000000032 : Text[30];
          ReferenceText@1000000031 : Text[30];
          TotalText@1000000030 : Text[50];
          TotalExclVATText@1000000029 : Text[50];
          TotalInclVATText@1000000028 : Text[50];
          MoreLines@1000000027 : Boolean;
          NoOfCopies@1000000026 : Integer;
          NoOfLoops@1000000025 : Integer;
          CopyText@1000000024 : Text[30];
          ShowShippingAddr@1000000023 : Boolean;
          NextEntryNo@1000000021 : Integer;
          FirstValueEntryNo@1000000020 : Integer;
          DimText@1000000019 : Text[120];
          OldDimText@1000000018 : Text[75];
          ShowInternalInfo@1000000017 : Boolean;
          Continue@1000000016 : Boolean;
          LogInteraction@1000000015 : Boolean;
    
        PROCEDURE InitLogInteraction@1000000000();
        BEGIN
        END;
    
        BEGIN
        END.
      }
    }
    
    

    I am still trying but no Solution yet.
    If i specify two copies, the second copy is always Blank.
    Any Idea Please?
    Thanks
  • todrotodro Member Posts: 117
    kolaboy wrote:
    Here is the Code;

    I am still trying but no Solution yet.
    If i specify two copies, the second copy is always Blank.
    Any Idea Please?
    Thanks
    You have the wrong order, COPYLOOP has to be the outer loop

    COPYLOOP
    --Cust. Ledger Entry

    Everything which has to be printed repeatedly has to be inside the COPYLOOP, that's the reason why there is also a PAGELOOP for the header information in report 206.
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
  • themavethemave Member Posts: 1,058
    you don't need coding to do this, create a second report that is a copy of the first, then on the setup reports selection for the invoice, put the second report on the list.

    example would be

    in 4.0 menu

    administration --> application setup --> sales & marketing --> report selection

    for your report set sequence 1 as the first receipt, and sequence 2 as the second report

    each will print, and since they are separate reports it should do what you want,

    if your receipt is not triggered from this, you can copy the functionality to do it.

    this is what we do for our credit card reciepts, the first report is the customer copy, and the second is our copy. we modify the second to say file copy.
  • todrotodro Member Posts: 117
    themave wrote:
    you don't need coding to do this, create a second report that is a copy of the first, then on the setup reports selection for the invoice, put the second report on the list.

    example would be

    in 4.0 menu

    administration --> application setup --> sales & marketing --> report selection

    for your report set sequence 1 as the first receipt, and sequence 2 as the second report

    each will print, and since they are separate reports it should do what you want,

    if your receipt is not triggered from this, you can copy the functionality to do it.

    this is what we do for our credit card reciepts, the first report is the customer copy, and the second is our copy. we modify the second to say file copy.
    Still, they are not linked together regarding filters etc. and the request form pops up a second time. The report selection is nice to chain but also means either double user interaction or additional programming to take the filters from the first report (which is already finished once the second is started)

    This is why I like to point people to what they already have: the existing Navision objects provide lots of interesting features and it makes live easier to stay with the standard, at least as near as possible.

    Just my $0.02. :)
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
  • kolaboykolaboy Member Posts: 446
    Todro,
    Thanks for that reply. It is now getting the two copies when i specify 2 in the request form.
    Can it be specify in the code so that whenever one click on Post and Print, it prints the two copies authomatically without using the request form to specify the no. of copies?

    I don't want to inconvient somebody by using the request form where there are long queues
    please any idea.
    Thanks.
  • todrotodro Member Posts: 117
    kolaboy wrote:
    Todro,
    Thanks for that reply. It is now getting the two copies when i specify 2 in the request form.
    Can it be specify in the code so that whenever one click on Post and Print, it prints the two copies authomatically without using the request form to specify the no. of copies?

    I don't want to inconvient somebody by using the request form where there are long queues
    please any idea.
    Thanks.
    depending on how the report is run, you can specify not to show the request form:

    From the C/SIDE help:
    REPORT.RUN(Number [, ReqWindow] [, SystemPrinter] [, Record])
    REPORT.RUNMODAL(Number [, ReqWindow] [, SystemPrinter] [, Record])

    ReqWindow

    Data type: boolean

    Tells the system whether it should display the request window for the report. The request window is part of the report object.

    If you have a look at codeunit 82 (will be called e.g. when hitting Post+Print in SalesOrder) you will see, that it is already implemented this way in function PrintReport:
    PrintReport(ReportUsage : Integer)
    ReportSelection.RESET;
    ReportSelection.SETRANGE(Usage,ReportUsage);
    ReportSelection.FIND('-');
    REPEAT
      ReportSelection.TESTFIELD("Report ID");
      CASE ReportUsage OF
        ReportSelection.Usage::"SM.Invoice":
          REPORT.RUN(ReportSelection."Report ID",FALSE,FALSE,SalesInvHeader);
        ReportSelection.Usage::"SM.Credit Memo":
          REPORT.RUN(ReportSelection."Report ID",FALSE,FALSE,SalesCrMemoHeader);
        ReportSelection.Usage::"S.Invoice":
          REPORT.RUN(ReportSelection."Report ID",FALSE,FALSE,SalesInvHeader);
        ReportSelection.Usage::"S.Cr.Memo":
          REPORT.RUN(ReportSelection."Report ID",FALSE,FALSE,SalesCrMemoHeader);
        ReportSelection.Usage::"S.Shipment":
          REPORT.RUN(ReportSelection."Report ID",FALSE,FALSE,SalesShptHeader);
        ReportSelection.Usage::"S.Ret.Rcpt.":
          REPORT.RUN(ReportSelection."Report ID",FALSE,FALSE,ReturnRcptHeader);
      END;
    UNTIL ReportSelection.NEXT = 0;
    
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
Sign In or Register to comment.