各位高手,我怎么也不能动态创建报表,代码如下,没有任何错误,但就是预览不到数据,那儿有问题那?在线等待(100分)

  • 主题发起人 主题发起人 viya
  • 开始时间 开始时间
V

viya

Unregistered / Unconfirmed
GUEST, unregistred user!
var
AIndex:Integer;
adosetStc:TADODataSet;
QRLabel1: TQRLabel;
QRDBText1: TQRDBText;
begin
adosetStc:=TADODataSet(ADataSet);
QuickRep1.DataSet:=adosetStc;
QRBand2.ParentReport:=QuickRep1;
QRBand3.ParentReport:=QuickRep1;
for AIndex := 0 to adosetStc.FieldCount-1do
begin
with TQRLabel.Create(QRBand2)do
begin
ParentReport:=QuickRep1;
AlignToBand:=True;
Frame.DrawTop:=True;
Frame.DrawBottom:=True;
Frame.DrawLeft:=True;
Frame.DrawRight:=True;
Caption:=adosetStc.Fields[AIndex].DisplayName;
Left:=8+Width * (AIndex)+4;
Top:=8;
Visible:=True;
Activate;
end;
with TQRDBText.Create(QRBand3)do
begin
ParentReport:=QuickRep1;
Frame.DrawTop:=True;
Frame.DrawBottom:=True;
Frame.DrawLeft:=True;
Frame.DrawRight:=True;
DataSet:=adosetStc;
DataField:=adosetStc.Fields[AIndex].DisplayName;
Left:=8+Width * (AIndex)+4;
Top:=8;
Visible:=True;
Activate;
end;
end;
QuickRep1.Preview;
 
with TQRLabel.Create(QRBand2)do
{是不是QRLabel后面缺1}
with TQRDBText.Create(QRBand3)do
{是不是QRDBText后面缺1}
 
后退
顶部