假如你有将QUICKREP报表的DataSet属性设置为ADODataSet1.那出现这种情况的原因最有可能是当前ADODataSet1已经指向数据库记录的最后一条记录。你可以在QUICKREP报表的BeforePrint事件中,写 if not ADODataSet1.active then adoDataset1.active:= true; ADODataSet1.first;
有没有在预览之前设置好DataSet的SQL语句是 select * from table_name?你或者在预览报表之前用一个DBGrid把数据集的内容Show出来,看看是否有那些纪录.
begin adoquery1.Connection :=adoconnection1; ADOQuery1.SQL.Text := 'select * from 基本业务表' ; ADOQuery1.open; QRDBText1.DataField:=ADOQuery1.Fields[1].Text ; adoquery1.first; while not adoquery1.Eof=true do begin combobox1.AddItem (adoquery1.Fields[1].Text,combobox1) ; adoquery1.Next ; end; adoquery1.Close ; end; 这段程序可以使combox1
可以使combox1显示该字段的全部记录,但是报表中依然只有一项
应该这样://比如说:unit2是报表窗口,上面有ADODataset1 uses unit2; procedure TForm1.button1Click(sender: TObject); begin with Form2 do begin adodataset1.Connection :=adoconnection1; adodataset1.CommandText := 'select * from table_name' ; adodataset1.open; qrickrep1.priview; end;end; QRDBText1.DataField:=adodataset1.Fields[1].Text //这个要放在TQRBAND的是rbdetail的BeforePrint 的事件中。或者直接在报表里面连接好.
文本控件(TQRMemo?),这样的话要在打印控件所在band前赋值。
SQL语句是 select * from table_name
可以连接,
不过报表只返回一个记录,但是数据库里面有很多记录的阿;
BandTypeV := rbDetail;
QRDBText.Parent := BandTypeV;
QRDBText.DataSet := ADODataSet1;
QRDBText.FieldName := '...';
在对象监视器里面,我把他们的dataset都设定为ADODATASET1,TQRBAND的属性是rbdetail
QRDBText也放在这个BAND里面的阿
if not ADODataSet1.active then
adoDataset1.active:= true;
ADODataSet1.first;
我对ADODATASET的具体属性和操作都不太明白 可以来个它的属性的列表吗?
adoquery1.Connection :=adoconnection1;
ADOQuery1.SQL.Text := 'select * from 基本业务表' ;
ADOQuery1.open;
QRDBText1.DataField:=ADOQuery1.Fields[1].Text ;
adoquery1.first;
while not adoquery1.Eof=true do
begin
combobox1.AddItem (adoquery1.Fields[1].Text,combobox1) ;
adoquery1.Next ;
end;
adoquery1.Close ;
end;
这段程序可以使combox1
uses unit2;
procedure TForm1.button1Click(sender: TObject);
begin
with Form2 do
begin
adodataset1.Connection :=adoconnection1;
adodataset1.CommandText := 'select * from table_name' ;
adodataset1.open;
qrickrep1.priview;
end;end; QRDBText1.DataField:=adodataset1.Fields[1].Text //这个要放在TQRBAND的是rbdetail的BeforePrint 的事件中。或者直接在报表里面连接好.