var
GPage,GIndex,FGIndex:integer;
PageList:array of integer;
PageLine: integer;
PageMaxRow: integer=28;
procedure PageFooter1OnBeforePrint(Sender: TfrxComponent);
begin
GPage := GPage + 1;
end;
procedure Page1OnBeforePrint(Sender: TfrxComponent);
begin
GPage :=1;
end;
procedure GroupFooter1OnBeforePrint(Sender: TfrxComponent);
var
i: integer;
begin
if Engine.FinalPass then //二次遍历时增加分组索引
FGIndex := FGIndex + 1
else
begin
setLength(PageList,GIndex + 1);
PageList[GIndex] := GPage; //存放分组的总页数
GIndex := GIndex + 1;
end;
GPage := 0;
i := iif(PageLine=0, PageMaxRow, PageLine);
child1.visible := True;
while i < PageMaxRow do
begin
i := i + 1;
Engine.ShowBand(Child1); //印空白表格
end;
child1.visible := False;
end;
procedure Memo6OnBeforePrint(Sender: TfrxComponent);
begin
if not Engine.FinalPass then exit;
//Memo6.Lines[0] := '总页号:'+IntToStr(PageList[FGIndex]);
Memo6.Lines[0] := '总页号:'+IntToStr(FGIndex+1);
end;
procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
begin
PageLine := <Line> mod PageMaxRow;
if (PageLine = 1) and (<line> > 1) then
Engine.newpage;
child1.visible := False;
end;
//如果仅在最后一页补空行可用
{procedure Footer1OnBeforePrint(Sender: TfrxComponent);
var
i: integer;
begin
i := iif(PageLine=0, PageMaxRow, PageLine);
child1.visible := True;
while i < PageMaxRow do
begin
i := i + 1;
Engine.ShowBand(Child1); //印空白表格
end;
child1.visible := False;
end;}
begin
FGIndex :=0;
end.
FastReport界面为: