以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 请问老师代码 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=97403) |
-- 作者:guimingze -- 发布时间:2017/3/11 16:19:00 -- 请问老师代码 把 s1 = iif(s1 > "", s1, "空")
s2 = iif(s2 > "", s2, "空") 放在以下代码里的哪呢? 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(",") e.Book.Marks("分组统计字符") = "单位:" & e.DataRow("单位名称") & " 正科配备:" & sum1 & " 实际正科:" & sum2 & " 正科空缺:" & s1 & " 正科备注:" & s2 & " 副科配备:" & sum3 & " 实际副科:" & sum4 & " 副科空缺:" & s3 & " 副科备注:" & s4 End Select |
-- 作者:有点蓝 -- 发布时间:2017/3/11 16:29:00 -- 看好你自己的贴,不要重复提问题
http://foxtable.com/bbs/dispbbs.asp?boardid=2&Id=97080&page=2&star=2 |
-- 作者:guimingze -- 发布时间:2017/3/11 21:22:00 -- 回复:(有点蓝)看好你自己的贴,不要重复提问题&n... 老师 我又出现一个新的问题 若正科空缺为0 正科备注也没有 那么希望 不显示正科空缺 正科备注的字样可以实现么? 若 正科配备:1 实际正科:1 正科空缺: 正科备注: 副科配备:1 实际副科:1 副科空缺: 副科备注:
|
-- 作者:有点色 -- 发布时间:2017/3/12 20:47:00 -- 把不想显示的内容,写在 里面
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(",")
s1 = iif(s1 > "", "正科空缺:" & s1, "")
s2 = iif(s2 > "", "副科空缺:" & s2, "") e.Book.Marks("分组统计字符") = "单位:" & e.DataRow("单位名称") & " 正科配备:" & sum1 & " 实际正科:" & sum2 & " " & s1 & " " & s2 & " 副科配备:" & sum3 & " 实际副科:" & sum4 & " 副科空缺:" & s3 & " 副科备注:" & s4
End Select
|
-- 作者:guimingze -- 发布时间:2017/3/12 22:25:00 -- 回复:(有点色) 把不想显示的内容,写在 里面... 不是为空这个字符 ,而是 如果没有内容那么,就不用显示 比如“ 副科备注:” 后面有内容就显示为副科备注:wenasdffdsd 若没有内容则不用显示副科备注 |
-- 作者:有点色 -- 发布时间:2017/3/12 23:02:00 -- 认认真真看4楼代码,参考着改。 |
-- 作者:guimingze -- 发布时间:2017/4/14 11:03:00 -- 回复:(有点色)认认真真看4楼代码,参考着改。 认真看过后加红色的修改是否能达到 机关后续没有字段就不显示机关、参公事业后面没有字段就不显示参公事业 事业后面没有字段就不显示事业,之前老师给过分开的例子但是我这S7都是和在一起的啊? 如何修改呢? 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 s7 As String = "" s7 &= "机关:" & dt.GetComboListString("下属部门", filter & " and 单位性质 = \'机关\'").replace("|", ",").trim(",") & " " s7 &= "参公事业:" & dt.GetComboListString("下属部门", filter & " and 单位性质 = \'参公事业\'").replace("|", ",").trim(",") & " " s7 &= "事业:" & dt.GetComboListString("下属部门", filter & " and 单位性质 = \'事业\'").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, "") s7 = iif(s7 > "", "机关:" & s7, "") 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
|
-- 作者:有点色 -- 发布时间:2017/4/14 11:08:00 -- 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(",")
s7 &= iif(s8 > "", "机关:" & s8, "")
s7 &= iif(s9 > "", "参公事业::" & s9, "")
s7 &= iif(s10 > "", "事业:" & s10, "")
|
-- 作者:guimingze -- 发布时间:2017/4/14 14:19:00 -- 回复:(有点色) Dim s8 as strin... 如何修改呢? 老师还是实现不了啊 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 s7 As String = "" s7 &= "机关:" & dt.GetComboListString("下属部门", filter & " and 单位性质 = \'机关\'").replace("|", ",").trim(",") & " " s7 &= "参公事业:" & dt.GetComboListString("下属部门", filter & " and 单位性质 = \'参公事业\'").replace("|", ",").trim(",") & " " s7 &= "事业:" & dt.GetComboListString("下属部门", filter & " and 单位性质 = \'事业\'").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, "") s7 = iif(s7 > "", "机关:" & s7, "") 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(",") 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
|
-- 作者:有点色 -- 发布时间:2017/4/14 14:33:00 -- 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 |