我用一个ADOQuery控件查询两个字段,然后在报表的QRDBText中显示,请问如果我查询的数据集如果为空即ADOQuery1.RecordCount=0满足条件的记录为0,如何让QRDBText设置的字段显示为0, 大家有谁知道,麻烦向您请教一下!!!

解决方案 »

  1.   

    if RecordCount = 0 then QRDBText.Caption := '0';
    我瞎说的,呵呵。还是看看你查询什么字段,QRDBText指定的是那个字段吧,或者看看你的代码
      

  2.   

    QRDBTest1.Caption:=IntToStr(AdoQuery1.RecordCount);
      

  3.   

    不对吧,QRDBTest1的caption显示有效吗?
      

  4.   

    if RecordCount = 0 then QRDBText.Text := '0';
      

  5.   

    procedure TForm1.QRDBText1Print(sender: TObject; var Value: String);
    begin
      if TQRDBText(sender).DataSet.IsEmpty then Value := '0';
    end;————————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    ————————————————————————————————————