Select Case e.Book.TempLate Case "横名册" Dim Filter As String = "单位名称 = '" & e.DataRow("单位名称") & "'" Dim dt As DataTable = DataTables("竖名册") Dim sum1 As Double = dt.Compute("Sum(正科配备)",Filter) Dim sum2 As Double = dt.Compute("Sum(实际正科)",Filter) Dim sum3 As Double = dt.Compute("Sum(副科配备)",Filter) Dim sum4 As Double = dt.Compute("Sum(实际副科)",Filter) Dim s1 As String = dt.GetComboListString("正科职数空缺", filter).replace("|", ",").trim(",") Dim s2 As String = dt.GetComboListString("正科职数备注", filter).replace("|", ",").trim(",") Dim s3 As String = dt.GetComboListString("副科职数空缺", filter).replace("|", ",").trim(",") Dim s4 As String = dt.GetComboListString("副科职数备注", filter).replace("|", ",").trim(",") Dim s5 As String = dt.GetComboListString("下属部门", filter).replace("|", ",").trim(",") Dim jg As String = dt.GetComboListString("下属部门", filter & " and 单位性质 = '事业'") s1 = iif(s1 > "", "正科职数空缺:" & s1, "") s2 = iif(s2 > "", "正科职数备注:" & s2, "") s3 = iif(s3 > "", "副科职数空缺:" & s3, "") s4 = iif(s4 > "", "副科职数备注:" & s4, "") Dim s8 As String = dt.GetComboListString("下属部门", filter & " and 单位性质 = '机关'").replace("|", ",").trim(",") Dim s9 As String = dt.GetComboListString("下属部门", filter & " and 单位性质 = '参公事业'").replace("|", ",").trim(",") Dim s10 As String= dt.GetComboListString("下属部门", filter & " and 单位性质 = '事业'").replace("|", ",").trim(",") Dim s7 As String = "" s7 &= iif(s8 > "", "机关:" & s8, "") s7 &= iif(s9 > "", "参公事业::" & s9, "") s7 &= iif(s10 > "", "事业:" & s10, "") e.Book.Marks("分组统计字符") = "单位:" & e.DataRow("单位名称") & "(" & s7.Trim() & ")" & Chr(13) & Chr(10) & " 正科配备:" & sum1 & " 实际正科:" & sum2 & " " & s1 & " " & s2 & Chr(13) & Chr(10) & " 副科配备:" & sum3 & " 实际副科:" & sum4 & " " & s3 & " " & s4 End Select
|