Dim tx As Table = Tables("AAA")
Dim ab As String = "91350200737855820M"
Dim cd As String = "专用fa piao"
Dim cnt,cnsp As Integer
cnsp = DataTables("AAA").Compute("Count([fa piao号码])","金额 > '0'")
Dim jo As New Foxtable.XObject
jo("body") = New JObject
jo("body")("head") = New JObject
jo("body")("head")("Rows") = cnsp
jo("body")("data") = New JObject
Dim ja As New JArray
'jo("ink")=ja
Dim lst As List(of DataRow)=DataTables("AAA").Select("金额 > '0' ")
For i As Integer=0 To lst.count-1
Dim kr As DataRow=lst(i)
Dim j2 As New JObject
j2("@id")= kr("序号").Tostring()
j2("dm")=kr("fa piao代码").Tostring()
j2("dm")=kr("fa piao代码").Tostring()
j2("hm")=kr("fa piao号码").Tostring()
j2("gf")=ab.Tostring()
j2("xf")=kr("销方税号").Tostring()
j2("kq")=kr("开piao日期").Tostring()
j2("je")=kr("金额").Tostring()
j2("se")=kr("税额").Tostring()
j2("rq")=kr("认证日期").Tostring()
j2("lb")=cd.Tostring()
ja.Add(j2)
Next
jo("body")("data")("row") = ja
Dim str As String = jo.ToXML
'Output.Show(str)
'str = "<?xml version=""1.0"" encoding=""GBK"" ?> <!--DOCTYPE RZ00102 SYSTEM "RZ00102.dtd" --> " & str & "</data></body>"
'Output.Show(str)
Dim fl As String=ProjectPath & "Reports\" & format(Date.today,"yyyyMMdd") & "fa piao数据XML" & ".xml"
If FileSys.FileExists(fl) Then
FileSys.DeleteFile(fl)
End If
FileSys.WriteAllText(fl,str, True, Encoding.Default)
'以下代码是用IE打开生成的xml
Dim proc As new Process
proc.file = ProjectPath & "Reports\" & format(Date.today,"yyyyMMdd") & "fa piao数据XML" & ".xml"
proc.Start