添加统计列到Totals集合中的语法是:
Totals.AddDef(Name)
Totals.AddDef(Name, Caption)
Totals.AddDef(Name, Aggregate)
Totals.AddDef(Name, Aggregate,Caption)
参数说明
Name: 字符型,指定统计列
Caption: 字符型,指定统计列的标题
Aggregate: AggregateEnum枚举型,用于指定统计类型,默认是求和。
AggregateEnum型枚举的可选值:
Average:平均值
Count: 记录数
Max: 最大值
Min: 最小值
Sum: 累积值
b.Totals.AddDef("HistoryId",Aggregate.Max)