我想用
代码控制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时无法实现双打,不知道哪里有问题,请高手指点一下,谢谢
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时无法实现双打,不知道哪里有问题,请高手指点一下,谢谢