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[i]:=TQRLabel.Create(Self);
    if i=0 then
      QRLaList[i].Left:=0
    else
      QRLaList[i].Left:=QRLaList[i-1].Left+QRLaList[i-1].Width+12;
    QRLaList[i].Parent:=FPRINT.QRBand1;
    QRLaList[i].AutoSize:=false;
    Query.First;
    While not Query.Eof do
    begin
      if Query.Fields[i].dataSize>k then
        k:=Query.Fields[i].DataSize;
        Query.Next;
    end;
    QRLaList[i].Caption:=Query.Recordset.Fields[i].Name;
    QRLaList[i].Top:=10;
    if Query.FieldCount>12 then
    begin
      QRLaList[i].Font.Size:=7;
      QRLaList[i].Width:=k*2+5;
    end
    else
    begin
      QRLaList[i].Font.Size:=8;
      QRLaList[i].Width:=K*3+5;
    end;
    QRTeList[i]:=TQRDBText.Create(Self);
    QRTeList[i].Parent:=FPRINT.DetailBand1;
    QRTeList[i].DataSet:=Query;
    QRTeList[i].DataField:=Query.Recordset.Fields[i].Name;
    QRTeList[i].AutoSize:=True;
    QRTeList[i].Font.Size:=QRLaList[i].Font.Size;
    QRTeList[i].Top:=10;
    QRTeList[i].Left:=QRLaList[i].Left;
  end;
  FPRINT.QuickRep1.Preview;
  for i:=0 to count-1 do
  begin
    FPRINT.DetailBand1.RemoveControl(QRTeList[i]);
    FPRINT.QRBand1.RemoveControl(QRLaList[i]);
  end;
end;
问题是如果前一个字段太长,后一个字段会把前一个字段盖住,怎么解决???
先谢谢大家了!!!