Dim b As New GroupTableBuilder("统计表1",DataTables("表B"))
Dim dt1 As fxDataSource
b.Groups.AddDef("产品编号") '根据产品分组
b.Totals.AddDef("产品数量",AggregateEnum.Sum,"产品数量")
b.Totals.AddDef("产品销售金额",AggregateEnum.Sum,"产品销售金额汇总")
dt1 = b.BuildDataSource()
Dim b2 As New GroupTableBuilder("统计表1",DataTables("表A"))
Dim dt2 As fxDataSource
b2.Groups.AddDef("产品编号") '根据产品分组
b2.Totals.AddDef("产品数量",AggregateEnum.Sum,"产品数量")
b2.Totals.AddDef("产品销售金额",AggregateEnum.Sum,"产品销售金额汇总")
dt2= b.BuildDataSource()
dt1.Combine("产品编号",dt2,"产品编号")