Selec t Case e.Path
Case "kcb.htm"
' Dim cmd As New SQLCommand
' Dim cpxx As DataTable
' Dim rkmx As DataTable
' Dim ckmx As DataTable
' cmd.C
' cmd.CommandText = "Select 类别,库存编码,产品名称,规格,单位,商标,备注,期初库存 F ROM {产品信息}"
' cpxx = cmd.ExecuteReader()
' Dim bd1 As New GroupTableBuilder("统计表1", cpxx)
Dim cpxx As String = "Select 类别,库存编码,产品名称,规格,单位,商标,备注,期初库存 F ROM {产品信息}"
Dim bd1 As New GroupTableBuilder("统计表1", cpxx, "sale")
Dim dt1 As fxDataSource
bd1.Groups.AddDef("类别")
bd1.Groups.AddDef("库存编码") '根据型号分组
bd1.Groups.AddDef("产品名称")
bd1.Groups.AddDef("规格")
bd1.Groups.AddDef("单位")
bd1.Groups.AddDef("商标")
bd1.Groups.AddDef("备注")
bd1.Totals.AddDef("期初库存", "期初库存数量") '对数量进行统计
dt1 = bd1.BuildDataSource()
' cmd.CommandText = "Select 类别,库存编码,产品名称,规格,单位,商标,备注,入库数量 F ROM {入库明细} "
' rkmx = cmd.ExecuteReader()
' Dim bd2 As New GroupTableBuilder("统计表2", rkmx)
Dim rkmx As String = "Select 类别,库存编码,产品名称,规格,单位,商标,备注,入库数量 F ROM {入库明细}"
Dim bd2 As New GroupTableBuilder("统计表2", rkmx, "sale")
Dim dt2 As fxDataSource
bd2.Groups.AddDef("类别")
bd2.Groups.AddDef("库存编码") '根据型号分组
bd2.Groups.AddDef("产品名称")
bd2.Groups.AddDef("规格")
bd2.Groups.AddDef("单位")
bd2.Groups.AddDef("商标")
bd2.Groups.AddDef("备注")
bd2.Totals.AddDef("入库数量", "入库数量") '对数量进行统计
dt2 = bd2.BuildDataSource()
' cmd.CommandText = "Select 类别,库存编码,产品名称,规格,单位,商标,备注,出库数量 F ROM {出库明细} "
' ckmx = cmd.ExecuteReader()
' Dim bd3 As New GroupTableBuilder("统计表3", ckmx)
Dim ckmx As String = "Select 类别,库存编码,产品名称,规格,单位,商标,备注,出库数量 F ROM {出库明细}"
Dim bd3 As New GroupTableBuilder("统计表3", ckmx, "sale")
Dim dt3 As fxDataSource
bd3.Groups.AddDef("类别")
bd3.Groups.AddDef("库存编码") '根据型号分组
bd3.Groups.AddDef("产品名称")
bd3.Groups.AddDef("规格")
bd3.Groups.AddDef("单位")
bd3.Groups.AddDef("商标")
bd3.Groups.AddDef("备注")
bd3.Totals.AddDef("出库数量", "出库数量") '对数量进行统计
dt3 = bd3.BuildDataSource()
Dim nms As String() = { "库存编码", "产品名称", "规格", "单位", "商标", "备注"}
dt1.Combine(nms, dt2, nms)
dt1.Combine(nms, dt3, nms) '将退货统计数据组合到进货统计数据
dt1.Show("当前库存") '显示统计结果
MainTable = Tables("当前库存")
msgbox(123)
With DataTables("当前库存").DataCols '用表达式列计算库存数据
.Add("库存数量", GetType(Integer), "IsNull([期初库存数量],0) + IsNull([入库数量],0) - ISNULL([出库数量],0)")
End With
msgbox(456)
End Selec t