Sometimes, we need Morthx X++ code to run batch reports to PDF Printer,
so I wrote the following code as a backup for future work
// rr.printJobSettings().mailCc("Jimmyx@xxxxxx.com.cn");
// rr.printJobSettings().allPages(false);
// rr.printJobSettings().from(2);
// rr.printJobSettings().to(4);
rr.query().interactive(false);
rr.report().interactive(false);
rr.run();
}
catch
{
throw Error("Run Report Error!");
}
if(WINAPI::fileExists(FilePath))
WINAPI::shellExecute(FilePath);
info("Finished!");
}