Foxtable(狐表)用户栏目专家坐堂 → 下列代码不能正确执行


  共有10046人关注过本帖树形打印复制链接

主题:下列代码不能正确执行

帅哥哟,离线,有人找我吗?
lpxjw_zyl
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:376 积分:4189 威望:0 精华:0 注册:2008/9/1 14:18:00
下列代码不能正确执行  发帖心情 Post By: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

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By: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

 


 回到顶部