Hi, I am looking to save file using X++ code in PDF format but do not wants to use any ssrs object. I am trying to sue the code but its only generetign file on screen but not saving it ,,while the same cod eis working in AX 2009.
PrintJobSettings printJobSettings = new PrintJobSettings();
Args args = new Args();
boolean prompt = false;
boolean printIt = true;
;
printJobSettings.setTarget(PrintMedium::File);
printJobSettings.format(PrintFormat::PDF);
printJobSettings.fileName(@'c:\AxFiles\myfile2.pdf');
salesFormLetter.updatePrinterSettingsFormLetter(printJobSettings.packPrintJobSettings());
select firstOnly custInvoiceJour
where custInvoiceJour.salesid == 'I000225430';
args.record(custInvoiceJour);
args.caller(salesFormLetter);
new MenuFunction(menuitemoutputstr(IOCLA4SalesInvoice), MenuItemType::Output).run(args);
}