Dim Book As New XLS.Book(ProjectPath & "templets\生产流转单.xls")
Dim r As Row = e.Form.controls("明细").Table.Current
Dim fl As String = "c:\Windows\print.xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Relations.Add("生产流转单关联",DataTables("生产流转单_明细").DataCols("计划明细单号"),DataTables("生产流转单_包材明细").DataCols("计划明细单号"))
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
'Dim Proc As New Process '打开工作簿
'Proc.File = fl
'Proc.Start()
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fl)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
App.Visible = True
Ws.PrintPreview
Wb.Close
App.Quit
Relations.Delete("生产流转单关联")