我已经通过下面的代码把上面这个表做出来了,那么现在有没有办法把上面这张表里,库存为零的项目单独摘出来,放到下面的一个表中呢
此主题相关图片如下:360截图20190527145030017.jpg
Dim mc As String = e.Form.Controls("ComboBox1").text
Dim bd1 As New GroupTableBuilder("库存",DataTables("球拍入库管理"))
Dim dt1 As fxDataSource
bd1.Groups.AddDef("球拍型号") '根据型号分组
bd1.Totals.AddDef("球拍型号", AggregateEnum.Count, "库存") '对数量进行统计
bd1.Filter = "[所属经销商]='" & mc & "' And [已售]=False And [作废]= false"
dt1 = bd1.BuildDataSource()
bd1.Build
Dim bd2 As New GroupTableBuilder("总入库",DataTables("球拍入库管理"))
Dim dt2 As fxDataSource
bd2.Groups.AddDef("球拍型号") '根据型号分组
bd2.Totals.AddDef("球拍型号", AggregateEnum.Count, "入库") '对数量进行统计
bd2.Filter = "[所属经销商]='" & mc & "'"
dt2 = bd2.BuildDataSource()
bd2.Build
dt1.Combine("球拍型号",dt2,"球拍型号") '将销售统计数据组合到进货统计数据
Tables("查看库存_库存表").DataSource = dt1 '将统计结果绑定到Table
Tables("查看库存_库存表").grid.Cols("球拍型号").width = 230
Tables("查看库存_库存表").grid.Cols("库存").width = 50
Tables("查看库存_库存表").grid.Cols("入库").width = 50
Tables("查看库存_库存表").Cols("球拍型号").TextAlign = TextAlignEnum.Center
Tables("查看库存_库存表").Cols("库存").TextAlign = TextAlignEnum.Center
Tables("查看库存_库存表").Cols("入库").TextAlign = TextAlignEnum.Center
Tables("查看库存_库存表").Cols("入库").Visible = False
For Each r As Row In Tables("查看库存_库存表").rows
For Each c As Col In r.Table.cols
If c.IsNumeric AndAlso r.IsNull(c.name) Then
r(c.name) = 0
End If
Next
Next