Foxtable(狐表)用户栏目专家坐堂 → 专业报表求助


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

主题:专业报表求助

帅哥,在线噢!
狐狸爸爸
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/5 14:47:00 [显示全部帖子]

在命令窗口执行:

 

Dim s As String
For Each js As String In DataTables("报名表").GetUniqueValues("","竞赛名称")
    s = "2013年" & js &  vbcrlf
    For Each dq As String In DataTables("报名表").GetUniqueValues("竞赛名称 = '" & js & "'","区")
        s = s &  dq & vbcrlf
        s = s & "领队:"
        For Each ld As String In DataTables("报名表").GetUniqueValues("竞赛名称 = '" & js & "' And 区 = '" & dq & "'","领队")
            s = s & ld & ","
        Next
        s= s.trim(",") & vbcrlf
        s = s & "教练:"
        For Each jl As String In DataTables("报名表").GetUniqueValues("竞赛名称 = '" & js & "' And 区 = '" & dq & "'","教练")
            s = s & jl & ","
        Next
        s= s.trim(",") & vbcrlf
        s = s & "队员:"
        For Each dy As String In DataTables("报名表").GetUniqueValues("竞赛名称 = '" & js & "' And 区 = '" & dq & "'","姓名")
            s = s & dy & ","
        Next
        s= s.trim(",") & vbcrlf
    Next
Next
output.show(s)

 

就得到你要的数据


 回到顶部
帅哥,在线噢!
狐狸爸爸
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/5 17:32:00 [显示全部帖子]

呵呵,得到了你要的数据,连打印也不会吗?

 

Dim s As String
For Each js As String In DataTables("报名表").GetUniqueValues("","竞赛名称")
    s = "2013年" & js &  vbcrlf
    For Each dq As String In DataTables("报名表").GetUniqueValues("竞赛名称 = '" & js & "'","区")
        s = s &  vbcrlf & dq & vbcrlf
        s = s & "领队:"
        For Each ld As String In DataTables("报名表").GetUniqueValues("竞赛名称 = '" & js & "' And 区 = '" & dq & "'","领队")
            s = s & ld & ","
        Next
        s= s.trim(",") & vbcrlf
        s = s & "教练:"
        For Each jl As String In DataTables("报名表").GetUniqueValues("竞赛名称 = '" & js & "' And 区 = '" & dq & "'","教练")
            s = s & jl & ","
        Next
        s= s.trim(",") & vbcrlf
        s = s & "队员:"
        For Each dy As String In DataTables("报名表").GetUniqueValues("竞赛名称 = '" & js & "' And 区 = '" & dq & "'","姓名")
            s = s & dy & ","
        Next
        s= s.trim(",") & vbcrlf
    Next
Next
Dim doc As New PrintDoc '定义一个报表
Dim rt As New prt.RenderText '定义一个文本对象
rt.Text = s '设置文本对象的内容
doc.Body.Children.Add(rt) '将文本对象加入到报表
doc.Preview() '预览

 

不能太依赖别人哦。


 回到顶部