换页怎么换;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
假如我有1000条纪录,分20页来打印
分不够可以再加(呵呵)
procedure TForm1.Button8Click(Sender: TObject);
var
n:integer;
begin
query1.Databasename:='';
query1.SQL.Text:='select * from test';
query1.Open ;
///////////////////////////////////////////////////
n:=0;
Printer.begin
Doc;
while not query1.Eofdo
begin
Printer.Canvas.Font.Name:='宋体';
Printer.Canvas.Font.Size:=8;
Printer.Canvas.Font.Pitch:=fpFixed;
Printer.Canvas.TextOut(10, n+10,query1.Fields[0].asstring);
Printer.Canvas.TextOut(210,n+10,query1.Fields[1].asstring);
Printer.Canvas.TextOut(410,n+10,query1.Fields[2].asstring);
Printer.Canvas.TextOut(810,n+10,floattostr(query1.Fields[3].asfloat));
n:=n+20;
query1.Next ;
end;
Printer.EndDoc;
end;