Foxtable(狐表)用户栏目专家坐堂 → 贷码不计算也不提示错误


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

主题:贷码不计算也不提示错误

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


加好友 发短信
等级:四尾狐 帖子:929 积分:6500 威望:0 精华:0 注册:2014/6/25 10:48:00
贷码不计算也不提示错误  发帖心情 Post By:2019/1/15 14:47:00 [只看该作者]

老师,下面代码分别是从基础表中统计汇总月本数、本年数、以前合计,可是设置代码后并不计算也不提示错误,请老师帮忙看一下是怎么回事??

If e.DataCol.Name = "债务编码" Then  
    Dim filter1 As String = "债务编码 = '" & e.DataRow("债务编码")  & "' And 年度 = '" & e.DataRow("年度") & "'And 月份 = '" & e.DataRow("月份") & "'"
    e.DataRow("本月举借") = DataTables("债务举借明细表").Compute("sum(举借金额)",filter1 ) 
    e.DataRow("本月偿还") = DataTables("平台还本付息明细表").Compute("sum(偿还本金)",filter1 ) 
    e.DataRow("本月支付") = DataTables("平台还本付息明细表").Compute("sum(偿还利息)",filter1 ) 
End If

If e.DataCol.Name = "债务编码" Then  
    Dim filter2 As String = "债务编码 = '" & e.DataRow("债务编码")  & "' And 年度 = '" & e.DataRow("年度") & "'And 月份 <= '" & e.DataRow("月份") & "'"
    e.DataRow("本年举借") = DataTables("债务举借明细表").Compute("sum(举借金额)",filter2 )    
    e.DataRow("本年偿还") = DataTables("平台还本付息明细表").Compute("sum(偿还本金)",filter2 ) 
    e.DataRow("本年支付") = DataTables("平台还本付息明细表").Compute("sum(偿还利息)",filter2 )                        
End If

If e.DataCol.Name = "债务编码" Then  
    Dim filter3 As String = "债务编码 = '" & e.DataRow("债务编码")  & "' And 年度 < '" & e.DataRow("年度") & "'"
    e.DataRow("以前年度举借") = DataTables("债务举借明细表").Compute("sum(举借金额)",filter3 )  
    e.DataRow("以前年度还本") = DataTables("平台还本付息明细表").Compute("sum(偿还本金)",filter3 ) 
    e.DataRow("以前支付") = DataTables("平台还本付息明细表").Compute("sum(偿还利息)",filter3 )                                       
End If

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


加好友 发短信
等级:四尾狐 帖子:929 积分:6500 威望:0 精华:0 注册:2014/6/25 10:48:00
  发帖心情 Post By:2019/1/15 14:57:00 [只看该作者]

代码没错,是窗口刷新按钮的代码有问题:
下面这段代码要指定具体的列名,请问代码怎么修改呢,谢谢老师
If CurrentTable IsNot Nothing AndAlso CurrentTable.ColSel >= 0 Then
    Dim dc As DataCol = CurrentTable.Cols(CurrentTable.ColSel).DataCol
    dc.RaiseDataColchanged()
End If
具体的列名是“债务编码”

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/15 16:34:00 [只看该作者]

比如


    Dim dc As DataCol = DataTables("表A").DataCols("债务编码")
    dc.RaiseDataColchanged()


 回到顶部