基本功能演示文件中就有:
Dim t As Table = Tables("订单")
Dim g As Subtotalgroup
t.StopRedraw()
t.SubtotalGroups.Clear()
t.GroupAboveData = True
t.TreeVisible = True
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 = "{0} 合计"
t.SubtotalGroups.Add(g)
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "*"
g.TotalOn = "数量,金额"
g.Caption = "总计"
t.SubtotalGroups.Add(g)
t.Subtotal()
t.Grid.Tree.Show(1)
t.Grid.Tree.Show(0)
t.Grid.Rows(2).Node.Expanded = True
t.Grid.Rows(3).Node.Expanded = True
t.ResumeRedraw()