ReportMachine与FastReport固定行数分页不足补空白行实践
ReportMachine简单容易,FastReport有点复杂
准备工作
ReportMachine实现
ReportMachine实现很简单,设置报表MasterData的LinesPerPage每页记录数,AutoAppendBlank为True即可。
效果
FastReport实现
需在在报表里使用代码来控制才能实现有点麻烦
具体是通过在MasterData超过指定行数时创建新页,Footer页脚来动态增加frxChild
var
PageLine: integer; //在当前页打印到第几行
PageMaxRow: integer=8; //设定每页列数
procedure Footer1OnBeforePrint(Sender: TfrxComponent);
var
i: integer;
begin
i := iif(PageLine=0, PageMaxRow, PageLine);
while i < PageMaxRow do begin
i := i + 1;
Engine.ShowBand(Child1); //印空白表格
end;
end;
procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
begin
PageLine := <line> mod PageMaxRow;
if (PageLine = 1) and (<line> > 1) then
Engine.newpage;
end;
begin
end;
效果
标签:begin,PageLine,end,PageMaxRow,FastReport,数分,空白行,ReportMachine From: https://blog.51cto.com/u_12668715/8180609