Foxtable(狐表)用户栏目专家坐堂 → [求助]交叉统计设置


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

主题:[求助]交叉统计设置

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


加好友 发短信
等级:狐神 帖子:4752 积分:34568 威望:0 精华:0 注册:2008/8/31 22:44:00
  发帖心情 Post By:2016/11/12 12:44:00 [显示全部帖子]

我更喜欢这么搞

Dim bm As String = "统计"
Dim jb1 As New SQLJoinTableBuilder(bm,"表A")
jb1.AddCols("年","周","组别","'人数' As 分类","人数 as aa")

Dim jb2 As New SQLJoinTableBuilder(bm,"表A")
jb2.AddCols("年","周","组别","'产能' As 分类","产能 as aa")

Dim jb3 As New SQLJoinTableBuilder(bm,"表A")
jb3.AddCols("年","周","组别","'排单量' As 分类","排单量 as aa")

jb1.Union(jb2)
jb1.Union(jb3)
jb1.Build()

Dim b As New CrossTableBuilder(bm,jb1.BuildSql )
b.HGroups.AddDef("年") 
b.HGroups.AddDef("周") 
b.HGroups.AddDef("分类")
b.VGroups.AddDef("组别")
b.Totals.AddDef("aa")
b.Build
Tables(bm).AutoSizeCols
Tables(bm).MergeMode = MergeModeEnum.Standard
Tables(bm).MergeCols.Clear()
Tables(bm).MergeCols.Add("年")
Tables(bm).MergeCols.Add("周")
Tables(bm).MergeSort = "年,周"
Tables(bm).AllowMerge = True
MainTable = Tables(bm)


 回到顶部