procedure Tbaobiao_jsj.FormCreate(Sender: TObject);
var
  str :String;
  count :string;
  see:string;
  computerp :double;
  finsh:double;
    begin
    str := 'select enterpriseinfo.enterprise_name,artreport.evaluate_personne,artreport.artinaugurate_evaluates,'
       + ' artreport.consciousness_ability,artreport.layoutandproject,artreport.project_evaluate,'
       + ' artreport.mart_foreground,artreport.bestir_system,artreport.devotion_ability,'
       + ' artreport.chargescaless,artreport.chargedaoweiss,artreport.artbuyscaless,'
       + ' artreport.art_personnel,artreport.art_2exploiture,artreport.disquisition_exploiture,'
       + ' artreport.personneldivide,artreport.fruitamount,'
       + ' organisereport.fruit_transform,organisereport.equipingears,organisereport.equip_ability,organisereport.manage_system,'
       + ' organisereport.allright_stuff,organisereport.organise_abilitys,'
       + ' alimentationreport.alimentation_abilitys,alimentationreport.ad_devotion,'
       + ' alimentationreport.product_comeet,alimentationreport.mart_investigate,'
       + ' alimentationreport.sellchannel,alimentationreport.skill_level,'
       + ' managereport.manage_systemtx,managereport.enterprise_culture,managereport.governor_stuff,'
       + ' managereport.manage_abilitys'
       + ' from enterpriseinfo,artreport,organisereport,alimentationreport,managereport'
       + ' where enterpriseinfo.uid = ' + IntToStr(self.value)
       + ' and  enterpriseinfo.uid  = artreport.enterpriseid'
       + ' and  enterpriseinfo.uid  = organisereport.enterpriseid'
       + ' and  enterpriseinfo.uid  = alimentationreport.enterpriseid'
       + ' and  enterpriseinfo.uid  = managereport.enterpriseid';
         self.ADOQuery1.SQL.Clear;
         self.ADOQuery1.SQL.Add(str);
         ADOQuery1.Open;     count:= 'select (asset_yield + asset_guerdon + capital_increment + operation_gain + meritfund_velocity'
            + ' + cash_ensure + cost_charge + asset_velocity + currentassets_velocity + merchandise_velocity'
            + ' + badasset_ascale + balancesheet + accrual_multiple + owes_ascale + career_ascale'
            + ' + sell_mount + capital_pile + years_capitalmount + years_sellcapital + art_ascale)*0.2 as  computerp'
            + ' from account_coefficient,enterpriseinfo'
            + ' where enterpriseinfo.uid = ' + IntToStr(self.value)
            + ' and  enterpriseinfo.uid  = account_coefficient.enterpriseid';
               self.ADOQuery1.SQL.Clear;
               self.ADOQuery1.SQL.Add(count);
               ADOQuery1.Open;
      see:='select ((artinaugurate_evaluates + organise_abilitys + alimentation_abilitys+ manage_abilitys)+(asset_yield'
              +' + asset_guerdon + capital_increment + operation_gain + meritfund_velocity'
              +' + cash_ensure + cost_charge + asset_velocity + currentassets_velocity + merchandise_velocity'
              +' + badasset_ascale + balancesheet + accrual_multiple + owes_ascale + career_ascale'
              +' + sell_mount + capital_pile + years_capitalmount + years_sellcapital + art_ascale )*0.2) as finsh'
              +' from enterpriseinfo,artreport,organisereport,alimentationreport,managereport,account_coefficient'
              +' where enterpriseinfo.uid =' + IntToStr(self.value)
              +' and  enterpriseinfo.uid  = artreport.enterpriseid'
              +' and  enterpriseinfo.uid  = organisereport.enterpriseid'
              +' and  enterpriseinfo.uid  = alimentationreport.enterpriseid'
              +' and  enterpriseinfo.uid  = managereport.enterpriseid'
              +' and  enterpriseinfo.uid  = account_coefficient.enterpriseid';
               self.ADOQuery1.SQL.Clear;
               self.ADOQuery1.SQL.Add(see);
               ADOQuery1.Open;
              qrdbtext41.DataField :='enterprise_name';
              qrdbtext3.DataField := 'consciousness_ability';
              qrdbtext2.DataField := 'artinaugurate_evaluates';
              qrdbtext4.DataField := 'devotion_ability';
              qrdbtext5.DataField := 'disquisition_exploiture';
              qrdbtext12.DataField := 'layoutandproject';
              qrdbtext7.DataField := 'mart_foreground';
              qrdbtext1.DataField := 'project_evaluate';
              qrdbtext8.DataField := 'bestir_system';
              qrdbtext9.DataField := 'chargescaless';
              qrdbtext11.DataField := 'artbuyscaless';
              qrdbtext13.DataField := 'art_personnel';
              qrdbtext10.DataField := 'chargedaoweiss';
              qrdbtext12.DataField := 'art_2exploiture';
              qrdbtext14.DataField := 'personneldivide';
              qrdbtext15.DataField := 'fruitamount';
              qrdbtext16.DataField := 'organise_abilitys';
              qrdbtext17.DataField := 'fruit_transform';
              qrdbtext19.DataField := 'equipingears';
              qrdbtext21.DataField := 'allright_stuff';
              qrdbtext18.DataField := 'equip_ability';
              qrdbtext20.DataField := 'manage_system';
              qrdbtext26.DataField := 'product_comeet';
              qrdbtext24.DataField := 'ad_devotion';
              qrdbtext25.DataField := 'skill_level';
              qrdbtext27.DataField := 'mart_investigate';
              qrdbtext23.DataField := 'sellchannel';
              qrdbtext22.DataField := 'alimentation_abilitys';
              qrdbtext28.DataField := 'manage_abilitys';
              qrdbtext29.DataField := 'manage_systemtx';
              qrdbtext30.DataField := 'enterprise_culture';
              qrdbtext36.DataField := 'governor_stuff';
              qrdbtext31.DataField := 'computerp';
              qrdbtext32.DataField := 'finsh';
              qrdbtext34.DataField := 'evaluate_personne';
end;
为什么我的报表中不能同时显示
str count see SQL结果呢?他只能显示其中的一个结果!

解决方案 »

  1.   

    band设置为rbDetail,再看看是否连接了数据集
      

  2.   

    楼上的兄弟不行啊:还是只能显示一个,我加了一个ADOQuery2也不显示,只能显示,是不是
                   self.ADOQuery2.SQL.Clear;
                   这个清空了数据啊。
                   self.ADOQuery2.SQL.Clear;
                   QuickRep4.DataSet:=ADOQuery2;
                   self.ADOQuery2.SQL.Add(count);
                   ADOQuery2.Open;    begin
        str := 'select enterpriseinfo.enterprise_name,artreport.evaluate_personne,artreport.artinaugurate_evaluates,'
           + ' artreport.consciousness_ability,artreport.layoutandproject,artreport.project_evaluate,'
           + ' artreport.mart_foreground,artreport.bestir_system,artreport.devotion_ability,'
           + ' artreport.chargescaless,artreport.chargedaoweiss,artreport.artbuyscaless,'
           + ' artreport.art_personnel,artreport.art_2exploiture,artreport.disquisition_exploiture,'
           + ' artreport.personneldivide,artreport.fruitamount,'
           + ' organisereport.fruit_transform,organisereport.equipingears,organisereport.equip_ability,organisereport.manage_system,'
           + ' organisereport.allright_stuff,organisereport.organise_abilitys,'
           + ' alimentationreport.alimentation_abilitys,alimentationreport.ad_devotion,'
           + ' alimentationreport.product_comeet,alimentationreport.mart_investigate,'
           + ' alimentationreport.sellchannel,alimentationreport.skill_level,'
           + ' managereport.manage_systemtx,managereport.enterprise_culture,managereport.governor_stuff,'
           + ' managereport.manage_abilitys'
           + ' from enterpriseinfo,artreport,organisereport,alimentationreport,managereport'
           + ' where enterpriseinfo.uid = ' + IntToStr(self.value)
           + ' and  enterpriseinfo.uid  = artreport.enterpriseid'
           + ' and  enterpriseinfo.uid  = organisereport.enterpriseid'
           + ' and  enterpriseinfo.uid  = alimentationreport.enterpriseid'
           + ' and  enterpriseinfo.uid  = managereport.enterpriseid';
               self.ADOQuery1.SQL.Clear;
               QuickRep4.DataSet:=ADOQuery1;
                self.ADOQuery1.SQL.Add(str);
                ADOQuery1.Open;
         count:= 'select (asset_yield + asset_guerdon + capital_increment + operation_gain + meritfund_velocity'
                + ' + cash_ensure + cost_charge + asset_velocity + currentassets_velocity + merchandise_velocity'
                + ' + badasset_ascale + balancesheet + accrual_multiple + owes_ascale + career_ascale'
                + ' + sell_mount + capital_pile + years_capitalmount + years_sellcapital + art_ascale)*0.2 as  computerp'
                + ' from account_coefficient,enterpriseinfo'
                + ' where enterpriseinfo.uid = ' + IntToStr(self.value)
                + ' and  enterpriseinfo.uid  = account_coefficient.enterpriseid';
                   self.ADOQuery2.SQL.Clear;
                   QuickRep4.DataSet:=ADOQuery2;
                   self.ADOQuery2.SQL.Add(count);
                   ADOQuery2.Open;
    要怎么样才能在报表中同事显示上边两个SQL查询出来的数据!
      

  3.   

    adoquery1.close;
    adoquery1.sql.clear;
    adoquery1.sql.add('select * from 表名 where 条件');
    adoquery1.open;