这样弄,如下,虽然效率不高,但,是最简便的方法。
Select Case e.DataCol.Name
Case "职称执业资格"
Dim Filter As String = "(职称 Like '*/" & e.NewValue & "/*' or 职称 like '" & e.NewValue & "/*' or 职称 like '*/" & e.NewValue & "')"
e.DataRow("总人数") = DataTables("员工档案").Compute("Count(_Identify)", Filter)
e.DataRow("男") = DataTables("员工档案").Compute("Count(_Identify)", "性别 = '男' And " & Filter)
e.DataRow("女") = DataTables("员工档案").Compute("Count(_Identify)", "性别 = '女' And " & Filter)
e.DataRow("年龄_25岁以下") = DataTables("员工档案").Compute("Count(_Identify)", "年龄 <= 25 And " & Filter)
e.DataRow("年龄_26岁至30岁") = DataTables("员工档案").Compute("Count(_Identify)", "年龄 >= 26 And 年龄 <= 30 And " & Filter)
e.DataRow("年龄_31岁至35岁") = DataTables("员工档案").Compute("Count(_Identify)", "年龄 >= 31 And 年龄 <= 35 And " & Filter)
e.DataRow("学历_博士") = DataTables("员工档案").Compute("Count(_Identify)", "最终学历 = '博士' And " & Filter)
e.DataRow("学历_硕士") = DataTables("员工档案").Compute("Count(_Identify)", "最终学历 = '硕士' And " & Filter)
e.DataRow("学历_本科") = DataTables("员工档案").Compute("Count(_Identify)", "最终学历 = '本科' And " & Filter)
End Select
[此贴子已经被作者于2012-10-22 16:23:51编辑过]