我尝试了查询表,反应速度有点慢,另外我想请教,我有一张出入明细表,里面记录了出库,入库,移出,移入等操作类型,用查询表可以多表查询,但怎样在统计列并排显示不同的统计数据,就比如 [(编号) (商品名称) (商品规格) (出库数) (入库数)]
此主题相关图片如下:@n30@_a8`0_$f_gzlift{8.jpg

想要这种效果:
此主题相关图片如下:tc3a3z`~xu(j3e4dwxx1n0w.png

按钮代码是:
Dim bd1 As New GroupTableBuilder("统计表1",DataTables("商品库存"))
Dim dt1 As fxDataSource
bd1.Groups.AddDef("Item") '根据型号分组
bd1.Groups.AddDef("EnglishDescription") '根据型号分组
bd1.Groups.AddDef("ChineseDescription") '根据型号分组
bd1.Groups.AddDef("EnglishBrand") '根据型号分组
bd1.Groups.AddDef("ChineseBrand") '根据型号分组
bd1.Groups.AddDef("ItemCategory") '根据型号分组
'bd1.Totals.AddDef("数量","进货_数量") '对数量进行统计
'bd1.Totals.AddDef("金额","进货_金额") '对金额进行统计
dt1 = bd1.BuildDataSource()
Dim bd2 As New GroupTableBuilder("统计表2",DataTables("出入记录"))
bd2.Filter = "[作业时间] >= # " & lbl3.value & "# and [作业时间] <= # " & lbl4.value & " # and 操作类型 = '入库'"
Dim dt2 As fxDataSource
bd2.Groups.AddDef("货品编号") '根据型号分组
'bd2.Groups.AddDef("英文描述")
'bd2.Groups.AddDef("中文描述")
'bd2.Groups.AddDef("英文名称")
'bd2.Groups.AddDef("中文名称")
'bd2.Groups.AddDef("商品类型")
bd2.Totals.AddDef("数量","入库_数量") '对数量进行统计
'bd2.Totals.AddDef("金额","销售_金额") '对金额进行统计
dt2 = bd2.BuildDataSource()
Dim bd3 As New GroupTableBuilder("统计表3",DataTables("出入记录"))
bd3.Filter = "[作业时间] >= # " & lbl3.value & "# and [作业时间] <= # " & lbl4.value & " # and 操作类型 = '出库'"
Dim dt3 As fxDataSource
bd3.Groups.AddDef("货品编号") '根据型号分组
'bd3.Groups.AddDef("英文描述")
'bd3.Groups.AddDef("中文描述")
'bd3.Groups.AddDef("英文名称")
'bd3.Groups.AddDef("中文名称")
'bd3.Groups.AddDef("商品类型")
bd3.Totals.AddDef("数量","出库_数量") '对数量进行统计
'bd2.Totals.AddDef("金额","销售_金额") '对金额进行统计
dt3 = bd3.BuildDataSource()
'Dim nms As String() = {"Item","EnglishDescription","ChineseDescription","EnglishBrand","ChineseBrand","ItemCategory"}
'Dim nmn As String() = {"货品编号","英文描述","中文描述","英文名称","中文名称","商品类型"}
'Dim mnm As String() = {"货品编号","英文描述","中文描述","英文名称","中文名称","商品类型"}
dt1.Combine("Item",dt2,"货品编号") '将销售统计数据组合到进货统计数据
dt1.Combine("Item",dt3,"货品编号") '将退货统计数据组合到进货统计数据
Tables("报表统计_Table1").DataSource = dt1 '将统计结果绑定到Table