以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  提取数据  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=127993)

--  作者:zoyong
--  发布时间:2018/11/26 20:10:00
--  提取数据
在“审批模板信息”列提取   \'value\'和\'setvalue\'   到关联项目附件

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


代码写在  DataColChanged  里面


提取下面红色的字段
[
  {
    "item-1503317853434-0-0": {
      "id": "item-1529720128134",
      "locked": false,
      "placeholder": "",
      "title": "用途",
      "type": "textarea",
      "un_print": false,
      "validate": true,
      "value": "财务室座机87831879,经营科87831878电话费",
      "listItem": true,
      "warning": ""
    },
    "item-1503317853434-0-1": {
      "id": "item-1503317973968",
      "locked": false,
      "placeholder": "",
      "title": "发生时间",
      "type": "date",
      "un_print": false,
      "validate": true,
      "value": 1531180800000,
      "listItem": true,
      "warning": ""
    },
    "item-1503317853434-0-2": {
      "id": "item-1503317989302",
      "locked": true,
      "placeholder": "",
      "title": "报销金额",
      "type": "price",
      "un_print": false,
      "validate": true,
      "value": "200",
      "exps_type": "exps_list_price",
      "listItem": true,
      "uppervalue": "贰佰圆",
      "warning": ""
    },
    "item-1503317853434-0-3": {
      "id": "item-1503385054053",
      "locked": false,
      "placeholder": "",
      "title": "附件",
      "type": "file",
      "un_print": false,
      "validate": true,
      "value": [
        {
          "fileurl": "https://tj-yun-ftn.weiyun.com:443/ftn_handler/309669515b747d30d73a583515e31c54e83d61c54465133ae46ba08e7a716557?compressed=0&dtype=1&fname=tmp_15db4272d4772b8b1afbc46288ac6cce.jpg",
          "fileid": "*0*KxUXgr9y+2zyQKKGfdoD8JRXMTSVbfvg/nXV/Y1a42IALWKxKdwP+TKq/zRyQ+y0tb1VvYroZ9Rn1yyqkmjDoaLOA9cqRpRe7wpobW3dMUk=",
          "filesize": 1972481,
          "filetype": "jpg",
          "filename": "1531213475416.jpg",
          "extdata": "{\'fileSize\':1972481}",
          "isfile": false,
          "className": "ww_icon_NoticeAttachmentImage",
          "fileItemClassName": "NoticeAttachmentImage"
        }
      ],
      "listItem": true,
      "warning": ""
    }
  }
]
[此贴子已经被作者于2018/11/26 20:19:28编辑过]

--  作者:有点蓝
--  发布时间:2018/11/26 20:25:00
--  
If e.DataCol.Name = "审批模板信息"
    If e.DataRow.IsNull("审批模板信息") = False Then
        Dim json As String = e.DataRow("审批模板信息")
        For Each ep As JToken In JArray.Parse(json)
            e.DataRow("报销类型") = ep("item-1503317593875")("value").ToString()
            e.DataRow("报销事由") = ep("item-1503317835288")("value").ToString()
            e.DataRow("附件明细") = ep("item-1503317853434")("value").ToString().Replace("""","\'")

            e.DataRow("关联项目") = ep("item-1503317853434")("value")(0)("item-1503317853434-0-0")("value").ToString()
            e.DataRow("附件") = ep("item-1503317853434")("value")(0)("item-1503317853434-0-3")("value")(0)("fileurl").ToString()

        Next
    End If
End If

--  作者:zoyong
--  发布时间:2018/11/26 20:26:00
--  
有多张附件的时候,提取“图片链接”错误

[{\'item-1503317593875\':{\'id\':\'item-1503317593875\',\'locked\':true,\'placeholder\':\'\',\'title\':\'报销类型\',\'type\':\'select\',\'un_print\':false,\'validate\':true,\'value\':\'其他费用\',\'exps_type\':\'exps_account_type\'},\'item-1503317835288\':{\'id\':\'item-1503317835288\',\'locked\':true,\'placeholder\':\'请输入\',\'title\':\'费用说明\',\'type\':\'text\',\'un_print\':false,\'validate\':false,\'value\':\'教育局报名费(土建)\',\'exps_type\':\'exps_reason\'},\'item-1503317853434\':{\'id\':\'item-1503317853434\',\'locked\':true,\'placeholder\':\'\',\'title\':\'报销明细\',\'type\':\'list\',\'un_print\':false,\'validate\':true,\'value\':[{\'item-1503317853434-0-0\':{\'id\':\'item-1529720128134\',\'locked\':false,\'placeholder\':\'请输入\',\'title\':\'用途\',\'type\':\'textarea\',\'un_print\':false,\'validate\':true,\'value\':\'仙居县官路镇中心幼儿园综合楼及零星改造工程报名费用\',\'setvalue\':\'仙居县官路镇中心幼儿园综合楼及零星改造工程报名费用\'},\'item-1503317853434-0-1\':{\'id\':\'item-1503317973968\',\'locked\':false,\'placeholder\':\'\',\'title\':\'发生时间\',\'type\':\'date\',\'un_print\':false,\'validate\':true,\'value\':1531324800000,\'setvalue\':1531324800000},\'item-1503317853434-0-2\':{\'id\':\'item-1503317989302\',\'locked\':true,\'placeholder\':\'\',\'title\':\'报销金额\',\'type\':\'price\',\'un_print\':false,\'validate\':true,\'value\':\'600\',\'exps_type\':\'exps_list_price\',\'setvalue\':\'600\'},\'item-1503317853434-0-3\':{\'id\':\'item-1503385054053\',\'locked\':false,\'placeholder\':\'\',\'title\':\'附件\',\'type\':\'file\',\'un_print\':false,\'validate\':true,\'value\':[{\'fileid\':\'*0*ieTsvwdJUNHam4wcPBqSFwupvAH6Mlh+YQLpoTuMa1mwmKYofvM3Rg4vGwkU2+bV9Ro4C/Iv3T/hDWDsCdOg9UtQSvmZhEbTnxNAH5aY9fE=\',\'checkcode\':\'spat_f7ff4d325d5f6010662bd91228d84dcf057cee69fbfeaff5700992e1829835aa35f9e4077f080193736e438f3ea19d28bdc60580027775a08026f07fad3928eff5dcaab4ac815b626e16ccc4c699993bc6b42d64cd84f84171ccf0a5e6bd4c6cf371275c6a85d84ef833fd8c5a4ab08829818994406c88c68f18fe79caa1ac53af63edaa5beecbb72003fb766b51eb11\',\'filetype\':\'doc\',\'filesize\':\'23552\',\'fileItemClassName\':\'NoticeAttachmentWord\',\'filename\':\'仙居县官路镇中心幼儿园综合楼及零星改造工程.doc\',\'uploadtype\':20}],\'setvalue\':[{\'fileid\':\'*0*ieTsvwdJUNHam4wcPBqSFwupvAH6Mlh+YQLpoTuMa1mwmKYofvM3Rg4vGwkU2+bV9Ro4C/Iv3T/hDWDsCdOg9UtQSvmZhEbTnxNAH5aY9fE=\',\'checkcode\':\'spat_f7ff4d325d5f6010662bd91228d84dcf057cee69fbfeaff5700992e1829835aa35f9e4077f080193736e438f3ea19d28bdc60580027775a08026f07fad3928eff5dcaab4ac815b626e16ccc4c699993bc6b42d64cd84f84171ccf0a5e6bd4c6cf371275c6a85d84ef833fd8c5a4ab08829818994406c88c68f18fe79caa1ac53af63edaa5beecbb72003fb766b51eb11\',\'filetype\':\'doc\',\'filesize\':\'23552\',\'fileItemClassName\':\'NoticeAttachmentWord\',\'filename\':\'仙居县官路镇中心幼儿园综合楼及零星改造工程.doc\',\'uploadtype\':20}]}}],\'exps_type\':\'exps_list\'},\'item-1503318022749\':{\'id\':\'item-1503318022749\',\'locked\':true,\'placeholder\':\'\',\'title\':\'总金额\',\'type\':\'expenseAmount\',\'un_print\':false,\'validate\':false,\'value\':\'600.00\',\'exps_type\':\'exps_amount\'}}]
[此贴子已经被作者于2018/11/26 20:52:36编辑过]

--  作者:有点甜
--  发布时间:2018/11/27 10:25:00
--  

那就判断能否找到

 

For Each ep As JToken In JArray.Parse(json)
    If ep("item-1503317853434")("value")(0)("item-1503317853434-0-3")("value")(0)("fileurl") IsNot Nothing Then
        msgbox(ep("item-1503317853434")("value")(0)("item-1503317853434-0-3")("value")(0)("fileurl").Tostring)
    Else
        msgbox(ep("item-1503317853434")("value")(0)("item-1503317853434-0-3")("value")(0)("fileid").ToString())
    End If
Next


--  作者:zoyong
--  发布时间:2018/11/27 19:54:00
--  
If e.DataRow.IsNull("附件明细") = False Then
    Dim json As String = e.DataRow("附件明细")
    For Each ep As JToken In JArray.Parse(json)
        If ep("item-1503317853434-0-3")("value")(0)("fileurl") IsNot Nothing Then
            e.DataRow("第十列") = ep("item-1503317853434-0-3")("value")(0)("fileurl").ToString()
        End If
        If ep("item-1503317853434-0-3")("value")(0)("fileid") IsNot Nothing Then
            e.DataRow("第十一列") = ep("item-1503317853434-0-3")("value")(0)("fileid").ToString()
        End If
    Next
End If

上面代码有时正常,有时不正常   求解
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目1.table



--  作者:有点甜
--  发布时间:2018/11/28 9:41:00
--  

If e.DataRow.IsNull("审批模板信息") = False Then
    Dim json As String = e.DataRow("审批模板信息")
    For Each ep As JToken In JArray.Parse(json)
        e.DataRow("附件明细") = ep("item-1503317853434")("value").ToString() 
    Next
End If


--  作者:zoyong
--  发布时间:2019/2/13 20:18:00
--  
Dim Book As New XLS.Book(ProjectPath & "Attachments\\收据打印ZZS批量.xlsx") \'打开模板
Dim fl As String = ProjectPath & "Reports\\收据打印ZZS批量.xlsx"
For Each r As DataRow In Tables(TbName).DataTable.Select("打印 = 0")
    Dim Sheet As XLS.Sheet = Book.Sheets(0)
    book.AddDataTable(r) \'添加表
    Book.Build() \'生成报表
    Book.Save(fl)
    
    r("打印") = True
    r("打印日期") = Date.Now
    r.Save()
Next
Dim Proc As New Process
Proc.File = fl
Proc.Start()

红色代码无效

--  作者:有点甜
--  发布时间:2019/2/13 21:54:00
--  

没有一个参数的,请认认真真看如何调用

 

http://www.foxtable.com/webhelp/scr/3233.htm

 


--  作者:zoyong
--  发布时间:2019/2/26 13:34:00
--  
在文本框“列宽”中修改数值后,自动保存到“列宽设置“行中

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



--  作者:有点甜
--  发布时间:2019/2/26 14:25:00
--  

textChanged事件

 

Dim r As Row = e.Form.controls("Table2").Table.current
If r IsNot Nothing Then
    Dim str As String = ""
    Dim ary() As String = r("列宽设置").split("|")
    For i As Integer = 0 To ary.length-1 Step 2
        If ary(i) = e.form.controls("combobox1").Text Then
            ary(i+1) = e.sender.text
            r("列宽设置") = String.Join("|", ary)
            Exit For
        End If
    Next
End If