老师你好,求助修改根据产品入库单(入库类型)的动态库存查询按钮(入库类型统计)代码
Dim bd0 As New GroupTableBuilder("统计表0",DataTables("产品信息表"))
Dim dt0 As fxDataSource
bd0.Groups.AddDef("产品编号")
bd0.Groups.AddDef("产品图号规格")
bd0.FromServer = True
dt0 = bd0.BuildDataSource()
Dim bd1 As New GroupTableBuilder("统计表1",DataTables("产品入库明细表"))
Dim dt1 As fxDataSource
bd1.Groups.AddDef("产品编号")
bd1.Groups.AddDef("产品图号规格")
bd1.Filter = "[入库类型] = '生产入库 '"
bd1.Totals.AddDef("数量件","生产入库_数量件") '对数量进行统计
bd1.Totals.AddDef("重量KG","生产入库_数量KG")
bd1.FromServer = True
dt1 = bd1.BuildDataSource()
Dim bd2 As New GroupTableBuilder("统计表2",DataTables("产品入库明细表"))
Dim dt2 As fxDataSource
bd2.Groups.AddDef("产品编号")
bd2.Groups.AddDef("产品图号规格")
bd2.Filter = "[入库类型] = '采购入库 '"
bd2.Totals.AddDef("数量件","采购入库_数量件")
bd2.Totals.AddDef("重量KG","采购入库_数量KG")
bd2.FromServer = True
dt2 = bd2.BuildDataSource()
Dim bd3 As New GroupTableBuilder("统计表3",DataTables("产品入库明细表"))
Dim dt3 As fxDataSource
bd3.Groups.AddDef("产品编号")
bd3.Groups.AddDef("产品图号规格")
bd3.Filter = "[入库类型] = '来料加工入库 '"
bd3.Totals.AddDef("数量件","来料加工入库_数量件")
bd3.Totals.AddDef("重量KG","来料加工入库_数量KG")
bd2.FromServer = True
dt3 = bd3.BuildDataSource()
Dim bd4 As New GroupTableBuilder("统计表4",DataTables("产品入库明细表"))
Dim dt4 As fxDataSource
bd4.Groups.AddDef("产品编号")
bd4.Groups.AddDef("产品图号规格")
bd4.Filter = "[入库类型] = '委外加工入库 '"
bd4.Totals.AddDef("数量件","委外加工入库_数量件")
bd4.Totals.AddDef("重量KG","委外加工入库_数量KG")
bd4.FromServer = True
dt4 = bd4.BuildDataSource()
Dim nms As String() = {"产品编号","产品图号规格"} '指定连接列
dt0.Combine(nms,dt1,nms)
dt0.Combine(nms,dt2,nms) '将销售统计数据组合到进货统计数据
dt0.Combine(nms,dt3,nms)
dt0.Combine(nms,dt4,nms)
dt0.Combine(nms,dt5,nms)
此主题相关图片如下:产品入库单(入库类型)分类统计.png
此主题相关图片如下:动态产品库存表.png