DataTables("凭证明细")表用了动态加载,Compute改成SQLCompute,系统启动变的奇慢,不知道啥原因
Select Case e.DataCol.name
Case "年份","月份","一级码"
If e.DataRow.IsNull("年份") OrElse e.DataRow.IsNull("月份") OrElse e.DataRow.IsNull("一级码") Then
e.DataRow("借方金额") = Nothing
e.DataRow("贷方金额") = Nothing
Else
e.DataRow("借方金额") = DataTables("凭证明细").SQLCompute("Sum(借方金额)","年份 = " & e.DataRow("年份") & " And [月份] = " & e.DataRow("月份") & " And [一级码] = '" & e.DataRow("一级码") & "'")
e.DataRow("贷方金额") = DataTables("凭证明细").SQLCompute("Sum(贷方金额)","年份 = " & e.DataRow("年份") & " And [月份] = " & e.DataRow("月份") & " And [一级码] = '" & e.DataRow("一级码") & "'")
End If
End Select