Dim bd1 As New GroupTableBuilder("统计表1",DataTables("进货单"))
Dim dt1 As fxDataSource
bd1.Groups.AddDef("品名") '根据品名分组
bd1.Groups.AddDef("型号") '根据型号分组
bd1.Totals.AddDef("数量","进货_数量") '对数量进行统计
bd1.Totals.AddDef("金额","进货_金额") '对金额进行统计
dt1 = bd1.BuildDataSource()
Dim bd2 As New GroupTableBuilder("统计表2",DataTables("销售单"))
Dim dt2 As fxDataSource
bd2.Groups.AddDef("品名") '根据品名分组
bd2.Groups.AddDef("型号") '根据型号分组
bd2.Totals.AddDef("数量","销售_数量") '对数量进行统计
bd2.Totals.AddDef("金额","销售_金额") '对金额进行统计
dt2 = bd2.BuildDataSource()
Dim bd3 As New GroupTableBuilder("统计表3",DataTables("退货单"))
Dim dt3 As fxDataSource
bd3.Groups.AddDef("品名") '根据品名分组
bd3.Groups.AddDef("型号") '根据型号分组
bd3.Totals.AddDef("数量","退货_数量") '对数量进行统计
bd3.Totals.AddDef("金额","退货_金额") '对金额进行统计
dt3 = bd3.BuildDataSource()
Dim nms As String() = {"品名","型号"} '指定连接列
dt1.Combine(nms,dt2,nms) '将销售统计数据组合到进货统计数据
dt1.Combine(nms,dt3,nms) '将退货统计数据组合到进货统计数据
Tables("窗口1_Table1").DataSource = dt1 '将统计结果绑定到Table
我在加进一个表示例是这样子的:
Dim bd1 As New GroupTableBuilder("统计表1",DataTables("进货单"))
Dim dt1 As fxDataSource
bd1.Groups.AddDef("品名") '根据品名分组
bd1.Groups.AddDef("型号") '根据型号分组
bd1.Totals.AddDef("数量","进货_数量") '对数量进行统计
bd1.Totals.AddDef("金额","进货_金额") '对金额进行统计
dt1 = bd1.BuildDataSource()
Dim bd2 As New GroupTableBuilder("统计表2",DataTables("销售单"))
Dim dt2 As fxDataSource
bd2.Groups.AddDef("品名") '根据品名分组
bd2.Groups.AddDef("型号") '根据型号分组
bd2.Totals.AddDef("数量","销售_数量") '对数量进行统计
bd2.Totals.AddDef("金额","销售_金额") '对金额进行统计
dt2 = bd2.BuildDataSource()
Dim bd3 As New GroupTableBuilder("统计表3",DataTables("退货单"))
Dim dt3 As fxDataSource
bd3.Groups.AddDef("品名") '根据品名分组
bd3.Groups.AddDef("型号") '根据型号分组
bd3.Totals.AddDef("数量","退货_数量") '对数量进行统计
bd3.Totals.AddDef("金额","退货_金额") '对金额进行统计
dt3 = bd3.BuildDataSource()
Dim bd4 As New GroupTableBuilder("统计表4",DataTables("货单"))
Dim dt4 As fxDataSource
bd4.Groups.AddDef("品名") '根据品名分组
bd4.Groups.AddDef("型号") '根据型号分组
bd4.Totals.AddDef("数量","退货_数量") '对数量进行统计
bd4.Totals.AddDef("金额","退货_金额") '对金额进行统计
dt4 = bd4.BuildDataSource()
Dim nms As String() = {"品名","型号"} '指定连接列
dt1.Combine(nms,dt2,nms) '将销售统计数据组合到进货统计数据
dt1.Combine(nms,dt3,nms) '将退货统计数据组合到进货统计数据
dt1.Combine(nms,dt4,nms) '将退货统计数据组合到进货统计数据
Tables("窗口1_Table1").DataSource = dt1 '将统计结果绑定到Table
通过这样的加法但是执行的时候是错误的为什么?