Dim g As New CrossTableBuilder("统计表2", DataTables("ot_list"))
g.HGroups.AddDef("人员角色")
g.HGroups.AddDef("平日休日")
g.VGroups.AddDef("加班内容")
g.Totals.AddDef("加班时间", "加班时间")
g.HorizontalTotal = True
'g.VerticalTotal = True
g.Build()
MainTable = Tables("统计表2")
Tables("form1_table1").DataSource = DataTables("统计表2")
Dim t As Table = Tables("form1_table1")
Dim g1 As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = True
g1 = New Subtotalgroup
g1.Aggregate = AggregateEnum.Sum
g1.GroupOn = "人员角色"
g1.TotalOn = "人均,总计"
g1.Caption = "{0} 小计"
t.SubtotalGroups.Add(g1)
g1 = New Subtotalgroup
g1.Aggregate = AggregateEnum.Sum
g1.GroupOn = "*"
g1.TotalOn = "人均,总计"
g1.Caption = "总计"
t.SubtotalGroups.Add(g1)
t.Subtotal()