Dim t As Table
= Tables("订单")
Dim g As SubtotalGroup
t.SubtotalGroups.Clear()
'定义客户分组
g = New SubtotalGroup '定义一个新的分组
g.Aggregate = AggregateEnum.Sum '统计类型为求和
g.GroupOn = "客户"
'分组列为客户
g.TotalOn = "数量,金额" '统计数量和金额列
g.Caption = "{0} 小计" '设置标题
t.SubtotalGroups.Add(g) '加到分组集合中
'定义产品分组
g = New SubtotalGroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "产品"
g.TotalOn = "数量,金额"
g.Caption = "{0} 小计"
t.SubtotalGroups.Add(g)
'定义总计分组
g = New SubtotalGroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "*" '注意总计分组用符号*表示。
g.TotalOn = "数量,金额"
g.Caption = "总计"
t.SubtotalGroups.Add(g)
t.Subtotal() '生成汇总模式
按照这个模式做