以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 分组统计 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=135505) |
-- 作者:sj67502588 -- 发布时间:2019/5/28 12:28:00 -- 分组统计 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
|
-- 作者:有点甜 -- 发布时间:2019/5/28 12:44:00 -- 方法1、直接拷贝过去,即可
http://www.foxtable.com/webhelp/scr/0680.htm
http://www.foxtable.com/webhelp/scr/1533.htm
方法2、下面的表绑定上面的表,然后筛选条件设置一下即可 |