Foxtable(狐表)用户栏目专家坐堂 → 汇总后不需要排序


  共有9839人关注过本帖平板打印复制链接

主题:汇总后不需要排序

帅哥哟,离线,有人找我吗?
don
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1812 积分:12993 威望:0 精华:14 注册:2008/10/11 18:07:00
  发帖心情 Post By:2011/12/26 13:56:00 [只看该作者]

http://www.foxtable.com/help/topics/1372.htm

自定义排序

在默认情况下,Subtotal方法会根据分组列进行排序,然后再生成汇总模式。
Subtotal有一个可选参数,如果将其设置为True,那么在生成汇总模式时,可以自定义排序参数,而不是根据分组列排序。
例如根据日期和客户排序,分组列为客户,统计列为数量与金额,生成汇总模式:

Dim t As Table = Tables("订单")
Dim
g As Subtotalgroup
t
.SubtotalGroups.Clear()
g = New Subtotalgroup
g
.Aggregate = AggregateEnum.Sum
g
.GroupOn = "客户"
g
.TotalOn = "数量,金额"
g
.Caption = "{0} 小计"
t
.SubtotalGroups.Add(g)
g = New Subtotalgroup
g
.Aggregate = AggregateEnum.Sum
g
.GroupOn = "*"
g
.TotalOn = "数量,金额"
g
.Caption = "总计"
t
.SubtotalGroups.Add(g)
t.Sort =
"日期,客户" '指定排序字段
t.Subtotal(
True) '生成汇总模式


 回到顶部