Forms("开单界面清单").open
Dim dr As DataRow = DataTables("B_CSlist").SQLFind("姓名 = '" & User.Name & "'")
Dim Filter As String = "报告编号 = '" & Tables("T_Report").Current("报告编号") & "' And 实验室编号 = '" & dr("区域") &"'"
DataTables("开单界面清单_Table1").LoadFilter = Filter '设置加载条件
DataTables("开单界面清单_Table1").Load()
开单界面清单中tables为SQLTable,其中有一个按键:
Relations.Add("关联1",DataTables("T_Report").DataCols("报告编号"),DataTables("开单界面清单_Table1").DataCols("报告编号"))
Dim bhs As List(Of String) = DataTables("开单界面清单_Table1").GetValues("表单编号")
For Each bh As String In bhs
If bh IsNot Nothing Then
Dim Book As New XLS.Book(ProjectPath & "Attachments\" & bh & ".xls")
Dim fl As String = ProjectPath & "Reports\" & Tables("T_Report").current("报告编号")& "&" & bh & ".xls"
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
End If
Next
Relations.Delete("关联1")
先将SQLTables的数据与T_report进行关联之后打印EXCEL报表,打印完之后再删除关联,但若这个窗口关闭之后再打开的话,SQLTables显示为空白没有数据,请问是什么问题?