Dim t As Table = Tables("配件销售出库明细")
Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = True
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 = "总计"
g.upto = True
t.SubtotalGroups.Add(g)
t.Subtotal()