Foxtable(狐表)用户栏目专家坐堂 → [求助]试卷袋编号问题


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

主题:[求助]试卷袋编号问题

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


加好友 发短信
等级:七尾狐 帖子:1695 积分:10725 威望:0 精华:0 注册:2009/10/25 16:45:00
  发帖心情 Post By:2013/1/13 0:15:00 [显示全部帖子]

DataTables("成绩库").StopRedraw
Dim Values() As String = {"考室"}
For Each Value As String In Values
    Dim dtb As New DataTableBuilder(value & "统计")
    dtb.AddDef("单位",Gettype(String),8)
    dtb.AddDef("参考人数",Gettype(Double))
    dtb.AddDef("考室数",Gettype(Double))
    dtb.AddDef("试卷袋起号",Gettype(Double))
    dtb.AddDef("试卷袋止号",Gettype(Double))
    dtb.AddDef("试卷袋编号",Gettype(String))
    dtb.Build()
    Tables("成绩库").Visible = True
    Dim f As New Filler
    f.SourceTable = DataTables("成绩库") '指定数据来源
    f.SourceCols = "单位" '指定数据来源列
    f.DataTable = DataTables(  value & "统计" )'指定数据接收表
    f.DataCols = "单位" '指定数据接收列
    f.Fill() '填充数据
Next
For Each bm As DataTable In DataTables
    For Each dr As DataRow In DataTables(bm.name).DataRows
        If bm.name = "考室统计"
            dr("参考人数") = DataTables("成绩库").Compute("count(单位)", "[单位] = '" & dr("单位") & "'")
            dr("考室数") = DataTables("成绩库").Compute("Max(考室)", "[单位] = '" & dr("单位") & "'")
           
        End If
    Next
Next

For i As Integer = 0 To Tables("考室统计").count - 1
    Dim r As Row = Tables("考室统计").Rows(i)
    If i = 0
        r("试卷袋起号") = 1
    Else
        r("试卷袋起号") = Tables("考室统计")(i-1,"考室数") + Tables("考室统计")(i-1,"试卷袋起号")
    End If
    r("试卷袋止号") = r("考室数") + r("试卷袋起号") -1
    r("试卷袋编号") = r("试卷袋起号") & "-" & r("试卷袋止号")
Next
MainTable =  Tables("考室统计")
DataTables("成绩库").ResumeRedraw
DataTables("成绩库").ResumeRedraw

 


 回到顶部