以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 下列代码不能正确执行 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=14420) |
-- 作者:lpxjw_zyl -- 发布时间:2011/11/18 15:52:00 -- 下列代码不能正确执行 If e.Book.TempLate = "收入明细" Then If e.DataRow IsNot Nothing Then Dim Filter1 As String = "日期 = \'" & e.DataRow("日期") & "\'" Dim tj1,tj2,tj3,tj4,tj5,tj6,tj7,tj8 As Double tj1 = DataTables("收入明细").Compute("Sum(日销售额)",Filter1) tj2 = DataTables("收入明细").Compute("Sum(POS刷卡)",Filter1) tj3 = DataTables("收入明细").Compute("Sum(客户欠款)",Filter1) tj4 = DataTables("收入明细").Compute("Sum(客户还款)",Filter1) tj5 = DataTables("收入明细").Compute("Sum(产品返利)",Filter1) tj6 = DataTables("收入明细").Compute("Sum(其它存款)",Filter1) tj7 = DataTables("收入明细").Compute("Sum(应收帐款)",Filter1) tj8 = DataTables("收入明细").Compute("Sum(实收帐款)",Filter1) e.Book.Marks("标记") = "收入说明:日销售额" & tj1 & "元,POS刷卡" & tj2 & "元,客户欠款" & tj3 & "元,客户还款" & tj4 & "元,产品返利" & tj5 & "元,其它存款" & tj6 & "元,应收帐款" & tj7 & "元,实收帐款" & tj8 & "元" End If ElseIf e.Book.TempLate = "收支明细" Then If e.DataRow IsNot Nothing Then Dim Filter1 As String = "日期 = \'" & e.DataRow("日期") & "\'" Dim tj1,tj2,tj3,tj4,tj5,tj6,tj7,tj8 As Double tj1 = DataTables("收支汇总").Compute("sum(收入_应收帐款)",Filter1) tj2 = DataTables("收支汇总").Compute("Sum(收入_实收帐款)",Filter1) tj3 = DataTables("收支汇总").Compute("Sum(支出_应支帐款)",Filter1) tj4 = DataTables("收支汇总").Compute("Sum(支出_实支帐款)",Filter1) tj5 = tj1-tj3 tj6 = tj2-tj4 e.Book.Marks("A") = tj1 e.Book.Marks("B") = tj2 e.Book.Marks("C") = tj3 e.Book.Marks("D") = tj4 e.Book.Marks("E") = tj5 e.Book.Marks("F") = tj6 End If End If |
-- 作者:狐狸爸爸 -- 发布时间:2011/11/18 16:45:00 -- 发现一个错误: Dim Filter1 As String = "日期 = \'" & e.DataRow("日期") & "\'"
应该: Dim Filter1 As String = "日期 = #" & e.DataRow("日期") & "#"
建议看看: http://www.foxtable.com/help/topics/1284.htm
|