您的位置: 首页-> 电脑文摘-> 程序设计-> Delphi/Pascal-> 正文

运行时动态向RAVE报表增加一个TEXT对象
作者佚名 来源InterNet 加入时间:2004-11-23
运行时动态向RAVE报表增加一个TEXT对象

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, RpBase, RpSystem, RpDefine, 
RpRave,RvCsRpt,RVProj,RVClass,RVCsStd;

type
  TForm1 = class(TForm)
    RvProject1: TRvProject;
    RvSystem1: TRvSystem;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
    MyBand: TRaveBand;
    MyRegion: TRaveRegion;
    MyPage: TRavePage;
    MyText: TRaveText;
begin
    RvProject1.Open;
    With RvProject1.ProjMan do 
    begin
        MyPage := FindRaveComponent('Report1.Page1',nil) as TRavePage;
        MyRegion:= FindRaveComponent('Region1',MyPage) as TRaveRegion;
        MyBand := FindRaveComponent('Band1',MyRegion) as TRaveBand;
        MyText:=TRaveText.Create(Myband);
        MyText.Parent:=Mypage;
        MyText.Name:=GetUniqueName('Text1',MyPage,false);
        MyText.Top:=0.2;
        MyText.Left:=0.7;
        MyText.Width:=200;
        MyText.Height:=200;
        MyText.Text:='SCYANGYU@163.COM';
        MyText.Font.Size :=20;   //设置字体的属性
        MyText.Font.Color :=ClRed;
        MyText.Font.Name :='隶书';
        AddComponent(MyText);
    end; { with }
    RvProject1.ExecuteReport('Report1');
    RvProject1.Close; 
end;

end.
 


[文章录入员:fightter]

相关文章 相关软件:
::PCBOOKCN'ADS::


::Delphi/Pascal::
C/C++/VC
C++Builder
Basic/VB类
Delphi/Pascal
Java编程
FORTRAN
其它
::阅读排行::
·Delphi与Excel的亲密接...
·Delphi实现串口通信的常用的...
·DELPHI下的多线程程序设计(...
·Delphi中初始化.Ini文件...
·Delphi中用于读写(I/O)...
·谈谈Delphi中的类和对象
·Delphi编译错误中文手册
·Delphi中关于TApplic...
·OPENGL图形程序设计
·SQL的基本操作