Foxtable(狐表)用户栏目专家坐堂 → 大红袍老师:帮我看一下签到表打印加载哪儿出了问题?


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

主题:大红袍老师:帮我看一下签到表打印加载哪儿出了问题?

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/6/14 16:49:00 [显示全部帖子]

DataTables("考试数据表").LoadFilter = ""
DataTables("考试数据表").Load

Dim nms As String() = {"短日期","起始时间","教室"} '指定生成目录树的各列
Dim qts As String() = {"'","'","'"} '指定将各列的值括起来的符号,这里都是字符型,所以都是单引号
Dim trv As WinForm.TreeView = e.Form.Controls("签到单时间")
Dim filter As String
For Each nd As object In trv.AllNodes
    If nd.Level > 2 Then
        If nd.Checked  Then
            Dim rts() As String = nd.FullPath.Split("\")
            Dim val As String = ""
            For i As Integer = 1 To rts.length - 1
                If val > "" Then
                    val = val & " And "
                End If
                val = val & nms(i-1) & " = " & qts(i-1) & rts(i) & qts(i-1)
            Next
            If filter > "" Then
                filter = filter & " Or (" & val & ")"
            Else
                filter = val
            End If
        End If
    End If
Next

filter = filter.Replace("(","").Replace(")","")

msgbox(filter)

DataTables("考试数据表").ResumeRedraw
DataTables("考试数据表").StopRedraw
For Each ary() As String In DataTables("考试数据表").GetValues("短日期|起始时间|教室", filter)
   
    Vars("qdd1") = ary(0)
   
   
    Vars("qdd2") = ary(1)
   
   
    Vars("qdd3") = ary(2)
   

   
   
    With Tables("考试数据表")
        .Filter = "机考安排 is null and 短日期 = '" & ary(0) & "' and 起始时间 = '" & ary(1) & "' and 教室 = '" & ary(2) & "'"
        If .Rows.count > 0 Then
            .Select(0,0,.Rows.count - 1,.Cols.count - 1 )
            Dim Book As New XLS.Book(ProjectPath & "Attachments\纸考签到单.xls")
            Dim fl As String = ProjectPath & "Reports\纸考签到表\" & ary(0) & " "  & ary(1).Replace(":", "点") &  " "  &  ary(2) & "签到单.xls"
            Book.Build() '生成细节区
            Book.Save(fl) '保存工作簿
        End If
    End With
   
   
    With Tables("考试数据表")
        .Filter = "机考安排 is not null and 短日期 = '" & ary(0) & "' and 起始时间 = '" & ary(1) & "' and 教室 = '" & ary(2) & "'"
        If .Rows.count > 0 Then
            .Select(0,0,.Rows.count - 1,.Cols.count - 1 )
            Dim  book = New XLS.Book(ProjectPath & "Attachments\机考签到单.xls")
            Dim fl = ProjectPath & "Reports\机考签到表\" & ary(0) & " "  & ary(1).Replace(":", "点") &  " "  &  ary(2) & "签到单.xls"
           
            Book.Build() '生成细节区
            Book.Save(fl) '保存工作簿
        End If
    End With
   
   
   
Next                                      '结束遍历value2s的数组
DataTables("考试数据表").ResumeRedraw


 回到顶部