Delphi 7 中使用RAVE报表(四)
——利用程序设计一张报表
上一篇向大家介绍了建立一张简单报表的过程。这篇文章向大家介绍rave报表代码编程实例。窗体上放置组件:RvSystem, Button即可。
具体代码如下: ##################################################################################
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, RpDefine, RpBase, RpSystem;
type
TForm1 = class(TForm)
RvSystem1: TRvSystem;
Button1: TButton;
procedure RvSystem1Print(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.RvSystem1Print(Sender: TObject);
var
I1: integer;
S1: string[20];
S2: string[20];
Bitmap: TBitmap;
PolyLineArr: array[1..6] of TPoint;
begin
with Sender as TBaseReport do begin
{ 打印表头和表尾 }
SectionTop := 0.75; //顶端
SetFont('黑体',26); //设置字体
Underline := true; //下划线
Home;
YPos := 1.0;
FontRotation :=20;//旋转角度
PrintCenter('我的报表',PageWidth / 2);
SetFont('宋体',10);
SectionBottom := 10.75;
PrintFooter('第' + IntToStr(CurrentPage) + '页',pjLeft); //页码
PrintFooter('日期: '+DateToStr(Date)+' ',pjRight); //日期
SectionBottom := 10.5;
YPos := 1.5;
SetFont('宋体',12);
SetTopOfPage;
[1] [2] [3] [4] 下一页
|