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)
'Dim fdr As DataRow = tb.find("资产负债表 = '" & c.name & "'")
msgbox(1)
If tb.find("资产负债表 = '" & c.name & "'")("表包含科目") Is Nothing Then
msgbox(2)
'If tb.find("资产负债表 = '" & c.name & "'").Isnull("资产负债表包含科目") = True Then
'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
提示错误的是红色部分