Dim tm As String = ProjectPath & "Attachments\介绍信.doc" '指定模板文件
Dim fl As String = ProjectPath & "Reports\介绍信.doc" '指定目标文件
'Dim rt As prt.RenderText '定义一个文本对象
Dim wrt As New WordReport(Tables("介绍信管理"),tm,fl) '定义一个WordReport
For Each r As Row In Tables("介绍信管理").Rows '逐行生成报表
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
wrt.BuildOne(r)
Next
wrt.Show() '显示报表
代码2: 加入水印代码
Dim doc As New PrintDoc() '定义一个报表
Dim rt As prt.RenderText '定义一个文本对象
doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight '设置排列方式
For i As Integer = 0 To 14
rt = New prt.RenderText() '创建文本对象
rt.Text = "XXXX建设工程有限公司 " & Date.Now '设置文本对象的内容
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rt.Style.TextColor = Color.plum '设置文本颜色
rt.Width = 53 '宽度为39毫米
rt.Height = 48 '宽度为35毫米
rt.Style.Spacing.All = 2 '设置各个方向的间隔
rt.Style.TextAngle = 25 '顺时钟旋转45度
doc.Body.Children.Add(rt) '将文本对象加入到报表
Next
doc.Preview() '预览