Dim t As Table = Tables("期末_table6")
t.Cols.Frozen = 6
't.sort = "考试名称,年级,类别,学校班级"
Dim Ays As List(Of String())
Ays = t.DataTable.GetValues("考试名称|年级|类别") '列名用符号|分割
Dim jAys As List(Of String())
jAys = t.DataTable.GetValues("考试名称|年级") '列名用符号|分割
t.StopRedraw
For Each Ay As String() In Ays
Dim f As String = "考试名称='" & Ay(0) & "' And 年级='" & Ay(1) & "' and 类别='" & Ay(2) & "'"
Dim r As Row = t.AddNew()
r("考试名称") = ay(0)
r("年级") = Ay(1)
r("类别") = Ay(2)
r("汇总标识") = "汇总"
r("学校班级") = t.Compute("Count(学校班级)",f) & "班合计"
r("参考数") = t.Compute("Sum(参考数)",f)
r("语文_人平") = t.compute("sum(语总)",f)/ r("参考数")
r("数学_人平") = t.compute("sum(数总)",f)/ r("参考数")
r("总分_人平") = t.compute("sum(总分)",f)/ r("参考数")
r("语文_优秀率") = t.compute("sum(语文_优数)",f)/r("参考数")
r("数学_优秀率") = t.compute("sum(数学_优数)",f)/r("参考数")
r("语文_及格率") = t.compute("sum(语文_及数)",f)/r("参考数")
r("数学_及格率") = t.compute("sum(数学_及数)",f)/r("参考数")
If val(ay(1)) > 6
r("英语_人平") = t.compute("sum(英总)",f)/ r("参考数")
r("政治_人平") = t.compute("sum(政总)",f)/ r("参考数")
r("历史_人平") = t.compute("sum(历总)",f)/ r("参考数")
r("生物_人平") = t.compute("sum(生总)",f)/ r("参考数")
r("地理_人平") = t.compute("sum(地总)",f)/ r("参考数")
r("英语_优秀率") = t.compute("sum(英语_优数)",f)/r("参考数")
r("政治_优秀率") = t.compute("sum(政治_优数)",f)/r("参考数")
r("历史_优秀率") = t.compute("sum(历史_优数)",f)/r("参考数")
r("生物_优秀率") = t.compute("sum(生物_优数)",f)/r("参考数")
r("地理_优秀率") = t.compute("sum(地理_优数)",f)/r("参考数")
r("英语_及格率") = t.compute("sum(英语_及数)",f)/r("参考数")
r("政治_及格率") = t.compute("sum(政治_及数)",f)/r("参考数")
r("历史_及格率") = t.compute("sum(历史_及数)",f)/r("参考数")
r("生物_及格率") = t.compute("sum(生物_及数)",f)/r("参考数")
r("地理_及格率") = t.compute("sum(地理_及数)",f)/r("参考数")
End If
If val(ay(1)) >7
r("物理_人平") = t.compute("sum(物总)",f)/ r("参考数")
r("物理_优秀率") = t.compute("sum(物理_优数)",f)/r("参考数")
r("物理_及格率") = t.compute("sum(物理_及数)",f)/r("参考数")
End If
If val(ay(1)) >8
r("化学_人平") = t.compute("sum(化总)",f)/ r("参考数")
r("化学_优秀率") = t.compute("sum(化学_优数)",f)/r("参考数")
r("化学_及格率") = t.compute("sum(化学_及数)",f)/r("参考数")
End If
Next
我是用上面代码增加的汇总行,不是真正的汇总行,我想把手工增加的汇总行的用颜色的区别显示