Tuesday, July 23, 2019

Print Sales Invoice

static void PrintSalesInvoice(Args _args)
{
    Args          salesArgs = new Args();
    SalesInvoiceContract  salesInvoiceContract;
   SalesInvoiceController controller;
   SrsReportRunImpl    srsReportRunImpl;
   str fileName;
   CustInvoiceJour     custInvoiceJour = _args.record();
 //  select custInvoiceJour where custInvoiceJour.InvoiceId=="GH-INV-000107";


   salesArgs.record(custInvoiceJour);
   controller       = new SrsReportRunController();
   salesInvoiceContract  = new SalesInvoiceContract();
   controller.parmReportName(ssrsReportStr(SalesInvoice,ReportGH));
   controller.parmShowDialog(true);
   controller.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::Printer);
   // controller.parmReportContract().parmPrintSettings().printerName(@"\\espprn03\Follow Me - MFP");
   salesInvoiceContract.parmRecordId(custInvoiceJour.RecId); // Record id must be passed otherwise the report will be empty
   salesInvoiceContract.parmCountryRegionISOCode(SysCountryRegionCode::countryInfo()); // comment this code if tested in pre release
   controller.parmReportContract().parmRdpContract(salesInvoiceContract);
   controller.startOperation();

}

No comments:

Post a Comment