Foxtable(狐表)用户栏目专家坐堂 → 交叉统计的时间统计


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

主题:交叉统计的时间统计

美女呀,离线,留言给我吧!
susu312
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:997 积分:6752 威望:0 精华:0 注册:2018/6/8 16:17:00
交叉统计的时间统计  发帖心情 Post By:2018/8/10 16:10:00 [只看该作者]

Dim nums1() As String={"sex","age","birth", _
"edu","workdate","politicalStatus", _
"retiredPost","title","leaOrRetire", _
"retireTime","proTecPost","partyTime", _
"organName","partyStanding","retiredDep"}
Dim nums2()  As String={"性别","年龄","出生年月", _
"学历","参加工作日期","政治面貌", _
"离退休职务","享受待遇","状态", _
"离退休时间","专业技术职务","入党时间", _
"单位","党龄","部门"}

 
 
Dim b As New SQLCrossTableBuilder("统计表1","person")
b.C
For Each r As Row In Tables("统计1").Rows
   If r.IsNull("分组列")=False Then
      Dim index As Integer=Array.indexof(nums2,r("分组列"))
      b.HGroups.AddDef(nums1(index),r("日期分组"),r("分组列"))'添加列用于水平分组 
   End If
Next

For Each r As Row In Tables("统计2").Rows
  If r.IsNull("分组列")=False Then
    Dim index As Integer=Array.indexof(nums2,r("分组列"))
    If r.IsNull("日期分组")=False And  r.IsNull("模式")=False  Then
        b.VGroups.AddDef(nums1(index),r("日期分组"), r("模式"))
    ElseIf  r.IsNull("日期分组")=False And  r.IsNull("模式")=True  Then 
        b.VGroups.AddDef(nums1(index),r("日期分组"))
    ElseIf  r.IsNull("日期分组")=True And  r.IsNull("模式")=False  Then 
        b.VGroups.AddDef(nums1(index),r("模式"))
    Else
        b.VGroups.AddDef(nums1(index))   '添加列用于垂直分组
    End If
 End If
Next

For Each r As Row In Tables("统计3").Rows
  If r.IsNull("统计列")=False Then
      Dim index As Integer=Array.indexof(nums2,r("统计列"))
      b.Totals.AddDef(nums1(index), AggregateEnum.Count) '添加列用于统计
  End If
Next

If e.Form.Controls("CheckBox1").Checked = True Then   '水平方向生成汇总
    b.HorizontalTotal = True
End If

If e.Form.Controls("CheckBox2").Checked = True Then   '垂直方向生成汇总
    b.VerticalTotal = True
End If
b.Build '生成统计表

 

 

 


图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看

 

 

老师,我的确定按钮的代码如上,

 

输入内容如图,

但是报错,请老师帮忙看一下


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/8/10 16:57:00 [只看该作者]

要继续判断

 

If r("日期分组") = "年" Then

    b.VGroups.AddDef(nums1(index), DateGroup.Year, r("模式"))

ElseIf r("日期分组") = "月" Then 

    b.VGroups.AddDef(nums1(index), DateGroup.Month, r("模式"))

End If


 回到顶部