--
Tables("成绩台帐").Filter = ""
Dim Products As List(Of String)
Products = DataTables("成绩台帐").GetValues("班代码")
For Each bdm As String In Products
messagebox.show(bdm)
Tables("成绩台帐").Filter = "[班代码] = \'bdm\'"
Dim fl As String = ProjectPath & "Attachments\\" & "分数表.xls"
Dim R As Row = Tables("成绩台帐").Current
Dim Book As New XLS.Book(fl)
Dim Sheet As XLS.Sheet = Book.Sheets(1)
sheet(0,0).value = "班名称:" & R("文件名称") & R("规则号") & " 班代码: " & R("班代码")
Dim sjs As List(of String) = DataTables("成绩台帐").GetValues("课程ID","班代码 = \'" & bdm & "\'","学号,课程性质,考试单位,课程ID")
Dim x As Integer = 0
For Each sj As String In sjs
Dim dr As DataRow = DataTables("成绩台帐").find("班代码 = \'" & bdm & "\' and 课程ID = \'" & sj & "\'")
If dr IsNot Nothing Then
sheet(1,5+x).value = dr("课程名程")
sheet(2,5+x).value = dr("课程性质")
sheet(3,5+x).value = dr("考试单位")
sheet(4,5+x).value = dr("学分")
sheet(5,5+x).value = sj
sheet(6,5+x).value = dr("是否网作")
x+=1
End If
Next
Dim y As Integer = 0
Dim xms As List(of String) = DataTables("成绩台帐").GetValues("学号","班代码 = \'" & bdm & "\'")
For Each xm As String In xms
Dim dr1 As DataRow = DataTables("成绩台帐").find("学号 = \'" & xm & "\' and 班代码 = \'" & bdm & "\'")
If dr1 IsNot Nothing Then
sheet(7+y,0).value = dr1("姓名")
sheet(7+y,1).value = xm
sheet(7+y,2).value = dr1("学籍状态")
sheet(7+y,3).value = dr1("招生人")
sheet(7+y,4).value = dr1("联系方式")
For z As Integer = 5 To sjs.Count+4
Dim dr2 As DataRow = DataTables("成绩台帐").Find("学号 = \'" & xm & "\' and 课程id = \'" & sheet(5,z).value & "\'")
If dr2 IsNot Nothing Then
sheet(7+y,z).value = dr2("分数")
End If
Next
End If
y+=1
Next
Book.save(ProjectPath & "Reports\\" & R("文件名称") & "成绩台帐" & ".xls")
Tables("成绩台帐").Filter = ""
Next