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) '加到分组集合中