var
printed_rows : integer;
procedure TQrpt.PageHeaderBandBeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
printed_rows := 1;
end;
procedure TQRpt.DetailBandBeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
if not QRpt.DataSet.Bof then
printed_rows := printed_rows + 1;
if printed_rows > 5 then
QRpt.EndPage;
end;