Dim filter As String
Dim Book As New XLS.Book(ProjectPath & "Attachments\销售合同.xls")
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Sheet(6, 6).Value = "制单人:" & User.Name '修改模板,加入制单人信息
filter = "Sel\ect * from {表B} where [_identify]=2"
Dim fl As String = ProjectPath & "Reports\出库单.xls"
book.AddDataTable("表B", "", filter) '添加父表
filter = "Sel\ect * from {表C} where [_identify]=2"
book.AddDataTable("表C", "" , filter) '添加子表
book.AddRelation("表B", "[_identify]", "表C", "[_identify]") '建立关联
messagebox.show(4)
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
messagebox.show(5)
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()