Attachment of Report

niimodinniimodin Member Posts: 142
Hello Experts,
I have a "General condition of Sales" report which I want to be printed when the Sales Order confirmation is printed.

I have created this report and added to the order confirmation in the Report Selection.
My problem is anytime the the order confirmation has finished printing another request for appears.

I have changed the "UseReqForm" property of this report to No and the request still appear.

Come someone help me out?

Thanks

Comments

  • MandASoftMandASoft Member Posts: 8
    niimodin wrote:
    Hello Experts,
    I have a "General condition of Sales" report which I want to be printed when the Sales Order confirmation is printed.

    I have created this report and added to the order confirmation in the Report Selection.
    My problem is anytime the the order confirmation has finished printing another request for appears.

    I have changed the "UseReqForm" property of this report to No and the request still appear.

    Come someone help me out?

    Thanks
    Have you try MyReport.USEREQUESTFORM(false)?
    There are always a way
    http://www.mandasoft.eu
  • niimodinniimodin Member Posts: 142
    Thank you very much.

    But the Print Dialog box still appears.

    What should I do?
  • SavatageSavatage Member Posts: 7,142
    Have you tried just adding RUN or RUNMODAL command at the end of the confirmation report - to execute the other report?

    See c/side reference guide for details;

    For another Example you can define it in a CU - Like CU82 for example, When you Post & print it will also print a Sales Shipment Report automatically (see below)
    CASE "Document Type" OF
        "Document Type"::Order:
          BEGIN
            IF Ship THEN BEGIN
              SalesShptHeader."No." := "Last Shipping No.";
              SalesShptHeader.SETRECFILTER;
              PrintReport(ReportSelection.Usage::"S.Shipment");
            END;
            IF Invoice THEN BEGIN
              SalesInvHeader."No." := "Last Posting No.";
              SalesInvHeader.SETRECFILTER;
              PrintReport(ReportSelection.Usage::"S.Invoice");
            END;
          END;
    
    Here they use Report.Run - to just run the report
    PrintReport(ReportUsage : Integer)
    ReportSelection.RESET;
    ReportSelection.SETRANGE(Usage,ReportUsage);
    ReportSelection.FIND('-');
    REPEAT
      ReportSelection.TESTFIELD("Report ID");
      CASE ReportUsage OF
        ReportSelection.Usage::"S.Invoice":
          REPORT.RUN(ReportSelection."Report ID",FALSE,FALSE,SalesInvHeader);
         ReportSelection.Usage::"S.Shipment":
          REPORT.RUN(ReportSelection."Report ID",FALSE,FALSE,SalesShptHeader);
        END;
    UNTIL ReportSelection.NEXT = 0;
    
Sign In or Register to comment.