以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]AfterLoad未设置对象变量 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=160325) |
-- 作者:lgj716330 -- 发布时间:2021/1/29 9:01:00 -- [求助]AfterLoad未设置对象变量 在统计表的AfterLoad中有以下代码,打开时出现以下错误提示,各种偿试都不行 .NET Framework 版本:2.0.50727.9151 Foxtable 版本:2018.10.9.1 错误所在事件:统计表,AfterLoad 详细错误信息:
未设置对象变量或 With 块变量。 Dim t As Table = Tables("统计表") Dim g As Subtotalgroup t.SubtotalGroups.Clear() t.GroupAboveData = False t.TreeVisible = False t.SpillNode = True g = New Subtotalgroup g.Aggregate = AggregateEnum.Sum g.GroupOn = "主体" g.TotalOn = "销售额,工资总额" g.Caption = "{0}
小计" t.SubtotalGroups.Add(g) g = New Subtotalgroup g.Aggregate = AggregateEnum.Sum g.GroupOn = "年份" g.TotalOn = "销售额,工资总额" g.Caption = "{0}
小计" t.SubtotalGroups.Add(g) t.Sort = "主体,年份,月份" t.Subtotal(true) Dim r As Row For i As Integer = 0 To Tables("统计表").Rows.Count(True) - 1 r = Tables("统计表").Rows(i,True) If r.IsGroup AndAlso r.level = 1 Then \'汇总行计算 Dim s21 As Double = DataTables("统计表").SQLCompute("sum([销售额])","[主体]
= \'" & r("主体").replace("小计","").trim()
& "\'") If s21 <> 0 r("工资占比") = DataTables("统计表").SQLCompute("sum([工资总额])","[主体]
= \'" & r("主体").replace("小计","").trim()
& "\'")/s21 End If End If If r.IsGroup AndAlso r.level = 0 Then Dim s31 As Double = DataTables("统计表").SQLCompute("sum([销售额])","[年份]
= \'" & r("主体").replace("小计","").trim()
& "\'") If s31 <> 0 r("工资占比") = DataTables("统计表").SQLCompute("sum([工资总额])","[年份]
= \'" & r("主体").replace("小计","").trim()
& "\'")/s31 End If End If Next 另外在MainTableChanged已设置了以下代码 If MainTable.Name = "统计表" Then DataTables("统计表").load End If |
-- 作者:有点蓝 -- 发布时间:2021/1/29 9:16:00 -- 调试技巧:http://www.foxtable.com/webhelp/scr/1485.htm,看是哪一句代码出错? |
-- 作者:lgj716330 -- 发布时间:2021/1/29 9:41:00 -- 嗯,搞明白了,自己晕头了 |