绑定后,直接对窗口表设置汇总模式即可,这个和普通的表是一回事:
Dim g As New GroupTableBuilder("test001", DataTables("产生表"))
g.Caption = "公司总收入"
g.Groups.AddDef("报告出具时间", DateGroupEnum.Year, "年")
g.Groups.AddDef("报告出具时间", "月")
g.Totals.AddDef("实际收入")
g.Decimals = 0
g.Filter = "SubString(Convert([报告出具时间],'System.String'),1,4) > 2011"
Dim t As Table = Tables("总表_table1")
t.DataSource = g.BuildDatasource()
Dim g1 As New Subtotalgroup '定义一个新的分组
g1.Aggregate = AggregateEnum.Sum '统计类型为求和
g1.GroupOn = "公司总收入" '分组列为客户列
g1.TotalOn = "数量,金额" '对数量和金额进行统计
g1.Caption = "{0} 小计" '设置标题
t.SubtotalGroups.Add(g1)
....
t.subtotal
如果设置汇总模式,参考:
http://www.foxtable.com/help/topics/1372.htm