对不起,我看错了.我以为你是完全自动的建立QuickRep,原来你是已经放在表单中了.我试了
一下,没有问题.以下是我的例子.我的QuickRep上没有放任何东西,只是预览.
我想可能是你别的哪儿有问题,你试试最简单的方法看看.
主表单,Form2
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
Form1 := TForm1.Create(self);
Form1.QuickRep1.Preview;
end;
end.
报表表单,Form1
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, QuickRpt;
type
TForm1 = class(TForm)
QuickRep1: TQuickRep;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
end.