Foxtable(狐表)用户栏目专家坐堂 → 再求做表


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

主题:再求做表

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/6/12 16:32:00 [显示全部帖子]

 看不懂你说什么

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/6/12 16:46:00 [显示全部帖子]

Dim tbs() As String = {"数据1", "数据2"}
Dim cs1() As String = {"指标1", "指标2", "指标3"}
Dim cs2() As String = {"指标4", "指标5", "指标6"}
Dim ls As new List(Of String())
ls.Add(cs1)
ls.add(cs2)

For i As Integer = 0 To tbs.Length - 1
    Dim cs As String() = ls(i)
    For Each r As Row In Tables(tbs(i)).rows
        Dim fdr As DataRow = DataTables("汇总").Find("指标项 = '" & r("名称") & "'")
        If fdr Is Nothing Then
            fdr = DataTables("汇总").AddNew
            fdr("指标项") = r("名称")
        End If
        For j As Integer = 0 To cs.Length - 1
            fdr(Tables("汇总").Cols(j+1).Name) += iif(r(cs(j))>0, 1, 0)
        Next
    Next
Next


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/6/12 17:53:00 [显示全部帖子]

Dim tbs() As String = {"数据1", "数据2"}
Dim cs1() As String = {"指标1", "指标2", "指标3"}
Dim cs2() As String = {"指标4", "指标5", "指标6"}
Dim ls As new List(Of String())
ls.Add(cs1)
ls.add(cs2)

For i As Integer = 0 To tbs.Length - 1
    Dim cs As String() = ls(i)
    For Each r As Row In Tables(tbs(i)).rows
       
        For j As Integer = 0 To cs.Length - 1
            If r(cs(j)) = 0 Then
                Dim fdr As DataRow = DataTables("汇总").Find("指标项 = '" & cs(j) & "'")
               
                If fdr Is Nothing Then
                    fdr = DataTables("汇总").AddNew
                    fdr("指标项") = cs(j)
                End If
                For k As Integer = 0 To cs.Length - 1
                    If r(cs(k)) > 0 Then
                        fdr(Tables("汇总").Cols(k+1).Name) += 1
                    End If
                Next
            End If
        Next
    Next
Next


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/6/16 12:20:00 [显示全部帖子]

 那你就加入对应的列啊

 

Dim tbs() As String = {"数据1", "数据2"}
Dim cs1() As String = {"指标1", "指标2", "指标3"}
Dim cs2() As String = {"指标4", "指标5", "指标6"}
Dim ls As new List(Of String())
ls.Add(cs1)
ls.add(cs2)

For i As Integer = 0 To tbs.Length - 1
    Dim cs As String() = ls(i)
    For Each r As Row In Tables(tbs(i)).rows
       
        For j As Integer = 0 To cs.Length - 1
            If r(cs(j)) = 0 Then
                Dim fdr As DataRow = DataTables("汇总").Find("指标项 = '" & cs(j) & "'")
               
                If fdr Is Nothing Then
                    fdr = DataTables("汇总").AddNew
                    fdr("指标项") = cs(j)
                End If
                For k As Integer = 0 To cs.Length - 1
                    If r(cs(k)) > 0 Then
                        fdr(cs(k)) += 1
                    End If
                Next
            End If
        Next
    Next
Next


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/6/17 18:59:00 [显示全部帖子]

 看7楼,不会。

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/6/23 12:45:00 [显示全部帖子]

Dim tbs() As String = {"数据1"}
Dim cs1() As String = {"指标1", "指标2", "指标3"}
Dim ls As new List(Of String())
ls.Add(cs1)

For i As Integer = 0 To tbs.Length - 1
    Dim cs As String() = ls(i)
    For Each r As Row In Tables(tbs(i)).rows
       
        For j As Integer = 0 To cs.Length - 1
            If r(cs(j)) = 0 Then
                Dim fdr As DataRow = DataTables("汇总").Find("指标项 = '" & cs(j) & "'")
               
                If fdr Is Nothing Then
                    fdr = DataTables("汇总").AddNew
                    fdr("指标项") = cs(j)
                End If
                For k As Integer = 0 To cs.Length - 1
                    If r(cs(k)) > 0 Then
                        fdr(cs(k)) += 1
                    End If
                Next
            End If
        Next
    Next
Next

 

 

看到底多慢,具体可以做例子发上来测试。


 回到顶部