Hi Guys,
Just wondering if any of you can help me please. I have got a report (supplier remittance) in Dynamics AX 2009. It is a MorphX report, which I would like to send to AOS printer. I am trying the following code in init method but everything is ending up in smoke. Any idea what I am doing wrong here
element.unpackPrintJobSettings(vendOutPaym.getPrinterSettings(PaymDocumentType::PaymAdvice));
if(this.args() && (this.args().parm() == "sendEmail" || this.args().parm() == "PrintReport")) { itr = new ListIterator(outPaymRecordlist); while(itr.more()) { vendOutPaymRecord = itr.value(); ledgerJournalTrans = vendOutPaymRecord.parmCustVendPaym().ledgerJournalTrans(); itr.next(); } element.suppressReportIsEmptyMessage(true); pjs = element.printJobSettings(); pjs.setTarget(PrintMedium::Printer); pjs.preferredTarget(PrintMedium::Printer);
if (this.args().parm() == "sendEmail") { pjs.deviceName('AOS: AX Email'); // Calling the AOS printer which AOS: prefix //pjs.deviceName('\\\\'+CurrentAOS+'\\AX Email'); } else { pjs.deviceName('AOS: AX Print Bureau'); // pjs.deviceName('\\\\'+CurrentAOS+'\\AX Print Bureau'); } pjs.outputToPrnFile(true); pjs.warnIfFileExists(false); pjs.suppressScalingMessage(true);
If I call the AOS Printer as a local printer I-e pjs.deviceName('\\\\'+CurrentAOS+'\\AX Email'); it works fine but the issue with this is that AOS printer needs to be install as a local printer which is applicable as more then 20 people has to use this functionality .
Please note: we have got a print management integration which I am bypassing by overriding init method of report. We want to use print job settings of the report regardless what has been defined at top level.
I will appreciate your help in due course.
Thanking you in anticipation,