以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 分类统计修改统计类别,统计列不会改变 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=161122) |
-- 作者:sjf0823 -- 发布时间:2021/3/6 23:44:00 -- 分类统计修改统计类别,统计列不会改变 Select Case e.DataCol.Name Case "请假类型", "调休","事假","病假","出差","婚假","产假","陪产假","年假","其他","迟到","缺卡","旷工" Dim dr As DataRow = e.DataRow If dr.IsNull("请假类型") Then dr("调休") = Nothing dr("事假") = Nothing dr("病假") = Nothing dr("出差") = Nothing dr("婚假") = Nothing dr("产假") = Nothing dr("陪产假") = Nothing dr("年假") = Nothing dr("其他") = Nothing dr("迟到") = Nothing dr("缺卡") = Nothing dr("旷工") = Nothing End If Dim str() As String = {"请假类型"} For Each c As String In str If e.DataRow(c) Like "*调休*" Then e.DataRow("调休") = dr("请假时长") End If If e.DataRow(c) Like "*事假*" Then e.DataRow("事假") = dr("请假时长") End If If e.DataRow(c) Like "*病假*" Then e.DataRow("病假") = dr("请假时长") End If If e.DataRow(c) Like "*出差*" Then e.DataRow("出差") = dr("请假时长") End If If e.DataRow(c) Like "*年假*" Then e.DataRow("年假") = dr("请假时长") End If If e.DataRow(c) Like "*婚假*" Then e.DataRow("婚假") = dr("请假时长") End If If e.DataRow(c) Like "*产假*" Then e.DataRow("产假") = dr("请假时长") End If If e.DataRow(c) Like "*陪产假*" Then e.DataRow("陪产假") =dr("请假时长") End If If e.DataRow(c) Like "*其他*" Then e.DataRow("其他") = dr("请假时长") End If If e.DataRow(c) Like "*迟到*" Then e.DataRow("迟到") = dr("请假时长") End If If e.DataRow(c) Like "*缺卡*" Then e.DataRow("缺卡") =dr("请假时长") End If If e.DataRow(c) Like "*旷工*" Then e.DataRow("旷工") = dr("请假时长") End If Next End Select 老师帮我看下这个代码,我修改请假类型列,统计的不会随着我改变请假类型变化,例如请假类型是调休,调休列为1,我改变请假类型为事假,则调休的1不会自动删掉
|
-- 作者:sjf0823 -- 发布时间:2021/3/6 23:50:00 -- 老师,搞定了,我忘记加else |