模态窗体中动态创建打印预览窗体出错!

yangtsehua 2004-04-26 02:32:06
unit uSelectPrint; //用于用户选择需打印的字段

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, DB, DBClient;

type
TfrmSelectPrint = class(TForm)
GroupBox1: TGroupBox;
checkb_khjg: TCheckBox;
checkb_hm: TCheckBox;
checkb_zh: TCheckBox;
checkb_xdmm: TCheckBox;
checkb_sfzh: TCheckBox;
checkb_dzpzmm: TCheckBox;
checkb_tkmm: TCheckBox;
checkb_jrkmm: TCheckBox;
checkb_myemail: TCheckBox;
checkb_bgxhm: TCheckBox;
checkb_jgurl: TCheckBox;
checkb_khsj: TCheckBox;
checkb_yyyxm: TCheckBox;
checkb_yyydh: TCheckBox;
checkb_yyysj: TCheckBox;
checkb_other1: TCheckBox;
checkb_yzty: TCheckBox;
checkb_bz: TCheckBox;
btn_next: TBitBtn;
BitBtn1: TBitBtn;
ClientDataSet1: TClientDataSet;
procedure BitBtn1Click(Sender: TObject);
procedure btn_nextClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
frmSelectPrint: TfrmSelectPrint;

implementation

uses uPrint;

{$R *.dfm}

procedure TfrmSelectPrint.BitBtn1Click(Sender: TObject);
begin
close;
end;

procedure TfrmSelectPrint.btn_nextClick(Sender: TObject);
begin
frmprint:=Tfrmprint.Create(nil);
try
frmprint.QuickRep1.PreviewModal; //调用的时候出错
finally
frmprint.Free;
end;
self.ModalResult:=MROK;
close;
end;

end.

出错: Access Violation at address 004dec92 in module 'account.exe',Read of address 0000000.
好像是quickrep1没有创建,不知道怎么做?谢谢。




...全文
33 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qingenerp 2004-04-29
  • 打赏
  • 举报
回复
procedure TfrmSelectPrint.btn_nextClick(Sender: TObject);
begin
frmprint:=Tfrmprint.Create(nil);
try
frmprint.QuickRep1.PreviewModal; //调用的时候出错
finally
frmprint.Free;
frmprint:=nil;
end;

end;
夜o猫 2004-04-29
  • 打赏
  • 举报
回复
我用时也是出错,只好采用了静态装载的方式!
Project->Optiopn->Forms,然后把你的frmprint弄到左边!
直接frmprint.QuickRep1.PreviewModal;调用就可以了!
10975037 2004-04-29
  • 打赏
  • 举报
回复
什么错误?
superTY 2004-04-28
  • 打赏
  • 举报
回复
帮你up

2,497

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧