Foxtable(狐表)用户栏目专家坐堂 → 如多列统计逻辑列笔数


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

主题:如多列统计逻辑列笔数

帅哥,在线噢!
y2287958
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:4759 积分:34603 威望:0 精华:0 注册:2008/8/31 22:44:00
  发帖心情 Post By:2017/3/26 23:02:00 [显示全部帖子]

Dim cn As String = "" '数据源名(空白时为内数据表)
Dim bm As String = "统计表1"
Dim b As New SQLCrossTableBuilder(bm,"表A")
Dim d As fxDataSource
b.ConnectionName = cn
b.HGroups.AddDef("公司")
b.HGroups.AddDef("客户")
b.VGroups.AddExp("出门条", "iif(出门条=true,'出门条_有','出门条_无')")
b.Totals.AddDef("金额")
b.VerticalTotal = True
d = b.BuildDataSource()

b = New SQLCrossTableBuilder(bm,"表A")
Dim d1 As fxDataSource
b.ConnectionName = cn
b.HGroups.AddDef("公司")
b.HGroups.AddDef("客户")
b.VGroups.AddExp("送货单", "iif(送货单=true,'送货单_有','送货单_无')")
b.Totals.AddDef("金额")
b.VerticalTotal = True
d1 = b.BuildDataSource()

b = New SQLCrossTableBuilder(bm,"表A")
Dim d2 As fxDataSource
b.ConnectionName = cn
b.HGroups.AddDef("公司")
b.HGroups.AddDef("客户")
b.VGroups.AddExp("客户签字", "iif(客户签字=true,'客户签字_有','客户签字_无')")
b.Totals.AddDef("金额")
b.VerticalTotal = True
d2 = b.BuildDataSource()

Dim Cols As String = "公司|客户"
d.Combine(Cols.split("|"),d1,Cols.split("|"))
d.Combine(Cols.split("|"),d2,Cols.split("|"))
d.Show(bm)

Tables(bm).AutoSizeCols
MainTable = Tables(bm)

 回到顶部