Dim tb As DataTable = DataTables("会计科目")
If e.DataCol.name = "会计年度" And e.newvalue IsNot Nothing Then
For Each c As DataCol In e.DataTable.DataCols
If c.name <> "会计年度" AndAlso c.name <> "审核" Then
msgbox(c.name)
If tb.find("资产负债表 = '" & c.name & "'").Isnull("资产负债表包含科目") = True Then
msgbox(1)
'If c.name <> "会计年度" AndAlso c.name <> "审核" AndAlso c.name <> "应收款项" AndAlso c.name <> "应付款项" AndAlso c.name <> "固定资产原价" AndAlso c.name <> "未分配收益" AndAlso c.name <> "货币资金" AndAlso c.name <> "存货" Then
e.DataRow(c.name) = DataTables("余额横表未审").Compute("sum(" & c.name & ")","会计年度 = '" & e.DataRow("会计年度") & "'")
msgbox(2)
Else
Dim lis As List(of String) =tb.find("科目名称 = '" & c.name & "'")("资产负债表包含科目")
Dim sum As Double
For Each li As String In lis
sum = sum + DataTables("余额横表未审").Compute("sum(" & li & ")","会计年度 = '" & e.DataRow("会计年度") & "'")
Next
e.DataRow(c.name) = sum
End If
End If
Next
e.DataRow("应收款项") = DataTables("余额横表未审").Compute("sum(应收款)","会计年度 = '" & e.DataRow("会计年度") & "'")
e.DataRow("应付款项") = DataTables("余额横表未审").Compute("sum(应付款)","会计年度 = '" & e.DataRow("会计年度") & "'")
e.DataRow("固定资产原价") = DataTables("余额横表未审").Compute("sum(固定资产)","会计年度 = '" & e.DataRow("会计年度") & "'")
e.DataRow("未分配收益") = DataTables("余额横表未审").Compute("sum(本年收益)","会计年度 = '" & e.DataRow("会计年度") & "'")+DataTables("余额横表未审").Compute("sum(收益分配)","会计年度 = '" & e.DataRow("会计年度") & "'")
e.DataRow("货币资金") = DataTables("余额横表未审").Compute("sum(库存现金)","会计年度 = '" & e.DataRow("会计年度") & "'")+DataTables("余额横表未审").Compute("sum(银行存款)","会计年度 = '" & e.DataRow("会计年度") & "'")+DataTables("余额横表未审").Compute("sum(授权支付用款额度)","会计年度 = '" & e.DataRow("会计年度") & "'")
End If
以上代码在黄色部分是提示错误,该怎么修改
.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2015.12.22.1
错误所在事件:表,资产负债表未审,DataColChanged
详细错误信息:
调用的目标发生了异常。
未将对象引用设置到对象的实例。