Dim tp As Table = Tables("查询科目") Dim max As Integer = Tables("班级成绩").Rows.Count - 1 If max > 13 Then max = 13 Dim t As Table = Tables("优秀学生") t.StopRedraw t.addnew(max+1) For ii As Integer = 0 To tp.Rows.Count -1 Dim r As Row For i As Integer = 0 To max Tables("班级成绩").Sort = tp.Rows(ii)("学科") & " desc" r = t.rows(i) r(tp.Rows(ii)("学科") & "_班排") = Tables("班级成绩").Rows(i)(tp.Rows(ii)("学科") & "班排") r(tp.Rows(ii)("学科") & "_排名") = Tables("班级成绩").Rows(i)(tp.Rows(ii)("学科") & "排名") r(tp.Rows(ii)("学科") & "_姓名") = Tables("班级成绩").Rows(i)("姓名") r(tp.Rows(ii)("学科") & "_分数") = Tables("班级成绩").Rows(i)(tp.Rows(ii)("学科")) Tables("班级成绩").Sort = "总分" & " desc" r("总分_班排") = Tables("班级成绩").Rows(i)("总分班排") r("总分_排名") = Tables("班级成绩").Rows(i)("总分排名") r("总分_姓名") = Tables("班级成绩").Rows(i)("姓名") r("总分_分数") = Tables("班级成绩").Rows(i)("总分") Next Next t.ResumeRedraw
|