Foxtable(狐表)用户栏目专家坐堂 → 如何从字符型列数据中自动读出其它列数据?


  共有1979人关注过本帖树形打印复制链接

主题:如何从字符型列数据中自动读出其它列数据?

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/8/9 9:16:00 [显示全部帖子]

DataColChanged

 

Select Case e.DataCol.name
    Case "案号"
        Dim str As String = e.DataRow("案号")
        Dim mc = System.Text.RegularExpressions.Regex.Matches(str, "(?<=\()[0-9]+?(?=\))")
        If mc.count>0 Then
            e.DataRow("年度列") = mc(0).value
        Else
            e.DataRow("年度列") = Nothing
        End If
        If str.Contains("民初") Then
            e.DataRow("类别") = "AMC"
        ElseIf str.Contains("民监")Then
            e.DataRow("类别") = "AMJ"
        ElseIf str.Contains("民申") Then
            e.DataRow("类别") = "AMS"
        Else
            e.DataRow("类别") = Nothing
        End If
    Case "年度列"
        If e.DataRow("年度列") > "" AndAlso e.DataRow("年度列").length >= 4 Then
            Dim bh As String = e.DataRow("年度列").Substring(2) & Format(Date.Today, "MMdd")
            If e.DataRow("流水号").contains(bh) = False Then
                Dim max As String = e.DataTable.Compute("max(流水号)", "流水号 like '" & bh & "%'")
                Dim i As Integer = 1
                If max > "" Then
                    i = max.SubString(bh.Length)+11
                End If
                e.DataRow("流水号") = bh & format(i, "0000")
            End If
        End If
End Select


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/8/9 16:11:00 [显示全部帖子]

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:test (1).table

http://www.runoob.com/regexp/regexp-syntax.html

 


 回到顶部