数量,金额回统计了,,后面的库存不会汇总小计和总计,,需要加代码到哪里呢
Dim bd1 As New GroupTableBuilder("统计表1", DataTables("采购入库"))
Dim dt1 As fxDataSource
bd1.Groups.AddDef("品牌") '根据型号分组
bd1.Groups.AddDef("型号")
bd1.Groups.AddDef("单价")
bd1.Totals.AddDef("数量", "进货_数量") '对数量进行统计
bd1.Totals.AddDef("金额", "进货_金额") '对金额进行统计
bd1.FromServer = True
bd1.Subtotal = True
bd1.SubtotalLevel = 1
dt1 = bd1.BuildDataSource()
Tables("统计_Table1").DataSource = dt1 '将统计结果绑定到Table
Tables("统计_Table1").cols("型号").width = 120
With DataTables("统计_Table1").DataCols '用表达式列计算库存数据
.Add("库存_数量", GetType(Integer), "IsNull([进货_数量],0)")
.Add("库存_金额", GetType(Double), "[库存_数量] /[进货_数量] * [进货_金额]")
End With
此主题相关图片如下:1667997481192.png