Foxtable(狐表)用户栏目专家坐堂 → [求助]清除“0”值


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

主题:[求助]清除“0”值

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


加好友 发短信
等级:三尾狐 帖子:787 积分:6349 威望:0 精华:0 注册:2008/9/1 8:26:00
[求助]清除“0”值  发帖心情 Post By:2014/11/27 16:17:00 [只看该作者]

“查找户名面积”按钮

For Each r As Row In Tables("财兑").Rows
    Dim fdr As DataRow = DataTables("兑现").find("乡镇= '" & r("乡镇") & "' and 村名= '" & r("村名") & "'and 组别= '" & r("组别") & "'and 户名 = '" & r("财政姓名") & "'")
    If fdr IsNot Nothing Then
        r("户名")=fdr("户名")
        r("生态林_面积")=fdr("生态林_面积")
        r("生态林_不兑面积")=fdr("生态林_不兑面积")
        r("生态林_扣减面积")=fdr("生态林_扣减面积")
        r("经济林_面积")=fdr("经济林_面积")
        r("经济林_不兑面积")=fdr("经济林_不兑面积")
        r("经济林_扣减面积")=fdr("经济林_扣减面积")
    End If
Next

Datacolchanged代码:

If e.DataRow.IsNull("生态林_面积") = False  Then
    e.DataRow("生态林_现补")=e.DataRow("生态林_面积")*20
    e.DataRow("生态林_粮补")=e.DataRow("生态林_面积")*105
    e.DataRow("生态林_应补")=e.DataRow("生态林_现补")+e.DataRow("生态林_粮补")
End If
If e.DataRow.IsNull("生态林_不兑面积") = False  Then
    e.DataRow("生态林_应扣")=e.DataRow("生态林_不兑面积")*20
End If
If e.DataRow.IsNull("生态林_扣减面积") = False  Then
    e.DataRow("生态林_扣减")=e.DataRow("生态林_扣减面积")*105
End If
If e.DataRow.IsNull("生态林_不兑面积") = False OrElse e.DataRow.IsNull("生态林_扣减面积") = False Then
    e.DataRow("生态林_扣补")=e.DataRow("生态林_应扣")+e.DataRow("生态林_扣减")
    e.DataRow("生态林_实现补")=e.DataRow("生态林_现补")-e.DataRow("生态林_应扣")
    e.DataRow("生态林_实粮补")=e.DataRow("生态林_粮补")-e.DataRow("生态林_扣减")
    e.DataRow("生态林_实补")=e.DataRow("生态林_实现补")+e.DataRow("生态林_实粮补")
End If
If e.DataRow.IsNull("经济林_面积") = False  Then
    e.DataRow("经济林_现补")=e.DataRow("经济林_面积")*20
    e.DataRow("经济林_粮补")=e.DataRow("经济林_面积")*105
    e.DataRow("经济林_应补")=e.DataRow("经济林_现补")+e.DataRow("经济林_粮补")
End If
If e.DataRow.IsNull("经济林_不兑面积") = False  Then
    e.DataRow("经济林_应扣")=e.DataRow("经济林_不兑面积")*20
End If
If e.DataRow.IsNull("经济林_扣减面积") = False  Then
    e.DataRow("经济林_扣减")=e.DataRow("经济林_扣减面积")*105
End If
If e.DataRow.IsNull("经济林_不兑面积") = False OrElse e.DataRow.IsNull("经济林_扣减面积") = False Then
    e.DataRow("经济林_扣补")=e.DataRow("经济林_应扣")+e.DataRow("经济林_扣减")
    e.DataRow("经济林_实现补")=e.DataRow("经济林_现补")-e.DataRow("经济林_应扣")
    e.DataRow("经济林_实粮补")=e.DataRow("经济林_粮补")-e.DataRow("经济林_扣减")
    e.DataRow("经济林_实补")=e.DataRow("经济林_实现补")+e.DataRow("经济林_实粮补")
End If
If e.DataRow.IsNull("生态林_实补") = False OrElse e.DataRow.IsNull("经济林_实补") = False Then
    e.DataRow("实补合计")=e.DataRow("生态林_实补")+e.DataRow("经济林_实补")
End If

上述代码执行后表中出现许多“0”,很不好看,能否用代码消除。


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


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

 你可以判断然后设置值,比如

 

 e.DataRow("实补合计") = iif(e.DataRow("实补合计") = 0, Nothing, e.DataRow("实补合计"))


 回到顶部