本帖最后由 slfmoney 于 2009-07-15 14:16:27 编辑

解决方案 »

  1.   

    数据很多,不过有两种方式添加合计信息。
    1.使用union查询联合数据和合计数据,那么数据表现部分就不需要改动了。直接更改查询就可以了。
    2.不知你使用的是什么控件来装载数据的,好象是cell之类的,就需要把合计结果保存在变量里,操作
    控件显示就可以了。
      

  2.   

    现在问题是DATATBL初始化时显示很多字段,我现在不需要那么多只想显示几个合计信息需要的字段,但我在初始DATATBL时设了个判断,运行程序时合计信息出来了,以前的字段不需要的字段也出来了,不要的字段全是空的,我要怎么改才能让不要的字段不显示出来呢?
      if rgpDataType.ItemIndex=0 then    //这是明细查询时的字段
      begin
        SetLength(ArrTemp,43);
        ArrTemp[0]:=GetPDTFieldType('预算年度','datayear',xcShow,xcStr,80,0,1);
        ArrTemp[1]:=GetPDTFieldType('用款编号','PayId',xcHind,xcStr,35,1,1);
        ArrTemp[2]:=GetPDTFieldType('编号','NoId',xcShow,xcStr,40,2,1);
        ArrTemp[3]:=GetPDTFieldType('月份','PayMonth',xcShow,xcStr,40,3,1);
        ArrTemp[4]:=GetPDTFieldType('预算编码','Eid',xcShow,xcStr,60,4,1);
        ArrTemp[5]:=GetPDTFieldType('国标代码','ECode',xcHind,xcStr,70,5,1);
        ArrTemp[6]:=GetPDTFieldType('单位名称','EName',xcshow,xcStr,180,6,1);
        ArrTemp[7]:=GetPDTFieldType('科目编码','Bid',xcShow,xcStr,80,7,1);
        ArrTemp[8]:=GetPDTFieldType('科目名称','BName',xcShow,xcStr,150,8,1);
      //add by lhr 增加经济分类
        ArrTemp[9]:=GetPDTFieldType('经济分类编码','ekid',xcShow,xcStr,80,9,1);
        ArrTemp[10]:=GetPDTFieldType('经济分类','ekname',xcShow,xcStr,120,10,1);
        ArrTemp[11]:=GetPDTFieldType('项目编码','Iid',xcHind,xcStr,120,11,1);
        ArrTemp[12]:=GetPDTFieldType('项目名称','Iname',xcHind,xcStr,150,12,1);
        ArrTemp[13]:=GetPDTFieldType('资金性质编码','Mid',xcHind,xcStr,60,13,1);
        ArrTemp[14]:=GetPDTFieldType('资金性质','MName',xcShow,xcStr,70,14,1);
        ArrTemp[15]:=GetPDTFieldType('预算类型编码','BKid',xcHind,xcStr,60,15,1);
        ArrTemp[16]:=GetPDTFieldType('预算类型','BKName',xcShow,xcStr,80,16,1);
        ArrTemp[17]:=GetPDTFieldType('支付方式编码','Pid',xcHind,xcStr,60,17,1);
        ArrTemp[18]:=GetPDTFieldType('支付方式','PName',xcShow,xcStr,75,18,1);
        ArrTemp[19]:=GetPDTFieldType('支出类型编码','IPid',xcHind,xcStr,60,19,1);
        ArrTemp[20]:=GetPDTFieldType('支出类型','IPName',xcShow,xcStr,110,20,1);    ArrTemp[21]:=GetPDTFieldType('录入金额','PayMoney',xcShow,xcCurrency,120,21,1);
        ArrTemp[22]:=GetPDTFieldType('审核金额','CheckMoney',xcShow,xcCurrency,120,22,1);
        ArrTemp[23]:=GetPDTFieldType('批复金额','ApproveMoney',xcShow,xcCurrency,120,23,1);
        ArrTemp[24]:=GetPDTFieldType('结算方式','SettleType',xcHind,xcStr,90,24,1);
        ArrTemp[25]:=GetPDTFieldType('结算号','SettleNo',xcHind,xcStr,90,25,1);    ArrTemp[26]:=GetPDTFieldType('付款人','Payer',xcHind,xcStr,80,26,1);
        ArrTemp[27]:=GetPDTFieldType('付款银行','PayBank',xcHind,xcStr,80,27,1);
        ArrTemp[28]:=GetPDTFieldType('付款银行账号','PayBankAccount',xcHind,xcStr,80,28,1);    ArrTemp[29]:=GetPDTFieldType('收款人名称','Receiver',xcShow,xcStr,80,29,1);
        ArrTemp[30]:=GetPDTFieldType('开户银行','ReceiveBank',xcShow,xcStr,80,30,1);
        ArrTemp[31]:=GetPDTFieldType('银行账号','RecBankAccount',xcShow,xcStr,80,31,1);
        ArrTemp[32]:=GetPDTFieldType('用途','Purpose',xcShow,xcStr,120,32,1);
        ArrTemp[33]:=GetPDTFieldType('备注','Memoo',xcShow,xcStr,80,33,1);
        ArrTemp[34]:=GetPDTFieldType('会计柜台编号','BankId',xcHind,xcStr,60,34,1);
        ArrTemp[35]:=GetPDTFieldType('录入日期','InputDate',xcShow,xcStr,80,35,1);
        ArrTemp[36]:=GetPDTFieldType('录入人编码','UserId',xcHind,xcStr,60,36,1);
        ArrTemp[37]:=GetPDTFieldType('申请日期','PayDate',xcShow,xcStr,80,37,1);
        ArrTemp[38]:=GetPDTFieldType('退款标志','PayBackFlag',xcSys,xcStr,80,38,1);
        ArrTemp[39]:=GetPDTFieldType('退回标志','BackFlag',xcSys,xcStr,80,39,1);    ArrTemp[40]:=GetPDTFieldType('预拨款标志','PrePayFlag',xcSys,xcStr,80,40,1);
        ArrTemp[41]:=GetPDTFieldType('存款期限','wid',xcShow,xcStr,80,41,1);
        ArrTemp[42]:=GetPDTFieldType('存款利率','vid',xcShow,xcStr,80,42,1);  end else
      begin                              //合计时需要的字段
        SetLength(ArrTemp,8);
        ArrTemp[0]:=GetPDTFieldType('预算年度','datayear',xcShow,xcStr,80,0,1);
        ArrTemp[1]:=GetPDTFieldType('收款人名称','Receiver',xcShow,xcStr,80,29,1);
        ArrTemp[2]:=GetPDTFieldType('开户银行','ReceiveBank',xcShow,xcStr,80,30,1);
        ArrTemp[3]:=GetPDTFieldType('银行账号','RecBankAccount',xcShow,xcStr,80,31,1);
        ArrTemp[4]:=GetPDTFieldType('预算编码','Eid',xcShow,xcStr,60,4,1);
        ArrTemp[5]:=GetPDTFieldType('国标代码','ECode',xcHind,xcStr,70,5,1);
        ArrTemp[6]:=GetPDTFieldType('单位名称','EName',xcshow,xcStr,180,6,1);
        ArrTemp[7]:=GetPDTFieldType('审核合计','am',xcShow,xcCurrency,120,22,1);
      end;