Dim Ttlamt2 As Single = Tables("出入库").Compute("sum(不含税金额)")
Dim mth2() As String = DataTables("出入库").GetComboListString("出入年月",Tables("出入库").filter).Split("|")
Dim months2 As Integer = mth2.length
Dim filter2 As String = Tables("出入库").filter
If filter2 > "" Then filter2 = filter2 & " and "
Dim Products2 As List(Of String) = DataTables("出入库").GetValues("物料编号",filter2 & " 出入原因 ='" & "出库-客户出货" & "' and 来源 ='" & "自做" & "' ")
For Each sss2 As String In Products2
Dim dr912 As Row = Tables("库存分析").AddNew()
dr912("物料编号") = sss2
Dim amt2 As Single = Tables("出入库").Compute("sum(不含税金额)","物料编号 ='" & sss2 & "'")
dr912("金额") = amt2
dr912("占比") = amt2 / ttlamt2
Dim lines2 As Integer = Tables("出入库").Compute("count(物料编号)","物料编号 ='" & sss2 & "'")
dr912("行数") = lines2
dr912("月数") = months2
dr912("每月行数") = lines2 / months2
Next
上面这段代码是希望从“出入库”这个数据表统计数据并将结果放入“库存分析”那个数据表。但是在执行时总是出现提示:
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2022.1.30.2
错误所在事件:表,库存分析,DataColChanged
详细错误信息:
调用的目标发生了异常。
列“占比”不属于表 出入库。
“库存分析”那个表是有“占比”这列的,但是我并没有去执行 “库存分析” 的 DataColChanged 事件啊。