reportBuilder: {@TppPrinterSetup.Duplex This property indicates what type of two-sided printing should occur. Not all printers support duplex printing. Value Meaning --------------------------- dpNone Duplex printing is disabled. dpHorizontal Duplex printing should be performed across the page, from left to right, so the text will read as in a book dpVertical Duplex printing should be performed down the page, from top to bottom, so the text will read as in tablet //0 1 2 TppDuplexType = (dpNone, dpHorizontal, dpVertical);//對應到windows定義的常量時,會先加1windows的定義 {$EXTERNALSYM DMDUP_SIMPLEX} DMDUP_SIMPLEX = 1; {$EXTERNALSYM DMDUP_VERTICAL} DMDUP_VERTICAL = 2; {$EXTERNALSYM DMDUP_HORIZONTAL} DMDUP_HORIZONTAL = 3;再看quickReport,當duplex為True,給的是默認值 if FDuplex then begin SetField(dm_duplex); DevMode^.dmDuplex := dmdup_horizontal;//dmdup_horizontal對應DMDUP_HORIZONTAL end;dmdup_horizontal對應DMDUP_HORIZONTAL ,依據reportBuilder解釋:Duplex printing should be performed down the page, from top to bottom, so the text will read as in tablet。 而設置為DMDUP_VERTICAL,則:Duplex printing should be performed across the page, from left to right, so the text will read as in a book 類似于書本的雙面打印效果所以,改法是在 if FDuplex then begin SetField(dm_duplex); DevMode^.dmDuplex := DMDUP_VERTICAL; end;改後,要重新編譯對應的DPK,并把編譯後的bpl放到 system32路徑下
all printers support duplex printing.
Value Meaning
---------------------------
dpNone Duplex printing is disabled.
dpHorizontal Duplex printing should be performed across the page,
from left to right, so the text will read as in a book
dpVertical Duplex printing should be performed down the page, from
top to bottom, so the text will read as in tablet
//0 1 2
TppDuplexType = (dpNone, dpHorizontal, dpVertical);//對應到windows定義的常量時,會先加1windows的定義 {$EXTERNALSYM DMDUP_SIMPLEX}
DMDUP_SIMPLEX = 1;
{$EXTERNALSYM DMDUP_VERTICAL}
DMDUP_VERTICAL = 2;
{$EXTERNALSYM DMDUP_HORIZONTAL}
DMDUP_HORIZONTAL = 3;再看quickReport,當duplex為True,給的是默認值 if FDuplex then
begin
SetField(dm_duplex);
DevMode^.dmDuplex := dmdup_horizontal;//dmdup_horizontal對應DMDUP_HORIZONTAL
end;dmdup_horizontal對應DMDUP_HORIZONTAL ,依據reportBuilder解釋:Duplex printing should be performed down the page, from top to bottom, so the text will read as in tablet。
而設置為DMDUP_VERTICAL,則:Duplex printing should be performed across the page,
from left to right, so the text will read as in a book
類似于書本的雙面打印效果所以,改法是在 if FDuplex then
begin
SetField(dm_duplex);
DevMode^.dmDuplex := DMDUP_VERTICAL;
end;改後,要重新編譯對應的DPK,并把編譯後的bpl放到 system32路徑下
若有源碼,建議用delphi ID搜索 quickReport路徑 ,內容——DevMode^.dmDuplex
QuickReport 3.6.2版本默认DevMode^.dmDuplex := dmdup_horizontal,不用做任何修改。编译后的bpl放到system32路径下,quickrpt文件夹编译生成的dcu文件全部拷到lib文件夹内,可设断点查看Printer.Duplex是否根据打印机单双面设置而变化。感谢楼上的各位。