请问我这段打印序为什么只能打印第一条纪录!
procedure TscorefoundForm.prepareprint();
var
leftvalue:integer;
alabel:TQRLabel;
atext:TQRDBText;
i:integer;
begin
leftvalue:=0;
dayinform.QRLabel3.Caption:=banji.Text;
dayinform.QRLabel4.Caption:=xueqi.Text;
with adoquery8 do
begin
close;
adoquery8.SQL.text:='select * from foundscore ';
open;
for i:=0 to adoquery8.FieldCount-1 do //动态添加字段
begin
with dayinform do
begin
aLabel := TQRLabel.Create(dayinform);
aLabel.Parent :=TitleBand1;
with aLabel do
begin
top:=10;
left:=leftvalue;
Alignment:=tacenter;
caption:=adoquery8.Fields[i].FieldName;
end;
aText:= TQRDbText.Create(dayinform);
aText.Parent :=DetailBand1;
with aText do
begin
top:=10;
Left:=leftvalue;
dataset:=adoquery8;
datafield:=adoquery8.Fields[i].FieldName;
Alignment:=tacenter;
end;
end;
leftvalue:=leftvalue+70;
end;
end;
end;
procedure TscorefoundForm.prepareprint();
var
leftvalue:integer;
alabel:TQRLabel;
atext:TQRDBText;
i:integer;
begin
leftvalue:=0;
dayinform.QRLabel3.Caption:=banji.Text;
dayinform.QRLabel4.Caption:=xueqi.Text;
with adoquery8 do
begin
close;
adoquery8.SQL.text:='select * from foundscore ';
open;
for i:=0 to adoquery8.FieldCount-1 do //动态添加字段
begin
with dayinform do
begin
aLabel := TQRLabel.Create(dayinform);
aLabel.Parent :=TitleBand1;
with aLabel do
begin
top:=10;
left:=leftvalue;
Alignment:=tacenter;
caption:=adoquery8.Fields[i].FieldName;
end;
aText:= TQRDbText.Create(dayinform);
aText.Parent :=DetailBand1;
with aText do
begin
top:=10;
Left:=leftvalue;
dataset:=adoquery8;
datafield:=adoquery8.Fields[i].FieldName;
Alignment:=tacenter;
end;
end;
leftvalue:=leftvalue+70;
end;
end;
end;
解决方案 »
- 动态创建1000个label,如何释放内存
- 能否边查询,边显示?
- 怎样得到windows的一些系统目录,比如'我的文档'我的文档里面的'我的音乐','我的视频'
- !!怎么禁止ADO的自动简繁转换功能!!
- 谁能介绍一下:有没有与Word兼容比较好的控件(For Delphi)?
- Kaersoft软件基地重新分类,大家看看好不好?都来UP - 九品御厨
- form的free方法和close方法有什么不同呢?
- 向高手们求助
- 急!急!,请教:在win2000局域网中,怎样得知客户端在登录,或退出网络??
- 小妹?^_^?:捉虫::我玩delphi?? delphi玩我!!
- 怎样用存储过程获得服务器的时间,数据库为(SQL server2000)???
- 什么组件能将数据表中的某一字段的所有记录列出来?就这么简单。
改成上面的语句试试
在程序你设置的!!