G
gdwangyg
Unregistered / Unconfirmed
GUEST, unregistred user!
在使用fastreport2.51中,在数据字典中增加了一个变量,如aa,我想通过DELPHI中的FORM1中传一个DBEDIT1.TEXT给frReport1.memo1.
1.首先在数据字典中建立一变量aa.
2.在frReport1.memo1双击,在fastreport1的text editor中加入定义的变量aa也是按memo1 的值指向变量aa.
3.Delphi 编辑窗口中FrReport1的
procedure TForm1.frReport1GetValue(const ParName: String; var ParValue: Variant);
begin
with frReport1.Dictionary do
begin
variables['tt']:='ok';
end;
end;
运行后却提示如下内容. frreport1.ShowReport;后跳出窗口.如果把onGetValue事件去掉,报表运行正常.
窗口标题是:source file not found:freclass.pas
path to source file (窗口提示)
fr_class.pas
这是为什幺呢?我控件装得不正常还是有别的地方不对.
其程序原码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, FR_DSet, FR_DBSet, FR_Class, StdCtrls;
type
TForm1 = class(TForm)
ADOConnection1: TADOConnection;
frReport1: TfrReport;
frDBDataSet1: TfrDBDataSet;
ADOQuery1: TADOQuery;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure frReport1GetValue(const ParName: String;
var ParValue: Variant);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
frreport1.ShowReport;
end;
procedure TForm1.frReport1GetValue(const ParName: String;
var ParValue: Variant);
begin
with frReport1.Dictionary do
begin
variables['tt']:='ok';
end;
end;
end.
1.首先在数据字典中建立一变量aa.
2.在frReport1.memo1双击,在fastreport1的text editor中加入定义的变量aa也是按memo1 的值指向变量aa.
3.Delphi 编辑窗口中FrReport1的
procedure TForm1.frReport1GetValue(const ParName: String; var ParValue: Variant);
begin
with frReport1.Dictionary do
begin
variables['tt']:='ok';
end;
end;
运行后却提示如下内容. frreport1.ShowReport;后跳出窗口.如果把onGetValue事件去掉,报表运行正常.
窗口标题是:source file not found:freclass.pas
path to source file (窗口提示)
fr_class.pas
这是为什幺呢?我控件装得不正常还是有别的地方不对.
其程序原码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, FR_DSet, FR_DBSet, FR_Class, StdCtrls;
type
TForm1 = class(TForm)
ADOConnection1: TADOConnection;
frReport1: TfrReport;
frDBDataSet1: TfrDBDataSet;
ADOQuery1: TADOQuery;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure frReport1GetValue(const ParName: String;
var ParValue: Variant);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
frreport1.ShowReport;
end;
procedure TForm1.frReport1GetValue(const ParName: String;
var ParValue: Variant);
begin
with frReport1.Dictionary do
begin
variables['tt']:='ok';
end;
end;
end.