Dim s As String
Dim t As Table = Tables("统计汇总")
Dim g As New CrossTableBuilder("统计汇总", DataTables("绩效计划表"))
g.Caption = "统计汇总"
g.HGroups.AddDef("年度")
g.HGroups.AddDef("季度")
g.VGroups.AddDef("分管领导")
g.Totals.AddDef("权重", "权重")
g.Totals.AddDef("实际得分", "实际得分")
g.Decimals = 2
g.Build()
For Each c As col In t.cols
If c.name <> "年度" AndAlso c.name <> "季度" Then
s+ = "," & c.name
End If
Next
Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = True
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Average
g.GroupOn = "年度"
g.TotalOn = s.trim(",")
g.Caption = "{0}年 平均"
t.SubtotalGroups.Add(g)
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Average
g.GroupOn = "*"
g.TotalOn =s.trim(",")
g.Caption = "总平均"
t.SubtotalGroups.Add(g)
t.Subtotal()
MainTable = t
[此贴子已经被作者于2011-9-2 17:24:25编辑过]