Dim dt As DataTable = DataTables("职工一览表")
Dim dt2 As DataTable = DataTables("综合分类")
dt2.DataRows.Clear
Dim ss() As String = {"职称","职务"}
For Each lb As String In ss
Dim dr As DataRow= dt2.AddNew
dr("分类")="按" & lb
For Each s As String In dt.GetValues(lb,lb & " is not null")
dr = dt2.AddNew
dr("分类")=s
dr("男人数")=dt.Compute("count(姓名)", lb & "='" & s & "' and 性别='男'")
dr("女人数")=dt.Compute("count(姓名)", lb & "='" & s & "' and 性别='女'")
Next
NEXT