社区
Delphi
帖子详情
请问用printersetupdialog能设置纸张大小,横向纵向打印吗?
ych121
2002-06-21 11:11:15
我想用printersetupdialog来设置需打印的报表的纸张大小等,而且希望在预鉴览中看到.
...全文
385
6
打赏
收藏
请问用printersetupdialog能设置纸张大小,横向纵向打印吗?
我想用printersetupdialog来设置需打印的报表的纸张大小等,而且希望在预鉴览中看到.
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
ych121
2002-06-24
打赏
举报
回复
非常感谢superljj的帮助问题已解决。
ych121
2002-06-21
打赏
举报
回复
请试了一下superljj的文法,但它报错:
[Error] hmreport.pas(136): Undeclared identifier: 'GetPrintIndex'
[Error] hmreport.pas(136): Undeclared identifier: 'Printer'
[Error] hmreport.pas(141): Undeclared identifier: 'GetPrinter'
[Error] hmreport.pas(146): Undeclared identifier: 'Letter'
[Error] hmreport.pas(147): Undeclared identifier: 'LetterSmall'
[Error] hmreport.pas(148): Undeclared identifier: 'Tabloid'
[Error] hmreport.pas(149): Undeclared identifier: 'Ledger'
[Error] hmreport.pas(150): Undeclared identifier: 'Legal'
[Error] hmreport.pas(151): Undeclared identifier: 'Statement'
[Error] hmreport.pas(152): Undeclared identifier: 'Executive'
[Error] hmreport.pas(153): Undeclared identifier: 'A3'
[Error] hmreport.pas(154): Undeclared identifier: 'A4'
[Error] hmreport.pas(155): Undeclared identifier: 'A4Small'
[Error] hmreport.pas(156): Undeclared identifier: 'A5'
[Error] hmreport.pas(157): Undeclared identifier: 'B4'
[Error] hmreport.pas(158): Undeclared identifier: 'B5'
[Error] hmreport.pas(159): Undeclared identifier: 'Folio'
[Error] hmreport.pas(160): Undeclared identifier: 'Quarto'
[Error] hmreport.pas(161): Undeclared identifier: 'qr10X14'
[Error] hmreport.pas(162): Undeclared identifier: 'qr11X17'
[Error] hmreport.pas(163): Undeclared identifier: 'Note'
[Error] hmreport.pas(164): Undeclared identifier: 'Env9'
[Error] hmreport.pas(165): Undeclared identifier: 'Env10'
[Error] hmreport.pas(166): Undeclared identifier: 'Env11'
[Error] hmreport.pas(167): Undeclared identifier: 'Env12'
[Error] hmreport.pas(168): Undeclared identifier: 'Env14'
[Error] hmreport.pas(191): Statement expected but 'PROCEDURE' found
[Fatal Error] yusuan.dpr(69): Could not compile used unit 'hmreport.pas'
superljj
2002-06-21
打赏
举报
回复
如果非要用printersetupdialog, 调用如下函数
不要忘了加分和FAQ.
Function MainPrintSet(MainQuickrep:TQuickrep):Boolean;
Var
Device, Driver, Port: array[0..255] of char;
ADevMode: THandle ;
DevMode: PDeviceMode;
Begin
Try
Result:=True;
MainQuickrep.Units := Pixels;
If GetPrintIndex<>Printer.PrinterIndex Then
DefaultPrinterFlag:=True;
MainQuickrep.PrinterSettings.PrinterIndex := printer.PrinterIndex;
MainQuickrep.Page.Orientation := printer.Orientation;
with Printer do
GetPrinter(Device, Driver, Port, ADevMode);
if ADevMode<>0 then
Begin
DevMode := GlobalLock(ADevMode);
Case DevMode^.dmPaperSize of
DMPAPER_LETTER: MainQuickrep.Page.PaperSize :=Letter;
DMPAPER_LETTERSMALL: MainQuickrep.Page.PaperSize :=LetterSmall;
DMPAPER_TABLOID: MainQuickrep.Page.PaperSize :=Tabloid;
DMPAPER_lEDGER: MainQuickrep.Page.PaperSize :=Ledger;
DMPAPER_lEGAL: MainQuickrep.Page.PaperSize :=Legal;
DMPAPER_STATEMENT: MainQuickrep.Page.PaperSize :=Statement;
DMPAPER_EXECUTIVE: MainQuickrep.Page.PaperSize :=Executive;
DMPAPER_A3: MainQuickrep.Page.PaperSize :=A3;
DMPAPER_A4: MainQuickrep.Page.PaperSize :=A4;
DMPAPER_A4SMALL: MainQuickrep.Page.PaperSize :=A4Small;
DMPAPER_A5: MainQuickrep.Page.PaperSize :=A5;
DMPAPER_B4: MainQuickrep.Page.PaperSize :=B4;
DMPAPER_B5: MainQuickrep.Page.PaperSize :=B5;
DMPAPER_FOLIO: MainQuickrep.Page.PaperSize :=Folio;
DMPAPER_QUARTO: MainQuickrep.Page.PaperSize :=Quarto;
DMPAPER_10X14: MainQuickrep.Page.PaperSize :=qr10X14;
DMPAPER_11X17: MainQuickrep.Page.PaperSize :=qr11X17;
DMPAPER_NOTE: MainQuickrep.Page.PaperSize :=Note;
DMPAPER_ENV_9: MainQuickrep.Page.PaperSize :=Env9;
DMPAPER_ENV_10: MainQuickrep.Page.PaperSize :=Env10;
DMPAPER_ENV_11: MainQuickrep.Page.PaperSize :=Env11;
DMPAPER_ENV_12: MainQuickrep.Page.PaperSize :=Env12;
DMPAPER_ENV_14: MainQuickrep.Page.PaperSize :=Env14;
else
Begin
GlobalUnlock(ADevMode);
Result:=false;
Exit;
//MainQuickrep.Page.PaperSize :=Letter;
//DevMode^.dmFields := DevMode^.dmFields or DM_PaperSize;
//DevMode^.dmPaperSize := DMPAPER_LETTER;
End;
End;
GlobalUnlock(ADevMode);
End;
Except
On E:Exception do
Begin
Result:=false;
Exit;
end;
end;
superljj
2002-06-21
打赏
举报
回复
printersetupdialog能设置纸张大小,横向纵向打印.
printersetupdialog并不能改变Quickrep1的设置.
用QuickRep1.PrinterSetup;
superljj
2002-06-21
打赏
举报
回复
Function MainPrintSet(MainQuickrep:TQuickrep):Boolean;
Var
Device, Driver, Port: array[0..255] of char;
ADevMode: THandle ;
DevMode: PDeviceMode;
Begin
Try
Result:=True;
MainQuickrep.Units := Pixels;
MainQuickrep.PrinterSettings.PrinterIndex := printer.PrinterIndex;
MainQuickrep.Page.Orientation := printer.Orientation;
with Printer do
GetPrinter(Device, Driver, Port, ADevMode);
if ADevMode<>0 then
Begin
DevMode := GlobalLock(ADevMode);
Case DevMode^.dmPaperSize of
DMPAPER_LETTER: MainQuickrep.Page.PaperSize :=Letter;
DMPAPER_LETTERSMALL: MainQuickrep.Page.PaperSize :=LetterSmall;
DMPAPER_TABLOID: MainQuickrep.Page.PaperSize :=Tabloid;
DMPAPER_lEDGER: MainQuickrep.Page.PaperSize :=Ledger;
DMPAPER_lEGAL: MainQuickrep.Page.PaperSize :=Legal;
DMPAPER_STATEMENT: MainQuickrep.Page.PaperSize :=Statement;
DMPAPER_EXECUTIVE: MainQuickrep.Page.PaperSize :=Executive;
DMPAPER_A3: MainQuickrep.Page.PaperSize :=A3;
DMPAPER_A4: MainQuickrep.Page.PaperSize :=A4;
DMPAPER_A4SMALL: MainQuickrep.Page.PaperSize :=A4Small;
DMPAPER_A5: MainQuickrep.Page.PaperSize :=A5;
DMPAPER_B4: MainQuickrep.Page.PaperSize :=B4;
DMPAPER_B5: MainQuickrep.Page.PaperSize :=B5;
DMPAPER_FOLIO: MainQuickrep.Page.PaperSize :=Folio;
DMPAPER_QUARTO: MainQuickrep.Page.PaperSize :=Quarto;
DMPAPER_10X14: MainQuickrep.Page.PaperSize :=qr10X14;
DMPAPER_11X17: MainQuickrep.Page.PaperSize :=qr11X17;
DMPAPER_NOTE: MainQuickrep.Page.PaperSize :=Note;
DMPAPER_ENV_9: MainQuickrep.Page.PaperSize :=Env9;
DMPAPER_ENV_10: MainQuickrep.Page.PaperSize :=Env10;
DMPAPER_ENV_11: MainQuickrep.Page.PaperSize :=Env11;
DMPAPER_ENV_12: MainQuickrep.Page.PaperSize :=Env12;
DMPAPER_ENV_14: MainQuickrep.Page.PaperSize :=Env14;
else
Begin
GlobalUnlock(ADevMode);
Result:=false;
Exit;
//MainQuickrep.Page.PaperSize :=Letter;
//DevMode^.dmFields := DevMode^.dmFields or DM_PaperSize;
//DevMode^.dmPaperSize := DMPAPER_LETTER;
End;
End;
GlobalUnlock(ADevMode);
End;
Except
On E:Exception do
Begin
Result:=false;
Exit;
end;
end;
end;
superljj
2002-06-21
打赏
举报
回复
uses QRPrntr;
C#
打印
操作实例--
设置
横向
或
纵向
打印
实例--完整版)
C#
打印
操作实例--
设置
横向
或
纵向
打印
实例--完整版) )
vb自定义
打印
纸张
大小
的实例源码
这是一款在WIN2000或XP下支持自宝义
打印
纸张
大小
的实例程序源码,可以
横向
或
纵向
打印
,运行截图可以看上图。
Android GridView完美
横向
滑动 ,并且可限制Gridview显示行数!
Android GridView完美
横向
滑动 ,并且可限制Gridview显示行数!
通用工资管理系统
(3)报表
打印
采用8开
纸张
横向
打印
或132列宽行
打印
纸。 本系统的所有功能均通过菜单进入,菜单时系统操作的最基本、最重要工 具 新建 打开 在职 退休 离休 统计 生成 上报 月库 系统 系统 退出 月库 月库 ...
实际
打印
纸张
的
横向
设置
不起作用的问题
在实际项目中,
打印
的
纸张
的默认一般都是
纵向
,但有一些是
横向
,但发现在一些很特殊的情况下,即使在
打印
之前
设置
了
横向
,但实际
打印
依然是
纵向
。目前发现这个问题有两个原因。 1 是
纸张
名称不对,会导致
横向
设置
不...
Delphi
5,390
社区成员
262,734
社区内容
发帖
与我相关
我的任务
Delphi
Delphi 开发及应用
复制链接
扫一扫
分享
社区描述
Delphi 开发及应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章