Dim fr As DataRow = DataTables("B_CSlist").SQLFind("姓名 = '" & User.Name & "'")
Dim bhs As List(Of String) = DataTables("LocalItem").GetValues("表单编号")
For Each bh As String In bhs
If bh IsNot Nothing Then
If FileSys.FileExists(ProjectPath & "Attachments\" & bh & ".xls") Then
Dim sb As String
Dim drs As List(Of DataRow) = DataTables("B_FormEQ").SQLSelect("表单编号 = '"& bh &"' And 实验室编号 = '"& fr("区域") &"'")
For Each dr As DataRow In drs
sb = sb & "/" & dr("设备类型")& ":" & dr("设备编号")
Next
MessageBox.show(sb)
Dim Book As New XLS.Book(ProjectPath & "Attachments\" & bh & ".xls")
book.Marks.add("设备编号",sb)
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()
Else
MessageBox.Show("未找到编号为【" & bh & "】的表单")
End If
End If
Next
发现sb不会跟随表单编号的变化而变化,一直都是第一个表单编号的,请问如何处理?