以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 关于直接生成pdf报表的一个问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=69855) |
-- 作者:heying325 -- 发布时间:2015/6/11 20:46:00 -- 关于直接生成pdf报表的一个问题 Dim Book As New XLS.Book(ProjectPath & "Attachments\\订单.xlsx") Dim fl As String = ProjectPath & "Reports\\订单.pdf" Book.Build() Book.SaveToPDF(fl) Dim Proc As New Process Proc.File = fl Proc.Start() 利用这上面的代码,我想直接生成pdf报表。。。可是每次都会跳出这样一个窗口 点完“是” 或者 “否” pdf报表才会出来。。请问,我怎么能去掉这个窗口?
|
-- 作者:大红袍 -- 发布时间:2015/6/11 20:53:00 -- 这样试试
Dim Book As New XLS.Book(ProjectPath & "Attachments\\订单.xlsx")
Dim fl As String = ProjectPath & "Reports\\订单.pdf"
Book.Build()
Book.Save(fl)
Book.SaveToPDF(fl)
Dim Proc As New Process
Proc.File = fl
Proc.Start()
|
-- 作者:heying325 -- 发布时间:2015/6/11 21:06:00 -- 还是会跳出来! |
-- 作者:大红袍 -- 发布时间:2015/6/11 21:07:00 -- 例子发上来。 |
-- 作者:大红袍 -- 发布时间:2015/6/11 21:16:00 -- Dim Book As New XLS.Book(ProjectPath & "Attachments\\订单.xlsx")
Dim f1 As String = ProjectPath & "Reports\\订单.xls"
Dim f2 As String = ProjectPath & "Reports\\订单.pdf"
Book.Build()
Book.Save(f1)
Dim App As New MSExcel.Application
try Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(f1) \'创建Excel文件对应的PDF文件 wb.Saved = True wb.ExportAsFixedFormat(MSExcel.XlFixedFormatType.xlTypePDF, f2, MsExcel.XlFixedFormatQuality.xlQualityStandard, True, True, System.Reflection.Missing.Value, System.Reflection.Missing.Value, False, System.Reflection.Missing.Value) app.quit catch ex As exception msgbox(ex.message) app.quit End try Dim Proc As New Process
Proc.File = f2
Proc.Start() |