Dim dt As DataTable = g.Build(True)
dt.DataCols.Add("折总班序",Gettype(Integer))
dt.DataCols.Add("总分班序",Gettype(Integer))
Dim Arys1 As List(Of String()) = dt.GetValues("考试名称|单位名称|年级")
For Each Ary1 As String() In Arys1
Dim drs As List(Of DataRow) = dt.Select("[考试名称] = '" & ary1(0) & "'and [年级] ='" & ary1(2) & "'", "折总平均 DESC")
For m As Integer = 0 To drs.Count - 1 '遍历所有行
If m > 0 AndAlso drs(m)("折总平均") = drs(m-1)("折总平均") Then '如果总分和上一行相同
drs(m)("折总班序") = drs(m-1)("折总班序") '则排名等于上一行
Else
drs(m)("折总班序") = m + 1 '设置排名
End If
Next
Next
wb.InsertHTML("<div style='width:100%; overflow-x:auto;'>")
With wb.AddTable("","Table1")
.attribute ="style = 'border:1px solid black;text-align:center;white-space:nowrap;font-size:12px;padding:1px;'"
.CreateFromDataTable(dt)
End With
wb.AppendHTML("<style>.fox_table th{border: 1px solid black} .fox_table td{border: 1px solid black}</style>")