Dim Values() As String = {"总分"}
Dim s1() As String = New String() {"总分"}
Dim dt As Table = Tables("成绩库")
StatusBar.Message1= "正在生成统计数据"
For Each Value As String In Values
Dim nj As String = e.Form.Controls("年级").text '统计年级
Dim tjlb As String = e.Form.Controls("类别").text '统计类别
Dim bm As String = Value & "重点人数对照表"
Dim dtb As New DataTableBuilder(bm)
dtb.AddDef("单位",Gettype(String),8)
dtb.AddDef("统计类别",Gettype(String),8)
For Each tjbb As String In DataTables("成绩库").GetValues("部别","[年级] = '" & nj & "'And [类别] = '"& tjlb &"'")
Dim c1 As Double = nj
Dim c2 As Double = nj-1
Dim c3 As Double = nj-2
Dim tjnjs() As String = {"" & c3 &" ","" & c2 & "","" & c1 & ""}
For Each tjnj As String In tjnjs
dtb.AddDef( tjbb & tjnj &"",Gettype(Double),"",tjbb &"_"& tjnj & "级")
dtb.AddDef( "合计"& tjnj &"",Gettype(Double),"","合 计_"& tjnj & "级")
dtb.Build()
Next
Next
Next
'e.Form.Controls("Label1").text ="统计结束,请导出数据!否则数据会丢失!"
StatusBar.Reset
StatusBar.DefaultMessage = "统计完毕!"
'Time1 = Date.Now
'e.Form.Controls("Label4").text="耗时 " & (Time1-Time).TotalSeconds & " 秒"
Tables("成绩库").ResumeRedraw
错误提示:名为“合计2018 ”的列已属于此 DataTable。