实现:
unit Unit2;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, QuickRpt, QRCtrls, Db, DBTables;
type
TForm2 = class(TForm)
QuickRep1: TQuickRep;
PageFooterBand1: TQRBand;
QRExpr1: TQRExpr;
ColumnHeaderBand1: TQRBand;
DetailBand1: TQRBand;
QRLabel1: TQRLabel;
QRExpr2: TQRExpr;
QRLabel2: TQRLabel;
QRExpr3: TQRExpr;
QRLabel3: TQRLabel;
QRExpr4: TQRExpr;
QRLabel4: TQRLabel;
QRExpr5: TQRExpr;
QRLabel5: TQRLabel;
QRExpr6: TQRExpr;
QRLabel6: TQRLabel;
QRExpr7: TQRExpr;
QRLabel7: TQRLabel;
QRExpr8: TQRExpr;
Table1: TTable;
procedure ColumnHeaderBand1AfterPrint(Sender: TQRCustomBand;
BandPrinted: Boolean);
procedure DetailBand1AfterPrint(Sender: TQRCustomBand;
BandPrinted: Boolean);
procedure DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
private
i:Integer;//计数器
end;
var
Form2: TForm2;
implementation
{$R *.DFM}
procedure TForm2.ColumnHeaderBand1AfterPrint(Sender: TQRCustomBand;
BandPrinted: Boolean);
begin
i:=0;//新的一页付零值
DetailBand1.ForceNewPage:=false;//不分页
end;
procedure TForm2.DetailBand1AfterPrint(Sender: TQRCustomBand;
BandPrinted: Boolean);
begin
i:=i+1;
end;
procedure TForm2.DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
if i = 6 then
DetailBand1.ForceNewPage:=true;//第七条的时候分页
end;
end.