以文本方式查看主题 - 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=76942) |
-- 作者:JPG7 -- 发布时间:2015/11/8 14:37:00 -- Excel报表,打开后不能置顶,而是在任务栏闪烁 If user.IsRole("成品出库单") = True Then Dim Book As New XLS.Book(ProjectPath & "Attachments\\出库单.xls") Dim fl As String = ProjectPath & "Reports\\出库单.xls" 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 Rg = Ws.Range("E:E,H:H,J:J") \'Rg.EntireColumn.AutoFit \'自动调整列宽 Rg.EntireRow.AutoFit rg .WrapText =True \'引用单个单元格 App.Visible = True Ws.printout(Preview:=True) Else MessageBox.Show("权限不足!") End If
[此贴子已经被作者于2015/11/8 14:47:29编辑过]
|
-- 作者:大红袍 -- 发布时间:2015/11/8 14:55:00 -- 你试试这样 App.Visible = True Ws.printout(Preview:=True ShowAppWindow("出库单", 2) |
-- 作者:JPG7 -- 发布时间:2015/11/8 14:58:00 -- 回复:(大红袍)你试试这样App.Visible = TrueWs... ok |
-- 作者:JPG7 -- 发布时间:2015/11/10 13:51:00 -- ShowAppWindow("出库单", 2) 怎么现在加上这句也不管用了
|
-- 作者:JPG7 -- 发布时间:2015/11/10 13:53:00 -- 前几天还管用,现在就不管用了,加上最大化显示窗口也不管用 If user.IsRole("跟单") = True Then Dim Book As New XLS.Book(ProjectPath & "Attachments\\出库单-发货单.xls") Dim fl As String = ProjectPath & "Reports\\出库单.xls" 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 Rg = Ws.Range("B:B,D:D,F:F") \'Rg.EntireColumn.AutoFit \'自动调整列宽 Rg.EntireRow.AutoFit rg .WrapText =True \'引用单个单元格 App.Visible = True Ws.printout(Preview:=True) ShowAppWindow("出库单.xls", 2) \'App.Quit Else MessageBox.Show("权限不足!") End If |
-- 作者:大红袍 -- 发布时间:2015/11/10 14:07:00 -- 没办法的,要不你就把其嵌入到窗口里去。
http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=73007&skin=0
|