web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

X++ code to print sales invoice on printer directly

SANTOSH KUMAR SINGH Profile Picture SANTOSH KUMAR SINGH 1,224
Below is the X++ code to print sales invoice on printer directly.

  Args          salesArgs = new Args();  
SalesInvoiceContract salesInvoiceContract;
SalesInvoiceController controller;
SrsReportRunImpl srsReportRunImpl;
str fileName;
CustInvoiceJour custInvoiceJour;// = _args.record();
select custInvoiceJour where custInvoiceJour.InvoiceId=="INV_00000009";
salesArgs.record(custInvoiceJour);
controller = new SrsReportRunController();
salesInvoiceContract = new SalesInvoiceContract();
controller.parmReportName(ssrsReportStr(SalesInvoice,Report));
controller.parmShowDialog(false);
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();


This was originally posted here.

Comments

*This post is locked for comments