Foxtable(狐表)用户栏目专家坐堂 → 关于XML的问题,初学,请发代码学习


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

主题:关于XML的问题,初学,请发代码学习

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


加好友 发短信
等级:超级版主 帖子:106242 积分:540333 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/3/11 23:13:00 [只看该作者]

ndr("税号") = dr.GetAttribute ("NSRSBH")

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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/13 9:22:00 [只看该作者]

Dim db3 As WinForm.DropDownBox = e.Form.Controls("DropBox3")
Dim dzml3 As String = db3.text
For Each f As String In FileSys.GetFiles(dzml3)
    Tables("表C").StopRedraw
    Dim strs As String = FileSys.ReadAllText(f,Encoding.Default)
    strs = strs.Replace(vblf,"")
    Dim rs() As String = strs.Split(vbcr)
    For i As Integer = 3 To rs.Length - 1
        Dim cs() As String = rs(i).replace("~~","~").Split("~")
        If cs.Length = 9 Then
            If DataTables("表c").Find("名称 = '" & cs(1) & "'and 税号 = '" & cs(3) & "'") Is Nothing Then
                    Dim dr As DataRow = DataTables("表C").Addnew()
                    dr("名称") = cs(1)
                    dr("税号") = cs(3)
                    dr("地址电话") = cs(4)
                    dr("银行账号") = cs(5)
            End If
        End If
    Next
    Tables("表C").ResumeRedraw
Next
For Each f As String In FileSys.GetFiles(dzml3)
    If f.EndsWith(".xml") Then
        Dim txt As String = FileSys.ReadAllText(f, Encoding.Default)
        Dim xmlDoc As New System.XML.XmlDocument
        xmlDoc.Loadxml(txt.Trim)
        Dim ndList  = xmlDoc.GetElementsByTagName("Row")
        For Each dr As object In ndlist
            Dim ndr As DataRow = DataTables("表C").find("名称 = '" & dr.Attributes("MC").value  & "'and 税号 = '" & dr.Attributes("NSRSBH").value  & "'")
            If ndr Is Nothing Then ndr = DataTables("表C").addnew
            ndr("名称") = dr.GetAttribute("MC")
            ndr("税号") = dr.GetAttribute("NSRSBH")
            ndr("地址电话") = dr.GetAttribute("DZ")
            ndr("银行账号")  = dr.GetAttribute("YHZH")
        Next
    End If
Next
DataTables("表c").DeleteFor("名称 Is Null   And 税号 Is Null   And 地址电话 Is Null  And 银行账号 Is Null ")

 

.NET Framework 版本:2.0.50727.8800
Foxtable 版本:2018.10.9.1
错误所在事件:窗口,窗口1,Button2,Click
详细错误信息:
未设置对象变量或 With 块变量。

这是怎么回事

 

 


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/3/13 10:45:00 [只看该作者]

 

xml文件和你的程序,一起发上来测试。

 


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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/13 10:50:00 [只看该作者]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:foxtable项目.rar

 

如果名称和稅号一样则不加载

[此贴子已经被作者于2019/3/13 10:50:42编辑过]

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/3/13 11:29:00 [只看该作者]

Dim db3 As WinForm.DropDownBox = e.Form.Controls("DropBox3")
Dim dzml3 As String = db3.text '"C:\Users\dv rrxaI600 007\Downloads\foxtable项目\客户编码\"
For Each f As String In FileSys.GetFiles(dzml3)
    If f.EndsWith(".txt") Then
        Tables("表C").StopRedraw
        Dim strs As String = FileSys.ReadAllText(f,Encoding.Default)
        strs = strs.Replace(vblf,"")
        Dim rs() As String = strs.Split(vbcr)
        For i As Integer = 3 To rs.Length - 1
            Dim cs() As String = rs(i).replace("~~","~").Split("~")
            If cs.Length = 9 Then
                If DataTables("表c").Find("名称 = '" & cs(1) & "'and 税号 = '" & cs(3) & "'") Is Nothing Then
                    Dim dr As DataRow = DataTables("表C").Addnew()
                    dr("名称") = cs(1)
                    dr("税号") = cs(3)
                    dr("地址电话") = cs(4)
                    dr("银行账号") = cs(5)
                End If
            End If
        Next
        Tables("表C").ResumeRedraw
    End If
Next
For Each f As String In FileSys.GetFiles(dzml3)
    If f.EndsWith(".xml") Then
        Dim txt As String = FileSys.ReadAllText(f, Encoding.Default)
        Dim xmlDoc As New System.XML.XmlDocument
        xmlDoc.Loadxml(txt.Trim)
        Dim ndList  = xmlDoc.GetElementsByTagName("Row")
        For Each dr As object In ndlist
            If dr.Attributes("NSRSBH") IsNot Nothing Then
                Dim ndr As DataRow = DataTables("表C").find("名称 = '" & dr.Attributes("MC").value  & "' and 税号 = '" & dr.Attributes("NSRSBH").value  & "'")
                If ndr Is Nothing Then ndr = DataTables("表C").addnew
                ndr("名称") = dr.GetAttribute("MC")
                ndr("税号") = dr.GetAttribute("NSRSBH")
                ndr("地址电话") = dr.GetAttribute("DZ")
                ndr("银行账号")  = dr.GetAttribute("YHZH")
            End If
        Next
    End If
Next
DataTables("表c").DeleteFor("名称 Is Null   And 税号 Is Null   And 地址电话 Is Null  And 银行账号 Is Null ")

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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/13 15:09:00 [只看该作者]

Dim db1 As WinForm.DropDownBox = e.Form.Controls("DropBox1")
Dim db2 As WinForm.DropDownBox = e.Form.Controls("DropBox2")
Dim dzml1 As String = db1.text
Dim dzml2 As String = db2.text
For Each f As String In FileSys.GetFiles(dzml2)
    If f.EndsWith(".xml") Then
        Dim txt As String = FileSys.ReadAllText(f, Encoding.utf8)
        Dim xmlDoc As New System.XML.XmlDocument
        xmlDoc.Loadxml(txt.Trim)
        Dim ndList  = xmlDoc.GetElementsByTagName("mxxx")
        For Each dr As object In ndlist
            Dim ndr As DataRow = DataTables("表b").find("fa piao代码 = '" & dr("fpdm").innertext  & "'And fa piao号码 = '" & dr("fphm").innertext  & "'")
            If ndr Is Nothing Then ndr = DataTables("表b").addnew
            For Each n As System.XML.XmlNode In dr.childNodes
                output.show(n.Name & " = " & n.InnerText)
                If n.name = "fpdm" Then
                    ndr("fa piao代码") = n.innertext
                End If
                If n.name = "fphm" Then
                    ndr("fa piao号码") = n.innertext
                End If
                If n.name = "gmfnsrsbh" Then
                    ndr("纳税人识别号") = n.innertext
                End If
                If n.name = "kprq" Then
                    Dim str = n.innertext
                    ndr("开piao日期") = str.SubString(0,4) + "-" + str.SubString(4,2) + "-" + str.SubString(6,2)
                End If
                If n.name = "je" Then
                    ndr("合计金额")  = n.innertext
                End If
                If n.name = "se" Then
                    ndr("合计税额") = n.innertext
                End If
                If n.name = "zfbz" Then
                    ndr("fa piao状态") = n.innertext
                End If
                ndr("价税合计") =val(ndr("合计税额"))+ val(ndr("合计金额"))
                Dim ndrb1 As DataRow = DataTables("表c").find("税号 = '" &  ndr("纳税人识别号") & "'")
                ndr("客户名称") = ndrb1("名称")
                ndr("地址电话") = ndrb1("地址电话")
                ndr("开户银行及账号") = ndrb1("银行账号")

            Next
        Next
    End If
Next
For Each f As String In FileSys.GetFiles(dzml1)
    If DataTables("表A").Find("文件名 = '" & f.SubString(f.Length - 25) & "'" ) Is Nothing Then
        Dim txt As String = FileSys.ReadAllText(f, Encoding.utf8)
        Dim xmlDoc As New System.XML.XmlDocument
        xmlDoc.Loadxml(txt.Trim)
        Dim ndList  = xmlDoc.GetElementsByTagName("Sph")
        For Each dr As object In ndlist
            Dim ndr As Row = Tables("表A").addnew
            For Each n As System.XML.XmlNode In dr.childNodes
                output.show(n.Name & " = " & n.InnerText)
                If n.name = "Spmc" Then
                    ndr("货物或服务名称") = n.innertext
                End If
                If n.name = "Ggxh" Then
                    ndr("规格") = n.innertext
                End If
                If n.name = "Jldw" Then
                    ndr("单位") = n.innertext
                End If
                If n.name = "Dj" Then
                    ndr("单价") = n.innertext
                End If
                If n.name = "sl" Then
                    ndr("数量") = val(n.innertext)
                End If
                If n.name = "Je" Then
                    ndr("金额") = n.innertext
                End If
                If n.name = "Slv" Then
                    ndr("税率") = n.innertext
                End If
                If n.name = "Kce" Then
                    ndr("税额") = n.innertext
                End If
                Dim str = f.SubString(f.Length - 25)
                Dim ary = str.split("_")
                ndr("文件名") = str
                ndr("fa piao代码") = ary(0)
                ndr("fa piao号码") = ary(1)
                Dim ndrb2 As DataRow = DataTables("表b").find("fa piao代码 = '" &  ndr("fa piao代码")  & "'And fa piao号码 = '" & ndr("fa piao号码") & "'")
                ndrb2("文件名") = ndr("文件名")
                ndr("fa piao状态") = ndrb2("fa piao状态")
                ndr("客户名称") = ndrb2("客户名称")
            Next
        Next
    End If
Next

 

.NET Framework 版本:2.0.50727.8800
Foxtable 版本:2018.10.9.1
错误所在事件:窗口,窗口1,Button1,Click
详细错误信息:
未将对象引用设置到对象的实例。

 

修改了上面红色部分就从来这问题了

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:fa piao.rar


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/3/13 15:43:00 [只看该作者]

Dim ndrb1 As DataRow = DataTables("表c").find("税号 = '" &  ndr("纳税人识别号") & "'")
If ndrb1 IsNot Nothing Then
    ndr("客户名称") = ndrb1("名称")
    ndr("地址电话") = ndrb1("地址电话")
    ndr("开户银行及账号") = ndrb1("银行账号")   
End If


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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/13 16:30:00 [只看该作者]

.NET Framework 版本:2.0.50727.8800
Foxtable 版本:2018.10.9.1
错误所在事件:窗口,窗口1,Button1,Click
详细错误信息:
路径的形式不合法。

 

Dim db4 As WinForm.DropDownBox = e.Form.Controls("DropBox4")
Dim db5 As WinForm.DropDownBox = e.Form.Controls("DropBox5")
Dim dzml4 As String = db4.text
Dim dzml5 As String = db5.text
If dzml4 IsNot Nothing Then
    Tables("表A").StopRedraw
    For Each f As String In FileSys.GetFiles(dzml4)
        If f.EndsWith("_verifysign.log") Then
            If DataTables("表B").Find("文件名 = '" & f & "'" ) Is Nothing Then
                Dim txt As String = FileSys.ReadAllText(f, Encoding.Default)
                Dim idx As Integer = txt.IndexOf("</business>")
               
                Dim s1 As String = txt.SubString(0, idx+11)
                Dim s2 As String = txt.SubString(idx+12)
                Dim xmlDoc As New System.XML.XmlDocument
                xmlDoc.Loadxml(s1)
               
                Dim ndList  = xmlDoc.GetElementsByTagName("input")
                Dim kprq As String
                Dim fpdm As String
                Dim fphm As String
                Dim ghdwmc As String
                Dim ghdwdzdh As String
                Dim ghdwsbh As String
                Dim ghdwyhzh As String
                Dim hjje As String
                Dim hjse As String
                Dim jshj As String
                Dim bz As String
                Dim fpzt As String
                For i As Integer = 0 To ndList.count - 1
                    If ndList(i).Item("kprq") IsNot Nothing Then kprq = ndList(i).Item("kprq").InnerText
                    If ndList(i).Item("fpdm") IsNot Nothing Then fpdm = ndList(i).Item("fpdm").InnerText
                    If ndList(i).Item("fphm") IsNot Nothing Then fphm = ndList(i).Item("fphm").InnerText
                    If ndList(i).Item("ghdwmc") IsNot Nothing Then ghdwmc = ndList(i).Item("ghdwmc").InnerText
                    If ndList(i).Item("ghdwdzdh") IsNot Nothing Then ghdwdzdh = ndList(i).Item("ghdwdzdh").InnerText
                    If ndList(i).Item("ghdwsbh") IsNot Nothing Then ghdwsbh = ndList(i).Item("ghdwsbh").InnerText
                    If ndList(i).Item("ghdwyhzh") IsNot Nothing Then ghdwyhzh = ndList(i).Item("ghdwyhzh").InnerText
                    If ndList(i).Item("hjje") IsNot Nothing Then hjje = ndList(i).Item("hjje").InnerText
                    If ndList(i).Item("hjse") IsNot Nothing Then hjse = ndList(i).Item("hjse").InnerText
                    If ndList(i).Item("jshj") IsNot Nothing Then jshj = ndList(i).Item("jshj").InnerText
                    If ndList(i).Item("bz") IsNot Nothing Then bz = ndList(i).Item("bz").InnerText
                    If ndList(i).Item("fpzt") IsNot Nothing Then fpzt = ndList(i).Item("fpzt").InnerText
                Next
                If fphm <> Nothing Then
                    Dim ndr As DataRow = DataTables("表b").addnew
                    ndr("开piao日期") = kprq.SubString(0,4) + "-" + kprq.SubString(4,2) + "-" + kprq.SubString(6,2)
                    ndr("fa piao代码") = fpdm
                    ndr("fa piao号码") = fphm
                    ndr("客户名称") =ghdwmc
                    ndr("地址电话") =ghdwdzdh
                    ndr("纳税人识别号") = ghdwsbh
                    ndr("开户银行及账号") = ghdwyhzh
                    ndr("合计金额") = hjje
                    ndr("合计税额") = hjse
                    ndr("价税合计") = jshj
                    ndr("备注") = bz
                    ndr("fa piao状态") = fpzt
                    ndr("文件名") = f
                    ndList = xmlDoc.GetElementsByTagName("fyxm")(0).ChildNodes
                    For i As Integer = 0 To ndList.count - 1
                        Dim spmc As String = ndList(i).Item("spmc").InnerText
                        Dim ggxh As String = ndList(i).Item("ggxh").InnerText
                        Dim sl As String = ndList(i).Item("sl").InnerText
                        Dim se As String = ndList(i).Item("se").InnerText
                        Dim dw As String = ndList(i).Item("dw").InnerText
                        Dim spsl As String = ndList(i).Item("spsl").InnerText
                        Dim dj As String = ndList(i).Item("dj").InnerText
                        Dim je As String = ndList(i).Item("je").InnerText
                        Dim r As Row = Tables("表A").AddNew
                        r("fa piao代码") = fpdm
                        r("fa piao号码") = fphm
                        r("客户名称") = ghdwmc
                        r("货物或服务名称") = spmc
                        r("规格") = ggxh
                        r("单位") = dw
                        r("数量") = spsl
                        r("单价") = dj
                        r("税率") = sl
                        r("税额") = se
                        r("金额") = je
                        r("fa piao状态") = fpzt
                    Next
                End If
            End If
        End If
    Next
    Tables("表A").ResumeRedraw
    DataTables("表b").DeleteFor("fa piao状态 = '2'")
    For Each s As String In DataTables("表A").GetValues("fa piao号码", "fa piao状态 = '3'")
        DataTables("表A").DeleteFor("fa piao号码 = '" & s & "' and fa piao状态 = '0'")
    Next
    For Each s1 As String In DataTables("表b").GetValues("fa piao号码", "fa piao状态 = '3'")
        DataTables("表b").DeleteFor("fa piao号码 = '" & s1 & "' and fa piao状态 = '0'")
    Next
End If
Dim db1 As WinForm.DropDownBox = e.Form.Controls("DropBox1")
Dim db2 As WinForm.DropDownBox = e.Form.Controls("DropBox2")
Dim dzml1 As String = db1.text
Dim dzml2 As String = db2.text
If dzml2 IsNot Nothing Then
    For Each f As String In FileSys.GetFiles(dzml2)
        If f.EndsWith(".xml") Then
            Dim txt As String = FileSys.ReadAllText(f, Encoding.utf8)
            Dim xmlDoc As New System.XML.XmlDocument
            xmlDoc.Loadxml(txt.Trim)
            Dim ndList  = xmlDoc.GetElementsByTagName("mxxx")
            For Each dr As object In ndlist
                Dim ndr As DataRow = DataTables("表b").find("fa piao代码 = '" & dr("fpdm").innertext  & "'And fa piao号码 = '" & dr("fphm").innertext  & "'")


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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/13 16:31:00 [只看该作者]

                If ndr Is Nothing Then ndr = DataTables("表b").addnew
                For Each n As System.XML.XmlNode In dr.childNodes
                    output.show(n.Name & " = " & n.InnerText)
                    If n.name = "fpdm" Then
                        ndr("fa piao代码") = n.innertext
                    End If
                    If n.name = "fphm" Then
                        ndr("fa piao号码") = n.innertext
                    End If
                    If n.name = "gmfnsrsbh" Then
                        ndr("纳税人识别号") = n.innertext
                    End If
                    If n.name = "kprq" Then
                        Dim str = n.innertext
                        ndr("开piao日期") = str.SubString(0,4) + "-" + str.SubString(4,2) + "-" + str.SubString(6,2)
                    End If
                    If n.name = "je" Then
                        ndr("合计金额")  = n.innertext
                    End If
                    If n.name = "se" Then
                        ndr("合计税额") = n.innertext
                    End If
                    If n.name = "zfbz" Then
                        ndr("fa piao状态") = n.innertext
                    End If
                    ndr("价税合计") =val(ndr("合计税额"))+ val(ndr("合计金额"))
                    Dim ndrb1 As DataRow = DataTables("表c").find("税号 = '" &  ndr("纳税人识别号") & "'")
                    If ndrb1 IsNot Nothing Then
                        ndr("客户名称") = ndrb1("名称")
                        ndr("地址电话") = ndrb1("地址电话")
                        ndr("开户银行及账号") = ndrb1("银行账号")
                    End If
                Next
            Next
        End If
    Next
End If
If dzml1 IsNot Nothing Then
    For Each f As String In FileSys.GetFiles(dzml1)
        If DataTables("表A").Find("文件名 = '" & f.SubString(f.Length - 25) & "'" ) Is Nothing Then
            Dim txt As String = FileSys.ReadAllText(f, Encoding.utf8)
            Dim xmlDoc As New System.XML.XmlDocument
            xmlDoc.Loadxml(txt.Trim)
            Dim ndList  = xmlDoc.GetElementsByTagName("Sph")
            For Each dr As object In ndlist
                Dim ndr As Row = Tables("表A").addnew
                For Each n As System.XML.XmlNode In dr.childNodes
                    output.show(n.Name & " = " & n.InnerText)
                    If n.name = "Spmc" Then
                        ndr("货物或服务名称") = n.innertext
                    End If
                    If n.name = "Ggxh" Then
                        ndr("规格") = n.innertext
                    End If
                    If n.name = "Jldw" Then
                        ndr("单位") = n.innertext
                    End If
                    If n.name = "Dj" Then
                        ndr("单价") = n.innertext
                    End If
                    If n.name = "sl" Then
                        ndr("数量") = val(n.innertext)
                    End If
                    If n.name = "Je" Then
                        ndr("金额") = n.innertext
                    End If
                    If n.name = "Slv" Then
                        ndr("税率") = n.innertext
                    End If
                    If n.name = "Kce" Then
                        ndr("税额") = n.innertext
                    End If
                    Dim str = f.SubString(f.Length - 25)
                    Dim ary = str.split("_")
                    ndr("文件名") = str
                    ndr("fa piao代码") = ary(0)
                    ndr("fa piao号码") = ary(1)
                    Dim ndrb2 As DataRow = DataTables("表b").find("fa piao代码 = '" &  ndr("fa piao代码")  & "'And fa piao号码 = '" & ndr("fa piao号码") & "'")
                    ndrb2("文件名") = ndr("文件名")
                    ndr("fa piao状态") = ndrb2("fa piao状态")
                    ndr("客户名称") = ndrb2("客户名称")
                Next
            Next
        End If
    Next
End If
If DataTables("表A").HasChanges Then
    DataTables("表B").Save
    DataTables("表A").Save
    MessageBox.Show("fa piao数据导入完成")
Else
    MessageBox.Show("没有导入任何fa piao数据")
End If

 

 

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


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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/13 17:06:00 [只看该作者]

Dim db4 As WinForm.DropDownBox = e.Form.Controls("DropBox4")
Dim db5 As WinForm.DropDownBox = e.Form.Controls("DropBox5")
Dim dzml4 As String = db4.text
Dim dzml5 As String = db5.text
If dzml4 IsNot Nothing Then
    Tables("表A").StopRedraw
    For Each dir As String In FileSys.GetDirectories(dzml4)
        For Each f As String In FileSys.GetFiles(dir)
            If f.EndsWith("_verifysign.log") Then
                Dim str = f.SubString(f.Length - 38)
                If DataTables("表B").Find("文件名 = '" & str & "'" ) Is Nothing Then
                    Dim txt As String = FileSys.ReadAllText(f, Encoding.Default)
                    Dim idx As Integer = txt.IndexOf("</business>")
                   
                    Dim s1 As String = txt.SubString(0, idx+11)
                    Dim s2 As String = txt.SubString(idx+12)
                    Dim xmlDoc As New System.XML.XmlDocument
                    xmlDoc.Loadxml(s1)
                   
                    Dim ndList  = xmlDoc.GetElementsByTagName("input")
                    Dim kprq As String
                    Dim fpdm As String
                    Dim fphm As String
                    Dim ghdwmc As String
                    Dim ghdwdzdh As String
                    Dim ghdwsbh As String
                    Dim ghdwyhzh As String
                    Dim hjje As String
                    Dim hjse As String
                    Dim jshj As String
                    Dim bz As String
                    Dim fpzt As String
                    For i As Integer = 0 To ndList.count - 1
                        If ndList(i).Item("kprq") IsNot Nothing Then kprq = ndList(i).Item("kprq").InnerText
                        If ndList(i).Item("fpdm") IsNot Nothing Then fpdm = ndList(i).Item("fpdm").InnerText
                        If ndList(i).Item("fphm") IsNot Nothing Then fphm = ndList(i).Item("fphm").InnerText
                        If ndList(i).Item("ghdwmc") IsNot Nothing Then ghdwmc = ndList(i).Item("ghdwmc").InnerText
                        If ndList(i).Item("ghdwdzdh") IsNot Nothing Then ghdwdzdh = ndList(i).Item("ghdwdzdh").InnerText
                        If ndList(i).Item("ghdwsbh") IsNot Nothing Then ghdwsbh = ndList(i).Item("ghdwsbh").InnerText
                        If ndList(i).Item("ghdwyhzh") IsNot Nothing Then ghdwyhzh = ndList(i).Item("ghdwyhzh").InnerText
                        If ndList(i).Item("hjje") IsNot Nothing Then hjje = ndList(i).Item("hjje").InnerText
                        If ndList(i).Item("hjse") IsNot Nothing Then hjse = ndList(i).Item("hjse").InnerText
                        If ndList(i).Item("jshj") IsNot Nothing Then jshj = ndList(i).Item("jshj").InnerText
                        If ndList(i).Item("bz") IsNot Nothing Then bz = ndList(i).Item("bz").InnerText
                        If ndList(i).Item("fpzt") IsNot Nothing Then fpzt = ndList(i).Item("fpzt").InnerText
                    Next
                    If fphm <> Nothing Then
                        Dim ndr As DataRow = DataTables("表b").addnew
                        ndr("开piao日期") = kprq.SubString(0,4) + "-" + kprq.SubString(4,2) + "-" + kprq.SubString(6,2)
                        ndr("fa piao代码") = fpdm
                        ndr("fa piao号码") = fphm
                        ndr("客户名称") =ghdwmc
                        ndr("地址电话") =ghdwdzdh
                        ndr("纳税人识别号") = ghdwsbh
                        ndr("开户银行及账号") = ghdwyhzh
                        ndr("合计金额") = hjje
                        ndr("合计税额") = hjse
                        ndr("价税合计") = jshj
                        ndr("备注") = bz
                        ndr("fa piao状态") = fpzt
                       
                        ndr("文件名") = str
                        ndList = xmlDoc.GetElementsByTagName("fyxm")(0).ChildNodes
                        For i As Integer = 0 To ndList.count - 1
                            Dim spmc As String = ndList(i).Item("spmc").InnerText
                            Dim ggxh As String = ndList(i).Item("ggxh").InnerText
                            Dim sl As String = ndList(i).Item("sl").InnerText
                            Dim se As String = ndList(i).Item("se").InnerText
                            Dim dw As String = ndList(i).Item("dw").InnerText
                            Dim spsl As String = ndList(i).Item("spsl").InnerText
                            Dim dj As String = ndList(i).Item("dj").InnerText
                            Dim je As String = ndList(i).Item("je").InnerText
                            Dim r As Row = Tables("表A").AddNew
                            r("fa piao代码") = fpdm
                            r("fa piao号码") = fphm
                            r("客户名称") = ghdwmc
                            r("货物或服务名称") = spmc
                            r("规格") = ggxh
                            r("单位") = dw
                            r("数量") = spsl
                            r("单价") = dj
                            r("税率") = sl
                            r("税额") = se
                            r("金额") = je
                            r("fa piao状态") = fpzt
                            ndr("文件名") = str
                        Next
                    End If
                End If
            End If
        Next
    Next
    Tables("表A").ResumeRedraw
    DataTables("表b").DeleteFor("fa piao状态 = '2'")
    For Each s As String In DataTables("表A").GetValues("fa piao号码", "fa piao状态 = '3'")
        DataTables("表A").DeleteFor("fa piao号码 = '" & s & "' and fa piao状态 = '0'")
    Next
    For Each s1 As String In DataTables("表b").GetValues("fa piao号码", "fa piao状态 = '3'")
        DataTables("表b").DeleteFor("fa piao号码 = '" & s1 & "' and fa piao状态 = '0'")
    Next
End If

 回到顶部
总数 51 上一页 1 2 3 4 5 6 下一页