我想關於這一點我已在Microsoft Dynamics AX 2009中銷售訂單詳細信息窗體上按鈕的點擊事件增加了一個按鈕,點擊打印銷售確認報告,我已經寫了下面的代碼:打印報告2009年通過X ++
void clicked()
{
Args args;
ReportRun reportRun;
SalesFormLetter salesFormLetter;
PrintJobSettings printJobSettings;
CustConfirmJour custConfirmJour;
RecordSortedList list = new RecordSortedList(55);
SalesTable salesTableUpdate;
;
SELECT firstonly custConfirmJour order by ConfirmID desc where custConfirmJour.SalesId == salesTable.SalesId ;
list.ins(custConfirmJour);
args = new Args(ReportStr(SalesConfirm));
printJobSettings = new PrintJobSettings();
printJobSettings.SetTarget(PrintMedium::Printer);
printJobSettings.suppressScalingMessage(true);
salesFormLetter = new SalesFormLetter_Confirm(true);
salesFormLetter.updatePrinterSettingsFormLetter(printJobSettings.packPrintJobSettings());
args.designName("Standard");
args.caller(salesFormletter);
args.parmEnum(PrintCopyOriginal::Original);
args.parmEnumType(enumnum(PrintCopyOriginal));
args.object(list);
reportRun = new ReportRun(args);
reportRun.setTarget(PrintMedium::Printer);
reportRun.init();
reportRun.run();
}
代碼運行良好,除了上,而不是直接對打印機發送報告,打印預覽即將到來的問題。
我會很greateful如果你們誰可以讓我知道什麼是錯的這個代碼。
RGDS
哈龍