我想用 代碼控制RM 報表的雙面 列印,現在的問題是報表頁的duplex 屬性值設為rmdpNone時,通過 設定列印機的雙面列印屬性打出來還是單面,如果直接設定報表頁的duplex屬性為rmdpHorizontal就可以實作雙打,但是我不想在報表中設定,而是在代碼中實作,不知道可有 辦法,請高手指教,十分感謝,我的代碼大概如下:
Printer.GetPrinter(ADevice,ADriver,APort,DeviceHandle);
if DeviceHandle<>0 then
DevMode := GlobalLock(DeviceHandle);
//DevMode^.dmFields := DevMode^.dmFields or DM_DUPLEX;
//DevMode^.dmDuplex := DMDUP_HORIZONTAL;
for J := 0 to dmRMprint.RMGrid Report.Pages.Count-1 do
begin
case DevMode^.dmDuplex of
DMDUP_SIMPLEX: (dmRMprint.RMGridReport.Pages[J] as TRMGridReportPage).Duplex := rmdpNone;
DMDUP_HORIZONTAL: (dmRMprint.RMGridReport.Pages[J] as TRMGridReportPage).Duplex := rmdpHorizontal;
DMDUP_VERTICAL: (dmRMprint.RMGridReport.Pages[J] as TRMGridReportPage).Duplex := rmdpVertical;
end;
end;
這段代碼在報表頁的duplex屬性值設為rmdpNone時無法實作雙打,不知道哪裡有問題,請高手指點一下,謝謝