呃......
Dim tm As String = ProjectPath & "Attachments\提请议案.doc"
Dim fl As String = ProjectPath & "Reports\提请议案.doc"
Dim wrt As New WordReport(Tables("政府会议_任免"),tm,fl) '定义一个WordReport
wrt.Replace("[计数]",Tables("政府会议_任免").Compute("Count(姓名)")) '用代码计算出总的销售数量并替换模板中的合计
Dim str1 As String = ""
Dim str2 As String = ""
Dim ls As List(Of String()) = Tables("政府会议_任免").DataTable.GetValues("内容|姓名", Tables("政府会议_任免").Filter, "序列号")
For Each s As String() In ls
If s(0).IndexOf("任") > -1 Then
str1 &= s(0).Split(",")(0) & vbcrlf & ""
End If
If s(0).IndexOf("免去") > -1 Then
str2 &= s(0).Substring(s(0).IndexOf("免去")).Replace("其", s(1)) & vbcrlf & ""
End If
Next
wrt.Replace("[列表]", str1 & "提请免去:" & str2)
'wrt.Replace("[文号]",DataTables("任免表").GetComboListString("文号").Replace("|",","))
wrt.Build() '生成报表
wrt.Show() '显示报表