Dim t As Table = Tables("销售毛利明细表_Table1")
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)
t.Subtotal()
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "*" \'注意总计分组用符号*表示.
g.TotalOn = "重量,销售金额,成本单价,成本金额,销售毛利"
g.Caption = "总计"
t.SubtotalGroups.Add(g)
t.Subtotal() \'生成汇总模式