用冷叶风的办法,在BeforePrint事件中添加空白记录,
AfterPrint事件中把空白记录删除。
例如:
procedure TForm2.AddRecord;
var
i: integer;
begin
with DMForm.CountTbl2do
begin
try
DisableControls;
if (RecordCount mod 15) <> 0 then
^^每页15行
for i := 1 to ((RecordCount div 15) + 1) * 15 - RecordCountdo
begin
Append;
FieldByName('Code').AsString := '';
Post;
end;
finally
EnableControls;
end;
end;
end;
procedure TForm2.DelRecord;
var
i: integer;
begin
with DMForm.CountTbl2do
begin
try
DisableControls;
Last;
while FieldByName('Code').AsString='' and Bofdo
begin
Delete;
Last;
end;
finally
EnableControls;
end;
end;
end;
以上方法对TQuery不适用。