以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 代码不能执行第二次 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=127694) |
||||
-- 作者:aza520 -- 发布时间:2018/11/20 11:16:00 -- 代码不能执行第二次 我在窗口设一个计算按钮,代码如下,此代码只能执行一次,执行第二次时就会出现如图错误,请问老师是什么问题 Syscmd.Project.Save() Dim b As New SQLGroupTableBuilder("统计表1","中间计量表") b.C b.Groups.AddDef("项目名称") \'根据产品分组 b.Groups.AddDef("施工合同段") \'根据产品分组 b.Groups.AddDef("计量期次") \'根据产品分组 b.Groups.AddDef("章节") \'根据产品分组 b.Totals.AddExp("第100章","case when 章节 = \'100\' then Round(申报数量 * 单价,0) else 0 end") b.Totals.AddExp("第200章","case when 章节 = \'200\' then Round(申报数量 * 单价,0) else 0 end") b.Totals.AddExp("第300章","case when 章节 = \'300\' then Round(申报数量 * 单价,0) else 0 end") b.Totals.AddExp("第400章","case when 章节 = \'400\' then Round(申报数量 * 单价,0) else 0 end") b.Totals.AddExp("第500章","case when 章节 = \'500\' then Round(申报数量 * 单价,0) else 0 end") b.Totals.AddExp("第600章","case when 章节 = \'600\' then Round(申报数量 * 单价,0) else 0 end") b.Totals.AddExp("第700章","case when 章节 = \'700\' then Round(申报数量 * 单价,0) else 0 end") b.Totals.AddExp("第800章","case when 章节 = \'800\' then Round(申报数量 * 单价,0) else 0 end") b.Totals.AddExp("第900章","case when 章节 = \'900\' then Round(申报数量 * 单价,0) else 0 end") b.Build \'生成统计表 \'MainTable = Tables("统计表1") \'打开生成的统计表 DataTables("计量汇总").DataRows.Clear Dim Cols1() As String = {"项目名称","施工合同段","计量期次","第100章","第200章","第300章","第400章","第500章","第600章","第700章","第800章","第900章"}\'指定数据来源列 Dim Cols2() As String = {"项目名称","施工合同段","计量期次","第100章","第200章","第300章","第400章","第500章","第600章","第700章","第800章","第900章"}\'指定数据接收表 For Each dr1 As DataRow In DataTables("统计表1").Select("[计量期次] > 0") Dim dr2 As DataRow = DataTables("计量汇总").Find("项目名称 = \'" & dr1("项目名称") & "\' and 施工合同段 = \'" & dr1("施工合同段") & "\' and 计量期次 = \'" & dr1("计量期次") & "\'") If dr2 Is Nothing Then dr2 = DataTables("计量汇总").AddNew() End If For i As Integer = 0 To Cols1.Length -1 dr2(Cols2(i)) = dr1(Cols1(i)) Next Next 错误提示: .NET Framework 版本:2.0.50727.8937 Foxtable 版本:2017.12.18.1 错误所在事件:计量汇总,CurrentChanged 详细错误信息: 值不能为空。 参数名: key |
||||
-- 作者:aza520 -- 发布时间:2018/11/20 11:19:00 -- 计量汇总表的CurrentChanged事件 Dim r As Row = Tables("计量统计.计量汇总").Current If r Is Nothing Then \'如果Current为Nothing Return \'则返回 End If DataTables("零号清单").LoadFilter = "项目名称 =\'" & r("项目名称") & "\' And 施工合同段 =\'" & r("施工合同段") & "\'" DataTables("零号清单").Load Dim f As Row = Tables("计量统计.计量汇总").Current If f Is Nothing Then \'如果Current为Nothing Return \'则返回 End If DataTables("合同价").LoadFilter = "项目名称 =\'" & f("项目名称") & "\' And 施工合同段 =\'" & f("施工合同段") & "\'" DataTables("合同价").Load |
||||
-- 作者:有点甜 -- 发布时间:2018/11/20 12:28:00 -- 去看currentChanged事件
|