以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 遍历代码出错 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=124393) |
-- 作者:ZJZK2018 -- 发布时间:2018/9/5 14:37:00 -- 遍历代码出错 Case "中标造价","合同造价","合同结算" \'造价分级合计 Dim str As String = dr("合同编号") Dim idx As Integer = str.LastIndexOf("-") Dim nms() As String = {"中标造价","合同造价","合同结算"} If idx > -1 Then Dim pid As String = str.SubString(0,idx) Dim dt As DataRow = e.DataTable.Find("合同编号 = \'" & pid & "\'") If dt IsNot Nothing Then For Each nm As String In nms dt(nm) = e.DataTable.Compute("Sum(nm)","合同编号 Like \'" & pid & "-%\' And 类别 = \'" & dr("类别") & "\'") Next End If End If 错误提示: .NET Framework 版本:2.0.50727.8762 Foxtable 版本:2018.8.30.1 错误所在事件:表,收款合同信息,DataColChanged 详细错误信息: 调用的目标发生了异常。 未找到列 [nm]。 |
-- 作者:有点甜 -- 发布时间:2018/9/5 14:39:00 -- dt(nm) = e.DataTable.Compute("Sum(" & nm & ")","合同编号 Like \'" & pid & "-%\' And 类别 = \'" & dr("类别") & "\'") |