以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [原创]EXCEL报表在窗口中的web控件显示问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=77804)

--  作者:fszyhzg
--  发布时间:2015/11/25 17:09:00
--  [原创]EXCEL报表在窗口中的web控件显示问题
狐友们,我设计的模式窗口中有WebBrowser1控件,afterload里的代码是:
Dim wbr As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
Dim tmp As String = ProjectPath & "Attachments\\多行显示.xlsx"
Dim rpt As String = ProjectPath & "Reports\\多行显示.xlsx"
Dim Book As New XLS.Book(tmp)
Book.Build()
book.Save(rpt)
wbr.AddRess = rpt

窗口能显示excel报表,但关闭窗口后,再打开就提示excel报表已打开,是否重新打开报表,确认打开后数据没变,我是按筛选表后点击按钮打开此窗口的,请问有何方法让关闭窗口后报表(Reports\\多行显示.xlsx)能自动关闭并删除呢???

--  作者:大红袍
--  发布时间:2015/11/25 17:38:00
--  
Dim ps As  System.Diagnostics.Process() = System.Diagnostics.Process.GetProcessesByName("Excel")
For Each p As System.Diagnostics.Process In ps
    If p.MainWindowTitle = Nothing Then  p.kill
Next 

 

Dim wbr As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
Dim tmp As String = ProjectPath & "Attachments\\多行显示.xlsx"
Dim rpt As String = ProjectPath & "Reports\\多行显示.xlsx"
Dim Book As New XLS.Book(tmp)
Book.Build()
book.Save(rpt)
wbr.AddRess = rpt

--  作者:fszyhzg
--  发布时间:2015/11/26 9:14:00
--  回复:(大红袍)Dim ps As ?System.Diagnostics...
太感谢袍哥啦~~~~~~~~拜服了!!!

[此贴子已经被作者于2015/11/26 9:15:27编辑过]