我现在是这样写的语句procedure Tprint.QRBand1BeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
var
i:integer;
begin
for i:=0 to ComponentCount-1 do
if Components[i] is TQRDBText1 then
begin
if (Components[i] as TQRDBText).text='0' then
  (Components[i] as TQRDBText).text:='';
end;end;提示(Components[i] as TQRDBText).text的.text不对,那应该用什么?用.field也不对...帮帮忙啊

解决方案 »

  1.   

    理论上应该是判断if FieldByName[字段].AsString='0' then
    QRDBText的是Caption而不是text!
      

  2.   

    用QRLABEL才行,
    if FieldByName[字段].AsString='0' then
    QRBALEL1。CAPTION:=‘ ’
      

  3.   

    不用QRLABEL不行吗?这样我又要全部都改一遍啊~~~~~~~~~~~~~~
      

  4.   

    下次一定用fastreport,但是这次怎么办啊?
      

  5.   

    if (Components[i] as TQRDBText).text='0' then
      (Components[i] as TQRDBText).text:='';
      

  6.   

    楼上的?我是这样写的啊。text不对。
      

  7.   

    if (Components[i] as TQRDBText).Caption='0' then
      (Components[i] as TQRDBText).Caption:='';
      

  8.   

    [Error] prt.pas(232): Undeclared identifier: 'Caption'