Foxtable(狐表)用户栏目专家坐堂 → [讨论]根据条件表里的值生成多个报表


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

主题:[讨论]根据条件表里的值生成多个报表

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


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2015/5/28 13:38:00 [显示全部帖子]

 for each  s as string in datatables("表名").getValues("班级名称")

Dim Book As New XLS.Book(ProjectPath & "Attachments\学籍卡.xls") '打开模板 
Dim dr1 As DataRow = Tables("条件").Current.DataRow
Dim fl As String = ProjectPath & "Reports\" & s & ".xls" 
Dim Sheet As XLS.Sheet = Book.Sheets(0) 
Sheet(1,9).Value = "<[班级名称] = '" & s &"'>"
Book.Build() '生成报表 
Book.Save(fl) 
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fl)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Dim Rg As MSExcel.Range = Ws.Cells
'Rg.EntireColumn.AutoFit   '自动调整列宽
'Rg.EntireRow.AutoFit  '自动调整行高
'Rg.WrapText = True 
rg.ShrinkToFit = True
App.Visible = False
app.quit

next

 


 回到顶部