以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  用代码基于模版生成Excel报表时出现的临时文件保存对话框如何不出现  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=72033)

--  作者:guning007
--  发布时间:2015/7/22 15:01:00
--  用代码基于模版生成Excel报表时出现的临时文件保存对话框如何不出现
我做了一些按钮,用代码基于模版生成excel报表,但是发现有的按钮在生成报表是会出现一个随机名称的临时Excel文件是否保存的对话框,而有的不会。

我仔细对比了两个按钮的代码,实在找不出端倪,求指点。 这个Book.Save()有没有什么属性可以设置显示或隐藏那个临时Excel文件对话框呢?

Dim Book As New XLS.Book(ProjectPath & "Attachments\\Invoice.xls")
Dim r As Row = Tables("订单").Current
Dim fl1 As String = "D:\\工作文件\\订单\\" & r("编号") & "\\Commercial Invoice " & r("编号") & ".xls"
Dim fl2 As String = "D:\\工作文件\\订单\\" & r("编号") & "\\Commercial Invoice " & r("编号") & ".pdf"
Book.Build()
Dim Sheet As XLS.Sheet = Book.Sheets("Invoice")
Sheet(0,0).Value = New XLS.Picture(GetImage("LOGO.png"))
Sheet(1,3).Value = "************"
Sheet(2,3).Value = "************"
Sheet(3,3).Value = "************"
Sheet(4,3).Value = "************"
Sheet(5,3).Value = "************"
Sheet(37,1).Value = "************"
Sheet(38,1).Value = "************"
Sheet(39,1).Value = "************"
Sheet(40,1).Value = "************"
Sheet(41,1).Value = "************"
Sheet(42,1).Value = "************"
Sheet(40,4).Value = "************"
Sheet(41,4).Value = "************"
Sheet(44,0).Value = "************"
Book.Save(fl1)
Book.SaveToPDF(fl2)
Dim Proc As New Process
Proc.File = fl2
Proc.Start()


Dim Book As New XLS.Book(ProjectPath & "Attachments\\Packing List-China.xls")
Dim r As Row = Tables("订单").Current
Dim fl1 As String = "D:\\工作文件\\订单\\" & r("编号") & "\\Packing List " & r("编号") & ".xls"
Dim fl2 As String = "D:\\工作文件\\订单\\" & r("编号") & "\\Packing List " & r("编号") & ".pdf"
Book.Build()
Dim Sheet As XLS.Sheet = Book.Sheets("Packing List")
Sheet(0,0).Value = New XLS.Picture(GetImage("LOGO.png"))
Sheet(1,4).Value = "************"
Sheet(2,4).Value = "************"
Sheet(3,4).Value = "************"
Sheet(4,4).Value = "************"
Sheet(5,4).Value = "************"
Sheet(38,0).Value = "************"
Book.Save(fl1)
Book.SaveToPDF(fl2)
Dim Proc As New Process
Proc.File = fl2
Proc.Start()

--  作者:大红袍
--  发布时间:2015/7/22 16:03:00
--  

http://foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=69889&skin=0