DataTables("成绩库").StopRedraw Dim s1() As String = New String() {"总分"} Dim dt As Table = Tables("成绩库") StatusBar.Message1= "正在生成统计数据" StatusBar.ProgressBar.Visible =True StatusBar.ProgressBar.Minimum = 0 StatusBar.ProgressBar.Maximum =DataTables("成绩库").datarows.count For i As Integer = 0 To DataTables("成绩库").Datarows.count - 1 StatusBar.ProgressBar.Value = i + 1 StatusBar.Message2= "已筛选记录" & i + 1 & "条" StatusBar.Refresh() Next Functions.Execute("排名",s1,Tables("成绩库")) Functions.Execute("总分段",s1,"") Functions.Execute("分段统计",s1,dt) Functions.Execute("清零",s1,"") DataTables("成绩库").ResumeRedraw
Dim Kms() As String = Args(0) ‘内部函数名分段统计 Dim dt As Table = Args(1) Dim lms() As String = {"总分00分及以上","总分01分及以上","总分02分及以上","总分03分及以上","总分04分及以上","总分05分及以上","总分06分及以上","总分07分及以上","总分08分及以上","总分09分及以上"} For Each Km As String In Kms For Each dr As DataRow In DataTables(Km & "1分段").DataRows For Each lm As String In lms dr(lm) = dt.DataTable.Compute("Count(姓名)", "[" & km & "] >= '" & dr("分数段") + Val(lm.SubString(2,2)) & "'") Next Next Next
|