Dim tm As String = ProjectPath & "Attachments\收款收据.doc" '指定模板文件
Dim sjd As String = ProjectPath & "Reports\收款收据.doc" '指定目标doc文件
Dim sjp As String = ProjectPath & "Reports\收款收据.pdf" '指定目标PDF文件
Dim t As Table = Tables("收据签发表")
Dim wrt As New WordReport(t,tm,sjd) '定义一个WordReport
For i As Integer = t.TopPosition To t.BottomPosition
If t.Rows(i)("作废") = True Then
FileSys.CopyFile(ProjectPath & "Attachments\作废.jpg", ProjectPath & "Attachments\图片.jpg", True)
Else
FileSys.CopyFile(ProjectPath & "Attachments\空白.jpg", ProjectPath & "Attachments\图片.jpg", True)
End If
wrt.BuildOne(t.Rows(i))
Next
wrt.SaveToPDF(sjp) '保存为PDF文件
wrt.Quit() '退出
Dim Proc As New Process '打开PDF文件
Proc.File = sjp
Proc.Start() '显示报表