Announcements
Hello,
I am trying to run a AX report and save it to a local drive, then attach it and send an email to customer and finally delete the file.
I tried the below code but could not save it to local folder, instead it opens up on screen
Args args = new Args(); PrintJobSettings pjs = new PrintJobSettings(); SysReportRun reportRun; filename mFile; ; mFile = @"G:\Testing\test.pdf"; winapi::deleteFile(mFile); pjs.fileName(mFile); pjs.format(PrintFormat::PDF); pjs.setTarget(PrintMedium::File); pjs.preferredFileFormat(PrintFormat::PDF); args.name(reportstr(XXXX)); args.record(gCerts); reportRun = classFactory.reportRunClass(args); reportRun.printJobSettings(pjs.packPrintJobSettings()); reportRun.query().interactive(false); reportRun.report().interactive(false); reportRun.init(); reportRun.run();
This one is a custom report I want to email automatically on sales order invoice posting
Doesn't the report use print management?
André Arnaud de Cal...
294,127
Super User 2025 Season 1
Martin Dráb
232,871
Most Valuable Professional
nmaenpaa
101,158
Moderator