命令窗口执行:
Dim t As Table = Tables("表A")
Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = True
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Count
g.GroupOn = "*"
g.Caption = "总计"
t.SubtotalGroups.Add(g)
t.Subtotal()
Dim r As Row = t.Rows(t.Rows.Count(True)-1, True)
Dim n As Integer = t.Compute("Count(姓名)","性别 = '男'")
r("性别") = "男:" & n & ",女:" & (t.rows.count - n)
参考:
http://www.foxtable.com/help/topics/1594.htm
http://www.foxtable.com/help/topics/1911.htm
http://www.foxtable.com/help/topics/1964.htm
[此贴子已经被作者于2013-12-13 8:35:56编辑过]