Dim strr As String = Args(0)
Dim kms() As String = strr.split(",")
Dim tb As Table = Args(1)
Dim pm As List(Of String()) = tb.DataTable.GetValues("年级|选做","")
Dim pmc As Integer
Dim TotalName As String
tb.Redraw = False
For Each km As String In kms
For i As Integer = 0 To pm.Count -1
If pm(i)(0) = "" Then
Continue For
End If
Dim drs As List(Of DataRow) = tb.DataTable.Select("[年级] = '" & pm(i)(0) & "'And [选做] = '" & pm(i)(1) & "'", km & " DESC") '字符型
pmc = 0
TotalName = km & "名次"
For n As Integer = 0 To drs.Count - 1
pmc = pmc +1
If n > 0 AndAlso drs(n)(km) = drs(n-1)(km) Then
drs(n)(TotalName) = drs(n-1)(TotalName)
Else
drs(n)(TotalName) = pmc
End If
Next
Next
Next
tb.Redraw = True
Functions.Execute("选做题科目名次",填入的列名(也就是函数中km),Tables("语文"))
执行函数
[此贴子已经被作者于2015/7/23 8:36:09编辑过]