Dim t As Table = Tables("表A")
For i As Integer = t.TopPosition To t.BottomPosition
Dim dr As DataRow = Tables("表A").Rows(i).DataRow
If dr("设备名称") Like "自*" Then
Dim tm As String = ProjectPath & "Attachments\模板1.doc" '指定模板文件
Dim fl As String = ProjectPath & "Reports\模板1.doc" '指定目标文件
Dim wrt As New WordReport(Tables("表A"),tm,fl) '定义一个WordReport
wrt.BuildOne(dr) '生成报表
wrt.Show() '显示报表
Else
Dim tm As String = ProjectPath & "Attachments\模板2.doc" '指定模板文件
Dim fl As String = ProjectPath & "Reports\模板2.doc" '指定目标文件
Dim wrt As New WordReport(Tables("表A"),tm,fl) '定义一个WordReport
wrt.BuildOne (dr) '生成报表
wrt.Show() '显示报表
End If
Dim fdr As Row = t.Rows(i)
If fdr.IsNull("报告编号") = False Then
fdr("打印次数") = val(fdr("打印次数")) + 1
End If
Next
这个意思?
[此贴子已经被作者于2015/5/22 11:13:33编辑过]