Dim r As Row = Tables(e.form.name & "_table1").Current
Dim fs As String= ProjectPath & "打印模板\***.xls"
If FileSys.FileExists(fs) Then
Dim Book As New XLS.Book(fs)
Dim fl As String = ProjectPath & "OutPut\" & "***.xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
sheet(0,0).Value = r("订单编号")
sheet(70,0).Value = "*** 在 " & Date.Now & "生成"
'Dim rg As New prt.RenderGraphics
'Dim Bar As New BarCodeBuilder
'Bar.Symbology = Barpro.Symbology.Code39
'bar.Code = r("订单编号")
'rg = new prt.RenderGraphics
'
'sheet(72,7).Value = rg
'New XLS.Picture(GetImage("d:\a.png"))
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)
wb.Saved = True
App.DisplayAlerts = False
App.Visible = True
Ws.PrintPreview(False) '打印预览.执行该方法时,如果将参数设为False,则不允许在预览时进行打印设置
'Ws.PrintOut
App.Quit
End If
[此贴子已经被作者于2021/9/14 8:41:41编辑过]