我試圖自動將打印清單直接打印到打印機。它已被選中。這是一個打印它的作業,但它一直持續到屏幕而不是打印機。將打印清單重新打印到打印機,而不是通過X ++屏幕
static void JobReprintPickingList(Args _args)
{
Args args;
ReportRun reportRun;
SalesFormLetter salesFormLetter;
PrintJobSettings printJobSettings;
RecordSortedList list = new RecordSortedList(tablenum(WMSPickingRoute));
WMSPickingRoute wmsPickingRoute = WMSPickingRoute::find('PkR 079256');
;
if(!wmsPickingRoute)
return;
list.ins(wmsPickingRoute);
args = new Args(ReportStr(WMSPickingList_OrderPick));
args.designName("Standard");
printJobSettings = new PrintJobSettings();
printJobSettings.deviceName('HP Universal Printing PCL 6');
printJobSettings.setTarget(PrintMedium::Printer);
printJobSettings.preferredTarget(PrintMedium::Printer);
salesFormLetter = new SalesFormLetter_PickingList(false);
salesFormLetter.updatePrinterSettingsFormLetter(printJobSettings.packPrintJobSettings());
args.caller(salesFormletter);
args.parmEnum(PrintCopyOriginal::Original);
args.parmEnumType(enumnum(PrintCopyOriginal));
args.object(list);
reportRun = new ReportRun(args);
reportRun.init();
reportRun.run();
}
這解決了我的問題,當時正在將打印代碼作爲批處理運行,因此無法將其顯示到屏幕上,這是它失敗的原因。 謝謝 – Michael