将程序中Memo组件的内容传递到Rave Report 的Memo组件中
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, RpDefine, RpRave, StdCtrls,RVClass,RvProj,RVCsStd;
type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
RvProject1: TRvProject;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
MyPage : TRavePage;
MyMemo : TRaveMemo;
begin
RvProject1.Open;
with RvProject1.ProjMan do
begin
MyPage := FindRaveComponent('Report1.Page1', nil) as TRavePage;
MyMemo := FindRaveComponent('Memo1', MyPage) as TRaveMemo;
MyMemo.Text := Memo1.Lines.Text;
end; {with}
RvProject1.ExecuteReport('Report1');
RvProject1.Close;
end;
end.
|