以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]带条码的WORD报表打印  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=112858)

--  作者:l1q2lq
--  发布时间:2018/1/4 10:44:00
--  [求助]带条码的WORD报表打印
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
For Each r As Row In Tables("标签创建").Rows
    Bar.Code = r("箱号")
Next
Bar.BarRatio = 0.3
Bar.BarHeight = 8
bar.SaveImage(ProjectPath & "Images\\myimg.wmf",300)

Dim t As Table = e.Form.Controls("Table1").Table
For Each r1 As Row In t.GetCheckedRows()
    t.Position = r1.Index
    Dim tm As String  = ProjectPath & "Attachments\\物料标签.doc" \'指定模板文件
    Dim fl1 As String = ProjectPath & "Reports\\物料标签\\" & r1("箱号") & "物料标签.doc"
    Dim fl2 As String = ProjectPath & "Reports\\物料标签\\" & r1("箱号") & "物料标签.pdf"
    Dim wrt As New WordReport(Tables("标签创建"),tm,fl1)
    wrt.Build() \'逐行生成报表
    wrt.SaveToPDF(fl2) \'保存为PDF文件
    wrt.Quit() \'退出
    Dim Proc As New Process \'打开PDF文件
    Proc.File = fl2
    Proc.Start()
Next

窗口:Tables("标签创建").ShowCheckBox = True

想要对选中的每一行分别生成一个WORD,以箱号作为条码内容,但现在获取的条码无法与该刚箱号对应,应该怎么修改

--  作者:l1q2lq
--  发布时间:2018/1/4 11:35:00
--  
求教老师
--  作者:有点甜
--  发布时间:2018/1/4 11:47:00
--  


Dim t As Table = e.Form.Controls("Table1").Table
For Each r1 As Row In t.GetCheckedRows()
    Dim Bar As New BarCodeBuilder
    Bar.Symbology = Barpro.Symbology.QRCode
    Bar.Code = r1("箱号")
    Bar.BarRatio = 0.3
    Bar.BarHeight = 8
    bar.SaveImage(ProjectPath & "Images\\myimg.wmf",300)
    Dim tm As String  = ProjectPath & "Attachments\\物料标签.doc" \'指定模板文件
    Dim fl1 As String = ProjectPath & "Reports\\物料标签\\" & r1("箱号") & "物料标签.doc"
    Dim fl2 As String = ProjectPath & "Reports\\物料标签\\" & r1("箱号") & "物料标签.pdf"
    Dim wrt As New WordReport(Tables("标签创建"),tm,fl1)
    wrt.Build() \'逐行生成报表
    wrt.SaveToPDF(fl2) \'保存为PDF文件
    wrt.Quit() \'退出
    Dim Proc As New Process \'打开PDF文件
    Proc.File = fl2
    Proc.Start()
Next