W
woodpile
Unregistered / Unconfirmed
GUEST, unregistred user!
怎么在预览的时候看不见呀??
procedure TForm2.ShowReport();
//动态创建控件,排列控件
var
i:integer;
begin
iCount:=dm.adods.FieldCount;
SetLength(TextArray,iCount);
SetLength(LabelArray,iCount);
for i:=0 to iCount-1do
begin
LabelArray:=TQRLabel.Create(self);
LabelArray.Parent:= QRBandColumn;
LabelArray.Visible:=true;
LabelArray.Show;
LabelArray.Color:=clred;
TextArray:=TQRDBText.Create(self);
TextArray.Parent:=QRBandDetail;
TextArray.Visible:=true;
end;
with labelArray[0]do
begin
AutoSize:=False;
AutoStretch:=True;
Left :=20 ;
Top := 0;
Width:=80;
Height:=QRBandColumn.Height;
Alignment:=taCenter;
Caption:= ListBoxFieldName.Items.Strings[0];
end;
for i:=1 to icount-1do
begin
LabelArray.AutoSize:=False;
LabelArray.AutoStretch:=True;
LabelArray.Left :=LabelArray[i-1].Left+LabelArray[i-1].Width ;
LabelArray.Top := 0;
LabelArray.Width:=80;
LabelArray.Height:=QRBandColumn.Height;
LabelArray.Alignment:=taCenter;
LabelArray.Caption:= ListBoxFieldName.Items.Strings[i-1];
end;
QuickRep1.Preview;
end;
procedure TForm2.ShowReport();
//动态创建控件,排列控件
var
i:integer;
begin
iCount:=dm.adods.FieldCount;
SetLength(TextArray,iCount);
SetLength(LabelArray,iCount);
for i:=0 to iCount-1do
begin
LabelArray:=TQRLabel.Create(self);
LabelArray.Parent:= QRBandColumn;
LabelArray.Visible:=true;
LabelArray.Show;
LabelArray.Color:=clred;
TextArray:=TQRDBText.Create(self);
TextArray.Parent:=QRBandDetail;
TextArray.Visible:=true;
end;
with labelArray[0]do
begin
AutoSize:=False;
AutoStretch:=True;
Left :=20 ;
Top := 0;
Width:=80;
Height:=QRBandColumn.Height;
Alignment:=taCenter;
Caption:= ListBoxFieldName.Items.Strings[0];
end;
for i:=1 to icount-1do
begin
LabelArray.AutoSize:=False;
LabelArray.AutoStretch:=True;
LabelArray.Left :=LabelArray[i-1].Left+LabelArray[i-1].Width ;
LabelArray.Top := 0;
LabelArray.Width:=80;
LabelArray.Height:=QRBandColumn.Height;
LabelArray.Alignment:=taCenter;
LabelArray.Caption:= ListBoxFieldName.Items.Strings[i-1];
end;
QuickRep1.Preview;
end;