|

Print Sales Invoice Report in PDF / HTML / RTF / ASCII etc., format through code

I have observed that lot of developers face difficulty in printing the Sales Invoice report into file system through code. Here is the code snippet for it. SalesFormLetter salesFormLetter; PrintJobSettings printJobSettings; CustInvoiceJour custInvoiceJour; SalesId salesId; #File salesid = “SO-100010”; salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice,false); printJobSettings = new PrintJobSettings(); printJobSettings.setTarget(PrintMedium::File); printJobSettings.format(PrintFormat); printJobSettings.fileName( ‘//10.0.57.22/AOSPrintShare//’ + salesId+#pdf ); printJobSettings.warnIfFileExists(false); SalesFormLetter.updatePrinterSettingsFormLetter(printJobSettings.packPrintJobSettings());…