Foxtable(狐表)用户栏目专家坐堂 → 建表问题


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

主题:建表问题

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


加好友 发短信
等级:一尾狐 帖子:407 积分:3194 威望:0 精华:0 注册:2011/2/28 11:57:00
建表问题  发帖心情 Post By:2021/2/14 15:12:00 [显示全部帖子]

Dim dtb As New DataTableBuilder("干部选拔任用评议统计表")
dtb.AddDef("单位",Gettype(String),50)
dtb.AddDef("单位代码",Gettype(String),8)
dtb.AddDef("职工数",Gettype(Double))
dtb.AddDef("调查人数",Gettype(Double))
Dim djs() As String = {"A","B","C","D"}
Dim pjs() As String = {"好","一般","不好","不了解"}
For i As Integer = 1 To 4
    For Each dj As String In djs
            dtb.AddDef("内容"& i & dj & "人",Gettype(Decimal),"","内容" & i & "_"& dj &"_人数")
            dtb.AddDef("内容"& i & dj & "%",Gettype(Decimal),"","内容" & i & "_"& dj &"_%")
        Next
Next
Dim dj1s() As String = {"A","B","C","D","E","F","G","H","I"}
Dim wts() As String =  {"不严格","个人说了算","干部标准不够","论资排辈","任人唯亲","跑官要官","回避不严格","擅自设置职务名称","结构不合理"}
For j As Integer = 5 To 5
    For Each dj1 As String In dj1s
        dtb.AddDef("内容"& j & dj1 & "人",Gettype(Decimal),"","内容" & j & "_"& dj1 &"_人数")
        dtb.AddDef("内容"& j & dj1 & "%",Gettype(Decimal),"","内容" & j & "_"& dj1 &"_%")
    Next
Next
dtb.Build()
执行结果是:
图片点击可在新窗口打开查看此主题相关图片如下:建表.png
图片点击可在新窗口打开查看
要想执行结果为:
图片点击可在新窗口打开查看此主题相关图片如下:建表1.png
图片点击可在新窗口打开查看
即表中"A","B","C","D"依次更换为"好","一般","不好","不了解"。
如何修改代码?请指教。谢谢!


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


加好友 发短信
等级:一尾狐 帖子:407 积分:3194 威望:0 精华:0 注册:2011/2/28 11:57:00
  发帖心情 Post By:2021/2/14 16:51:00 [显示全部帖子]

已经解决了,谢谢!
For j As Integer = 0 To djs.length - 1
     dtb.AddDef("内容"& i & djs(j) & "人",Gettype(Decimal),"","内容" & i & "_"& pjs(j) &"_人数")
     dtb.AddDef("内容"& i & djs(j) & "%",Gettype(Decimal),"","内容" & i & "_"& pjs(j) &"_%")
Next

 回到顶部