Foxtable(狐表)用户栏目专家坐堂 → 只是预览,不打印


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

主题:只是预览,不打印

美女呀,离线,留言给我吧!
baixiaobai
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:317 积分:2555 威望:0 精华:0 注册:2013/3/8 0:32:00
只是预览,不打印  发帖心情 Post By:2013/5/5 0:40:00 [显示全部帖子]

请帮我看看为什么都是只预览,不直接打印呢????我想要直接打印,不需要预览的呢?


Dim Book As New XLS.Book(ProjectPath & "Attachments\登记单.xls") '打开模板
Dim fl As String = ProjectPath & "Reports\登记单.xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Sheet(1,0).Value = "<窗口1_Table1>"  '细节区定义一
'Sheet(30,0).Value = "<窗口1_Table1,1>"  '细节区定义二
Book.Build() '生成报表
Book.Save(fl) 
Dim Proc As New Process 
Proc.File = fl
Proc.Start()



Dim Book As New XLS.Book(ProjectPath & "Attachments\订单.xls")
Dim file As String = ProjectPath & "Reports\订单.xls"
Book.Build() '生成细节区
Book.Save(file) '保存工作簿


Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(file)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
With Ws.PageSetup
    .PaperSize = MSExcel.XlPaperSize.xlPaperA4   '纸张大小
    .CenterHorizontally = True   '页面水平居中
    .CenterVertically = True '页面垂直居中
    .Zoom = False '以下设置将缩印在一页内
    .FitToPagesWide = 1  '按照1页的宽度打印
    .FitToPagesTall = 1  '按照1页的高度打印
End With
'App.Visible = True
Ws.PrintOut
wb.save
wb.close
App.Quit



 回到顶部