Dim r As Row = Tables("员工").Current
If r IsNot Nothing Then
Dim tm As String = ProjectPath & "Attachments\员工资料卡.doc" '指定模板文件
Dim fl As String = ProjectPath & "Reports\员工资料卡.doc" '指定目标文件
Dim mg As String = ProjectPath & "Images\二维码.wmf" '约定的图片文件
Dim wrt As New WordReport(Tables("员工"),tm,fl) '定义一个WordReport
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Bar.QRCodeModuleSize = 2 '二维码的放大倍数
Bar.Code = "姓名:" & r("姓名") & vbcrlf & "部门:" & r("部门") & vbcrlf & "电话:" & r("办公电话")
bar.SaveImage(mg,300)
wrt.BuildOne(r)
wrt.Show() '显示报表
End If