直接打印报表
在ax中有时可能需要在打印时,不显示报表的预览与设置窗口,而是直接Send到打印机。可以使用ClassFactory、PrintJobSettings、ReportRun来完成。
static void NJ_MF_DirectPrint(Args _args)
{
Args args = new Args();
ReportRun reportRun;
PrintJobSettings printJobSettings = new PrintJobSettings();
;
args.name(reportstr("NJ_QTReportM8"));
reportRun = ClassFactory.reportRunClass(args);
printJobSettings.setTarget(PrintMedium::Printer);
printJobSettings.deviceName("HP Laserjet 2120");
reportRun.report().interactive(false);
reportRun.query().interactive(false);
reportRun.printJobSettings(printJobSettings.packPrintJobSettings());
reportRun.run();
}