以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=79868)

--  作者:王青
--  发布时间:2016/1/11 14:05:00
--  [求助]

Dim bd1 As New GroupTableBuilder("统计表1",DataTables("应收往来"))
Dim dt1 As fxDataSource
bd1.Groups.AddDef("客户") \'根据客户分组
bd1.Totals.AddDef("发货金额","应收往来_发货金额") \'对金额进行统计
dt1 = bd1.BuildDataSource()

Dim bd2 As New GroupTableBuilder("统计表2",DataTables("应收往来"))
Dim dt2  As fxDataSource
bd2.Groups.AddDef("客户") \'根据客户分组
bd2.Totals.AddDef("收款","应收往来_收款") \'对金额进行统计
dt2 = bd2.BuildDataSource()
Dim bd3 As New GroupTableBuilder("统计表3",DataTables("客户"))
Dim dt3  As fxDataSource
bd3.Groups.AddDef("客户") \'根据客户分组
bd3.Totals.AddDef("周转金","客户_周转金") \'对金额进行统计
dt3 = bd3.BuildDataSource()

dt1.Combine("客户",dt2,"客户") \'将销售统计数据组合到统计数据
dt1.Combine("客户",dt3,"客户")
Tables("应收余额_table1").DataSource = dt1 \'将统计结果绑定到Table
With DataTables("应收余额_table1").DataCols  \'用表达式列计算库存数据
    .Add("应收余额_金额",Gettype(Double), "IsNull([应收往来_发货金额],0) - ISNULL([应收往来_收款],0) -IsNull([客户_周转金],0)")
    
End With

提示An item with the same key has already been added.
是怎么回事,前两天还正常呐

--  作者:大红袍
--  发布时间:2016/1/11 15:25:00
--  

Dim bd1 As New GroupTableBuilder("统计表1",DataTables("应收往来"))
Dim dt1 As fxDataSource
bd1.Groups.AddDef("客户") \'根据客户分组
bd1.Totals.AddDef("发货金额","应收往来_发货金额") \'对金额进行统计
bd1.Totals.AddDef("收款","应收往来_收款") \'对金额进行统计
dt1 = bd1.BuildDataSource()
Dim bd3 As New GroupTableBuilder("统计表3",DataTables("客户"))
Dim dt3  As fxDataSource
bd3.Groups.AddDef("客户") \'根据客户分组
bd3.Totals.AddDef("周转金","客户_周转金") \'对金额进行统计
dt3 = bd3.BuildDataSource()

dt1.Combine("客户",dt3,"客户") \'将销售统计数据组合到统计数据
Tables("应收余额_table1").DataSource = dt1 \'将统计结果绑定到Table
With DataTables("应收余额_table1").DataCols  \'用表达式列计算库存数据
    .Add("应收余额_金额",Gettype(Double), "IsNull([应收往来_发货金额],0) - ISNULL([应收往来_收款],0) -IsNull([客户_周转金],0)")
   
End With