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


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

主题:统计问题

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


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

 把下面的代码,写在统计按钮里,测试有效。

Dim rb1 As WinForm.RadioButton = e.Form.Controls("RadioButton1")
Dim rb2 As WinForm.RadioButton = e.Form.Controls("RadioButton2")
Dim rb3 As WinForm.RadioButton = e.Form.Controls("RadioButton3")

Dim jiange As Integer = iif(rb1.Checked, 5, iif(rb2.Checked, 10, iif(rb3.Checked, 20, 0)))
If jiange = 0 Then
    msgbox("请选择分数段")
Else
    Dim dt As DataTable = DataTables("总分细化")
    Dim dt_source As DataTable = DataTables("原始成绩")
    dt.DataRows.Clear
    Dim ndr As DataRow = dt.AddNew
    ndr("分数段_起始") = 750
    Dim max As Double = dt_source.Compute("max(总分)")
    Dim gewei As Integer = max Mod 10
    If gewei >= 5 Then 
        gewei = 5
    Else
        gewei = 0
    End If

    max = (max \ 10) * 10 + gewei
    ndr("分数段_结束") = max

    For i As Integer = max - 1 To 300 Step -1*jiange
        ndr = dt.AddNew
        ndr("分数段_起始") = i
        ndr("分数段_结束") = i - jiange
    Next
End If

 回到顶部