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")
Dim t As Table = Tables("统计表2")
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()
如题
动态插入
Tables("form1_table1").DataSource = DataTables("统计表2")
If Forms("ot_view").Opened Then '这个也不行
Tables("ot_view_Table1").DataSource = g.BuildDataSource()
End If
不显示 汇总列
[此贴子已经被作者于2016/10/11 9:59:36编辑过]