请指点下:代码提示出错,
此主题相关图片如下:01.png
把户类型列修改为“脱贫户”,增加“合计”列, 户类型列有:
脱贫户
脱贫不享受政策户
农户
Dim g As New GroupTableBuilder("统计表", DataTables("户信息表"))
g.Groups.AddDef("乡镇")
g.Totals.AddDef("户类型", AggregateEnum.Count)
g.Totals.AddDef("户类型", "户类型_脱贫户")
g.Totals.AddDef("户类型", "户类型_脱贫不享受政策户")
g.Totals.AddDef("户类型", "户类型_农户")
g.Totals.AddDef("易返贫致贫户监测对象类型", AggregateEnum.Count)
g.VerticalTotal = True
g.Build()
MainTable = Tables("统计表")
用交叉统计:
http://www.foxtable.com/webhelp/topics/0678.htm
Dim b As New CrossTableBuilder("统计表1",DataTables("户信息表"))
b.HGroups.AddDef("乡镇")
b.VGroups.AddDef("户类型")
b.Totals.AddDef("户类型",AggregateEnum.Count)
b.Totals.AddDef("易返贫致贫户监测对象类型",AggregateEnum.Count)b.Build '生成统计表
Maintable = Tables("统计表1") '打开生成的统计表
每一类增加“合计列”,最后一行再增加“合计行”怎么增加?
如下代码生成的统计表看着有点杂乱,想达到图片03的效果怎么办?
Dim b As New CrossTableBuilder("统计表", DataTables("户信息总表"))
b.HGroups.AddDef("乡镇")
b.VGroups.AddDef("户类型", "脱贫户")
b.VGroups.AddDef("易返贫致贫户监测对象类型")
b.Totals.AddDef("户类型", AggregateEnum.Count)
b.Totals.AddDef("易返贫致贫户监测对象类型", AggregateEnum.Count)
b.Subtotal = True '生成汇总模式
B.SubtotalLevel = 0 '只生成总计行
b.Build '生成统计表
Maintable = Tables("统计表") '打开生成的统计表
[此贴子已经被作者于2024/3/1 16:41:35编辑过]