此主题相关图片如下:2.png
3、这是代码:哪儿错了?Select e.DataCol.Name
Case "分公司","期间_起始日","期间_截止日"
If e.DataRow.IsNull("分公司") = False AndAlso e.DataRow.IsNull("期间_起始日") = False AndAlso e.DataRow.IsNull("期间_截止日") = False Then
e.DataRow("回款_其它老") = DataTables("回款明细").Compute("sum(回款金额)","分公司='" & e.DataRow("分公司") & "' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 收款方式 <> '承兑' and 年份 <> 2013 ")
e.DataRow("回款_其它新") = DataTables("回款明细").Compute("sum(回款金额)","分公司='" & e.DataRow("分公司") & "' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 收款方式 <> '承兑' and 年份 = 2013 ")
e.DataRow("回款_承兑老") = DataTables("回款明细").Compute("sum(回款金额)","分公司='" & e.DataRow("分公司") & "' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 收款方式 = '承兑' and 年份 <> 2013 ")
e.DataRow("回款_承兑新") = DataTables("回款明细").Compute("sum(回款金额)","分公司='" & e.DataRow("分公司") & "' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 收款方式 = '承兑' and 年份 = 2013 ")
e.DataRow("费用_经理往来") = DataTables("费用").Compute("sum(支出金额)","分公司='" & e.DataRow("分公司") & "' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 费用类型 = '经理往来'")
e.DataRow("费用_劳务费用") = DataTables("费用").Compute("sum(支出金额)","分公司='" & e.DataRow("分公司") & "' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 费用类型 = '劳务费用'")
e.DataRow("费用_内部往来") = DataTables("费用").Compute("sum(支出金额)","分公司='" & e.DataRow("分公司") & "' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 费用类型 = '内部往来'")
e.DataRow("费用_累计已付款") = e.DataRow("费用_经理往来") + e.DataRow("费用_劳务费用") + e.DataRow("费用_内部往来")
e.DataRow("剩余可支配金额") = e.DataRow("回款_可支配总额") - e.DataRow("费用_累计已付款")
e.DataRow("备注") = Nothing
Else
e.DataRow("回款_其它老") = Nothing
e.DataRow("回款_其它新") = Nothing
e.DataRow("回款_承兑老") = Nothing
e.DataRow("回款_承兑新") = Nothing
e.DataRow("费用_经理往来") = Nothing
e.DataRow("费用_劳务费用") = Nothing
e.DataRow("费用_内部往来") = Nothing
e.DataRow("费用_累计已付款") = Nothing
e.DataRow("剩余可支配金额") = Nothing
e.DataRow("备注") = Nothing
End If
End Select