Foxtable(狐表)用户栏目专家坐堂 → [求助]表关样式


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

主题:[求助]表关样式

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


加好友 发短信
等级:一尾狐 帖子:407 积分:3194 威望:0 精华:0 注册:2011/2/28 11:57:00
[求助]表关样式  发帖心情 Post By:2019/11/14 10:40:00 [只看该作者]

Dim km1s() As String =  {"语文","数学","英语"}
    For Each bb As String In DataTables("目标设置").GetValues("部别", "[年级]= '" & tjnj & "'And 类别 = '" & tjlb & "'")
        For Each km1 As String In km1s
            dtb.AddDef( bb & km1 ,Gettype(Double),"", km1 &"_"& bb )
        Next
    Next
Next

代码执行结果:
图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看
显示要求
图片点击可在新窗口打开查看此主题相关图片如下:2.png
图片点击可在新窗口打开查看
不知问题出在哪儿?请指教。谢谢!

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


加好友 发短信
等级:超级版主 帖子:110443 积分:562081 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/11/14 10:47:00 [只看该作者]

Dim km1s() As String =  {"语文","数学","英语"}
        For Each km1 As String In km1s
    For Each bb As String In DataTables("目标设置").GetValues("部别", "[年级]= '" & tjnj & "'And 类别 = '" & tjlb & "'")

            dtb.AddDef( bb & km1 ,Gettype(Double),"", km1 &"_"& bb )
        Next
    Next
Next

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


加好友 发短信
等级:一尾狐 帖子:407 积分:3194 威望:0 精华:0 注册:2011/2/28 11:57:00
  发帖心情 Post By:2019/11/14 11:03:00 [只看该作者]

还是没变。

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


加好友 发短信
等级:超级版主 帖子:110443 积分:562081 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/11/14 11:11:00 [只看该作者]

不可能

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


加好友 发短信
等级:一尾狐 帖子:407 积分:3194 威望:0 精华:0 注册:2011/2/28 11:57:00
  发帖心情 Post By:2019/11/14 11:16:00 [只看该作者]

还是上次那案例。
Dim Values() As String = {"总分"}
Dim s1() As String = New String() {"总分"}
Dim lm1s() As String = {"年级","类别","单位代码"}
Dim lm2s() As String = {"单位","项目"}
Dim dt As Table = Tables("成绩库")
Dim km1s() As String =  {"语文","数学","英语"}
Dim km2s() As String =  {"物理","化学","生物","政治","历史","地理"}
Dim tjnj As String = "2020"
Dim tjlb As String = "4期"
For Each Value As String In Values
    '建表
    Dim bm As String = "高" & tjnj & "级" & tjlb & "市级重点有效分及贡献率统计表"
    Dim dtb As New DataTableBuilder(bm)
    For Each lm1 As String In lm1s
        dtb.AddDef(""& lm1 &"",Gettype(String),8)
    Next
    For Each lm2 As String In lm2s
        dtb.AddDef(""& lm2 &"",Gettype(String),8)
    Next
    For Each bb As String In DataTables("目标设置").GetValues("部别", "[年级]= '" & tjnj & "'And 类别 = '" & tjlb & "'")
        dtb.AddDef("总分"& bb ,Gettype(Double),"","总分上线_"& bb & "")
    Next
    For Each km1 As String In km1s
        For Each bb As String In DataTables("目标设置").GetValues("部别", "[年级]= '" & tjnj & "'And 类别 = '" & tjlb & "'")
            dtb.AddDef( bb & km1 ,Gettype(Double),"", km1 &"_"& bb )
        Next
    Next
    For Each km2 As String In km2s
        dtb.AddDef(""& km2 &"",Gettype(Double),"")
    Next    
    dtb.Build()
    '表处理
    Tables( "高" & tjnj & "级" & tjlb & "市级重点有效分及贡献率统计表").SetHeaderRowHeight(35,35) '表名的标题行的行高
    Tables( "高" & tjnj & "级" & tjlb & "市级重点有效分及贡献率统计表").DefaultRowHeight = 35 '设置默认的行高
    Dim str As String = ""
    For Each lm1 As String In lm1s
        str = str & "|" & lm1 & "|40"
    Next
    For Each lm2 As String In lm2s
        str = str & "|" & lm2 & "|60"
    Next
    For Each bb As String In DataTables("目标设置").GetValues("部别", "[年级]= '" & tjnj & "'And 类别 = '" & tjlb & "'")
        For Each lm1 As String In lm1s
            Tables( "高" & tjnj & "级" & tjlb & "市级重点有效分及贡献率统计表").Cols(""& lm1 &"").TextAlign = TextAlignEnum.Center
        Next
        For Each lm2 As String In lm2s
            Tables( "高" & tjnj & "级" & tjlb & "市级重点有效分及贡献率统计表").Cols(""& lm2 &"").TextAlign = TextAlignEnum.Center
        Next
        Tables( "高" & tjnj & "级" & tjlb & "市级重点有效分及贡献率统计表").Cols("总分"& bb ).TextAlign = TextAlignEnum.Center
        str = str & "|总分" & bb & "|42"
    Next
    For Each bb As String In DataTables("目标设置").GetValues("部别", "[年级]= '" & tjnj & "'And 类别 = '" & tjlb & "'")
        For Each km1 As String In km1s
            str = str & "|"& bb & km1 &"|40"
        Next
    Next
    For Each km2 As String In km2s
        str = str & "|" & km2 & "|40"
    Next
    Tables( "高" & tjnj & "级" & tjlb & "市级重点有效分及贡献率统计表").SetColVisibleWidth("" & str.trim("|"))    
    '统计
    
Next
StatusBar.Reset
StatusBar.DefaultMessage = "统计完毕!"
Tables("成绩库").ResumeRedraw



[此贴子已经被作者于2019/11/14 11:35:32编辑过]

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


加好友 发短信
等级:狐神 帖子:4742 积分:34508 威望:0 精华:0 注册:2008/8/31 22:44:00
  发帖心情 Post By:2019/11/14 11:18:00 [只看该作者]

试用版?

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


加好友 发短信
等级:一尾狐 帖子:407 积分:3194 威望:0 精华:0 注册:2011/2/28 11:57:00
  发帖心情 Post By:2019/11/14 11:28:00 [只看该作者]

正版。

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


加好友 发短信
等级:超级版主 帖子:110443 积分:562081 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/11/14 11:35:00 [只看该作者]

关闭退出项目,删除项目所在的文件夹里的bin目录,然后重启项目试试。
我这样测试没有问题。

Dim Values() As String = {"总分"}
Dim s1() As String = New String() {"总分"}
Dim lm1s() As String = {"年级","类别","单位代码"}
Dim lm2s() As String = {"单位","项目"}

Dim km1s() As String =  {"语文","数学","英语"}
Dim km2s() As String =  {"物理","化学","生物","政治","历史","地理"}

Dim tjnj As String = "2020"
Dim tjlb As String = "4期"
Dim bm As String = "高" & tjnj & "级" & tjlb & "市级重点有效分及贡献率统计表"
Dim dtb As New DataTableBuilder(bm)
For Each lm1 As String In lm1s
    dtb.AddDef(""& lm1 &"",Gettype(String),8)
Next
For Each lm2 As String In lm2s
    dtb.AddDef(""& lm2 &"",Gettype(String),8)
Next
Dim km2s222() As String =  {"高理","高文"}
For Each bb As String In km2s222
    dtb.AddDef("总分"& bb ,Gettype(Double),"","总分上线_"& bb & "")
Next
For Each km1 As String In km1s
    For Each bb As String In km2s222
        dtb.AddDef( bb & km1 ,Gettype(Double),"", km1 &"_"& bb )
    Next
Next
For Each km2 As String In km2s
    dtb.AddDef(""& km2 &"",Gettype(Double),"")
Next
dtb.Build()

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


加好友 发短信
等级:一尾狐 帖子:407 积分:3194 威望:0 精华:0 注册:2011/2/28 11:57:00
  发帖心情 Post By:2019/11/14 11:41:00 [只看该作者]

得行了。谢谢!

 回到顶部