Z
zdt
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TFEntrust.BitBtn7Click(Sender: TObject);
var
QRLaList:Array of TQRLabel;
QRTeList:Array of TQRDBText;
Count,i,k:integer;
begin
FPRINT.QuickRep1.DataSet:=Query;
Count:=Query.FieldCount;
SetLength(QRLaList,Count);
SetLength(QRTeList,Count);
for i:=0 to high(QRTeList)do
begin
k:=0;
QRLaList:=TQRLabel.Create(Self);
if i=0 then
QRLaList.Left:=0
else
QRLaList.Left:=QRLaList[i-1].Left+QRLaList[i-1].Width+12;
QRLaList.Parent:=FPRINT.QRBand1;
QRLaList.AutoSize:=false;
Query.First;
While not Query.Eofdo
begin
if Query.Fields.dataSize>k then
k:=Query.Fields.DataSize;
Query.Next;
end;
QRLaList.Caption:=Query.Recordset.Fields.Name;
QRLaList.Top:=10;
if Query.FieldCount>12 then
begin
QRLaList.Font.Size:=7;
QRLaList.Width:=k*2+5;
end
else
begin
QRLaList.Font.Size:=8;
QRLaList.Width:=K*3+5;
end;
QRTeList:=TQRDBText.Create(Self);
QRTeList.Parent:=FPRINT.DetailBand1;
QRTeList.DataSet:=Query;
QRTeList.DataField:=Query.Recordset.Fields.Name;
QRTeList.AutoSize:=True;
QRTeList.Font.Size:=QRLaList.Font.Size;
QRTeList.Top:=10;
QRTeList.Left:=QRLaList.Left;
end;
FPRINT.QuickRep1.Preview;
for i:=0 to count-1do
begin
FPRINT.DetailBand1.RemoveControl(QRTeList);
FPRINT.QRBand1.RemoveControl(QRLaList);
end;
end;
问题是如果前一个字段太长,后一个字段会把前一个字段盖住,怎么解决???
先谢谢大家了!!!
var
QRLaList:Array of TQRLabel;
QRTeList:Array of TQRDBText;
Count,i,k:integer;
begin
FPRINT.QuickRep1.DataSet:=Query;
Count:=Query.FieldCount;
SetLength(QRLaList,Count);
SetLength(QRTeList,Count);
for i:=0 to high(QRTeList)do
begin
k:=0;
QRLaList:=TQRLabel.Create(Self);
if i=0 then
QRLaList.Left:=0
else
QRLaList.Left:=QRLaList[i-1].Left+QRLaList[i-1].Width+12;
QRLaList.Parent:=FPRINT.QRBand1;
QRLaList.AutoSize:=false;
Query.First;
While not Query.Eofdo
begin
if Query.Fields.dataSize>k then
k:=Query.Fields.DataSize;
Query.Next;
end;
QRLaList.Caption:=Query.Recordset.Fields.Name;
QRLaList.Top:=10;
if Query.FieldCount>12 then
begin
QRLaList.Font.Size:=7;
QRLaList.Width:=k*2+5;
end
else
begin
QRLaList.Font.Size:=8;
QRLaList.Width:=K*3+5;
end;
QRTeList:=TQRDBText.Create(Self);
QRTeList.Parent:=FPRINT.DetailBand1;
QRTeList.DataSet:=Query;
QRTeList.DataField:=Query.Recordset.Fields.Name;
QRTeList.AutoSize:=True;
QRTeList.Font.Size:=QRLaList.Font.Size;
QRTeList.Top:=10;
QRTeList.Left:=QRLaList.Left;
end;
FPRINT.QuickRep1.Preview;
for i:=0 to count-1do
begin
FPRINT.DetailBand1.RemoveControl(QRTeList);
FPRINT.QRBand1.RemoveControl(QRLaList);
end;
end;
问题是如果前一个字段太长,后一个字段会把前一个字段盖住,怎么解决???
先谢谢大家了!!!