F
fangzhou_com
Unregistered / Unconfirmed
GUEST, unregistred user!
我使用quickrep不能显示完最后的2条记录。请大家帮帮忙,把代码贴出来。
procedure TForm1.Button1Click(Sender: TObject);
begin
quickrep1.Preview;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
quickrep1.Hide;
end;
procedure TForm1.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
Table1.First;
end;
procedure TForm1.QuickRep1NeedData(Sender: TObject;
var MoreData: Boolean);
Var
i:Integer;
begin
MoreData:=True;
for I:=1 to 2do
begin
if Table1.Eof then
Break;
case I of
1:QRLabel1.Caption:=Table1.FieldByName('lastNAME').AsString;
2:QRLabel2.Caption:=Table1.FieldByName('lastNAME').AsString;
end;
table1.Next;
end;
if table1.Eof then
MoreData:=False;
end;
--------------------------------
这样就缺最后的记录不能显示出来。我是要每行2条。但是显示到后面不管是剩余1条还是2条都不能打印出来
procedure TForm1.Button1Click(Sender: TObject);
begin
quickrep1.Preview;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
quickrep1.Hide;
end;
procedure TForm1.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
Table1.First;
end;
procedure TForm1.QuickRep1NeedData(Sender: TObject;
var MoreData: Boolean);
Var
i:Integer;
begin
MoreData:=True;
for I:=1 to 2do
begin
if Table1.Eof then
Break;
case I of
1:QRLabel1.Caption:=Table1.FieldByName('lastNAME').AsString;
2:QRLabel2.Caption:=Table1.FieldByName('lastNAME').AsString;
end;
table1.Next;
end;
if table1.Eof then
MoreData:=False;
end;
--------------------------------
这样就缺最后的记录不能显示出来。我是要每行2条。但是显示到后面不管是剩余1条还是2条都不能打印出来