DataTables("录入盘点汇总信息").LoadFilter="所属供应商=\'" & Forms("盘点明细表").Controls("combobox1").text & "\'"
DataTables("录入盘点汇总信息").Load()
Dim g As New CrossTableBuilder("统计表1", DataTables("录入盘点汇总信息"))
g.HGroups.AddDef("款序号")
g.HGroups.AddDef("原款号")
g.HGroups.AddDef("品名")
g.HGroups.AddDef("吊牌颜色", "颜色")
g.VGroups.AddDef("尺码序号")
g.VGroups.AddDef("尺码")
g.Totals.AddDef("录入数", "录入数")
g.Totals.AddDef("抽样数", AggregateEnum.Average, "抽样数")
g.OrderByTotal = True
g.HorizontalTotal = True
\'g.VerticalTotal = True
g.Build()
Tables("盘点明细表_Table1").DataSource =g.BuildDataSource
Tables("盘点明细表_Table1").Cols.Frozen = 2
Dim g1 As New Subtotalgroup \'定义一个新的分组
g1.GroupOn = "款序号" \'分组列为客户列
g1.TotalOn = "合计_录入数"
Dim g2 As New Subtotalgroup \'定义一个新的分组
此主题相关图片如下:无法统计.png
g2.GroupOn = "款序号" \'分组列为客户列
g2.TotalOn = "合计_抽样数"
With Tables("盘点明细表_Table1")
.SubtotalGroups.Clear() \'清除原有的分组
.SubtotalGroups.Add(g1) \'加入刚刚定义的分组
.SubtotalGroups.Add(g2) \'加入刚刚定义的分组
.Subtotal() \'生成汇总模式
End With