把鼠标没有选中的行移除掉,再生成报表
dim lst as New List(of string)
With Tables("记录")
For i as Integer = .TopPosition To .BottomPosition
lst.add(.Rows(i)("_Identify"))
Next
.DataTable.removefor("_Identify not in (" & string.join(",",lst.toarray) & ")")
End With
Dim Products As List(Of String)
Products = DataTables("记录").GetValues("设备名称")
For Each Product As String In Products
Dim tm As String = ProjectPath & "Attachments\申请表.doc" '指定模板文件
Dim fl As String = ProjectPath & "报表\" & "申请表" & Product & format(Date.today, "yyyyMMdd") & ".doc" '指定目标文件
Dim wrt As New WordReport(Tables("记录"), tm, fl) '定义一个WordReport
wrt.Build() '逐行生成报表
wrt.Show() '显示报表
Next