Dim bb As New SQLGroupTableBuilder("国考秩序册","国开课程表")
bb.Groups.AddDef("考试地址")
bb.Groups.AddDef("日期")
bb.Groups.AddDef("时间")
bb.Groups.AddDef("试卷号")
bb.Groups.AddDef("保密号")
bb.Totals.AddExp("人数","1")
bb.Build
MainTable = Tables("国考秩序册")
Output.Show(Date.Now)
For Each arrr As DataRow In DataTables("国考秩序册").Select("试卷号 is not null")
Dim ar3 As DataRow
ar3 = DataTables("国开秩序安排").AddNew()
ar3("考试地址") = arrr("考试地址")
ar3("日期") = arrr("日期")
ar3("时间") = arrr("时间")
ar3("试卷号") = arrr("试卷号")
ar3("保密号") = arrr("保密号")
ar3("人数") = arrr("人数")
Dim dr11 As DataRow
If ar3.IsNull("保密号") = False Then
dr11 = DataTables("国开课程表").find("保密号 = '" & ar3("保密号") & "'")
Else
dr11 = DataTables("国开课程表").find("试卷号 = '" & ar3("试卷号") & "'")
End If
If dr11 IsNot Nothing Then
ar3("考试地址") = dr11("考试地址")
ar3("试卷名称") = dr11("试卷名称")
ar3("考试类型") = dr11("考试类型")
ar3("短日期") = dr11("短日期")
ar3("考场号") = dr11("考场号")
ar3("是否留考") = dr11("是否留考")
ar3("考场号") = dr11("考场号")
ar3("起始时间") = dr11("起始时间")
ar3("结束时间") = dr11("结束时间")
ar3("时长") = dr11("时长")
End If
Next
Output.Show(Date.Now)
Tables("国开秩序安排").Sort = "短日期,起始时间,人数"
Dim Book2 As New XLS.Book(ProjectPath & "Attachments\国考秩序安排教室.xls ")
Dim fl1 As String = ProjectPath & "Reports\国考秩序供安排之用教室.xls"
Book2.Build() '生成细节区
Book2.Save(fl1) '保存工作簿
Output.Show(Date.Now)
Forms("国考考场编排建议").OPEN