Foxtable(狐表)用户栏目专家坐堂 → 求教2个复制问题


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

主题:求教2个复制问题

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


加好友 发短信
等级:超级版主 帖子:521 积分:4910 威望:0 精华:7 注册:2008/9/2 22:22:00
  发帖心情 Post By:2008/11/24 23:04:00 [显示全部帖子]

Dim i,i1,i2,i3,i4 as Integer
Dim Ta,Ta1 As Table
Ta  = Tables("学生各学科前5名成绩单")
Ta1 = Tables("学生各科成绩表")
Dim Ls As String() = {"数学","英语","政治","历史","地理","生物","物理"}
datatables("学生各学科前5名成绩单").datarows.clear()
dim f As New Filler
f.SourceTable = DataTables("学生各科成绩表")
f.SourceCols = "班级,年级,语文班级排名,姓名,语文"
f.DataTable = DataTables("学生各学科前5名成绩单")
f.DataCols = "班级,年级,语文_名次,语文_姓名,语文_成绩"
f.Filter="[语文班级排名]<=5"
f.Fill() '填充
Ta.Sort = "年级,班级"

For i1  = 0 To Ls.Length-1
  Ta1.Filter = "[" & Ls(i1) & "班级排名] <=5"
  i = Ta.Rows.count-1
  i2 = Ta1.Rows.count-1
  If i < i2 Then
     Ta.Addnew(i2-i1)
  End if
  i3 = Math.Max(i1,i2)
  For i4 = 0 to i3
     Ta.Rows(i4)(Ls(i1) & "_名次") = Ta1.Rows(i4)(Ls(i1) & "班级排名")
     Ta.Rows(i4)(Ls(i1) & "_姓名") = Ta1.Rows(i4)("姓名")
     Ta.Rows(i4)(Ls(i1) & "_成绩") = Ta1.Rows(i4)(Ls(i1))
  Next
Next

Dim Ft As String
For Each dc As DataCol In DataTables("学生各学科前5名成绩单").DataCols
  Ft = Ft & " and " & dc.Name & " Is Null"
Next
DataTables("学生各学科前5名成绩单").DeleteFor(Ft.SubString(5))


 回到顶部