Foxtable(狐表)用户栏目专家坐堂 → [求助]代码修改(已解决)


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

主题:[求助]代码修改(已解决)

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


加好友 发短信
等级:童狐 帖子:245 积分:3629 威望:0 精华:1 注册:2010/5/9 18:45:00
  发帖心情 Post By:2012/6/13 15:48:00 [显示全部帖子]

For Each dr1 As Row In DataTables("单位系数").Rows
    For Each dr2 As DataCol In DataTables("单位系数").DataCols
        For i As Integer = 0 To dr1.Count-1
            If dr1.IsNull("部门")  Then
                dr1(dr2.Name) = Nothing
            Else
                Dim pr As Double = DataTables("个人数据").Compute("Sum(系数_1)","[部门_ & dr2.name] = '" & dr1("部门") & "'")
                dr1(dr2.Name) = pr
            End If
        Next
    Next
Next
   
[此贴子已经被作者于2012-6-13 15:58:06编辑过]

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


加好友 发短信
等级:童狐 帖子:245 积分:3629 威望:0 精华:1 注册:2010/5/9 18:45:00
  发帖心情 Post By:2012/6/13 16:03:00 [显示全部帖子]

这样看看:

For Each dr1 As DataRow In DataTables("单位系数").DataRows
    For Each dr2 As DataCol In DataTables("单位系数").DataCols
        For Each i As DataRow In dr1
            If i.IsNull("部门")  Then
                i(dr2.Name) = Nothing
            Else
                Dim pr As Double = DataTables("个人数据").Compute("Sum(系数_1)","["部门] = '" & dr1("部门") & "'")
                i(dr2.Name) = pr
            End If
        Next
    Next
Next


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


加好友 发短信
等级:童狐 帖子:245 积分:3629 威望:0 精华:1 注册:2010/5/9 18:45:00
  发帖心情 Post By:2012/6/13 16:23:00 [显示全部帖子]

我弄错了

这样看看:

For Each dr1 As DataRow In DataTables("单位系数").DataRows
For Each dr2 As DataCol In DataTables("单位系数").DataCols
If dr1.IsNull("部门") Then
dr1(dr2.Name) = Nothing
Else
Dim pr As Double = DataTables("个人数据").Compute("Sum(系数_1)","[部门] = '" & dr1("部门") & "'")
dr1(dr2.Name) = pr
End If
Next
Next


[此贴子已经被作者于2012-6-13 16:24:28编辑过]

 回到顶部