Foxtable(狐表)用户栏目专家坐堂 → 汇总统计


  共有2866人关注过本帖树形打印复制链接

主题:汇总统计

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/5/20 19:10:00 [显示全部帖子]

 试试这样

 

Dim t As Table = Tables("融资组合查询_TABLE1")
Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = True
t.TreeVisible = True
t.SpillNode = True

g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "备案单位"
Dim TotalOn As String = ""
For Each c As Col In t.cols
   If c.name.StartsWith("还款金额_") Then
        totalOn &= c.name & ","
   End If
Next
g.TotalOn = TotalOn & "合计"

'g.TotalOn = "还款金额_1,还款金额_2,还款金额_3,还款金额_4,还款金额_5,还款金额_6,还款金额_7,还款金额_8,还款金额_9,还款金额_10,还款金额_11,还款金额_12,合计"
g.Caption = "{0} 小计"
t.SubtotalGroups.Add(g)

g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "*"
For Each c As Col In t.cols
   If c.name.StartsWith("还款金额_") Then
        totalOn &= c.name & ","
   End If
Next
g.TotalOn = TotalOn & "合计"

'g.TotalOn = "还款金额_1,还款金额_2,还款金额_3,还款金额_4,还款金额_5,还款金额_6,还款金额_7,还款金额_8,还款金额_9,还款金额_10,还款金额_11,还款金额_12,合计"
g.Caption = "总计"
t.SubtotalGroups.Add(g)

t.Subtotal()


 回到顶部