不展开目录树,只需一行代码:
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(0)
t.ResumeRedraw()