以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [讨论]有关批量生成条码并标注的问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=75792) |
-- 作者:zhuzhi -- 发布时间:2015/10/15 7:56:00 -- [讨论]有关批量生成条码并标注的问题 各位老师,我现在有一份excel报表,每一页都有很多条数据,我现在需要对每一条数据,让报表自动生成内容随数据变化的条码,应该怎么做呢? 我看到帮助里有这个代码可以批量生成条形码: Dim
doc As New
PrintDoc Dim rg As prt.RenderGraphics Dim Bar As New BarCodeBuilder Bar.Symbology = Barpro.Symbology.QRCode Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight For Each r As Row In Tables("表A").Rows bar.Code = r("第一列") rg = new prt.RenderGraphics bar.DrawOnCanvas(rg.Graphics,0,0,1) rg.Style.Spacing.All = 3 Doc.Body.Children.Add(rg) Next Doc.Preview() 但是,如果要对不止一列的数据批量生成,应该怎么做? 如果要让生成的条码上可以显示包含的内容。比如用姓名做的条码,那么除了条码外还标出姓名,以便以分发,那么又应该怎么做呢? 十分感谢! [此贴子已经被作者于2015/10/15 8:07:59编辑过]
|
-- 作者:大红袍 -- 发布时间:2015/10/15 9:36:00 -- Dim doc As New PrintDoc Dim rg As prt.RenderGraphics Dim Bar As New BarCodeBuilder Bar.Symbology = Barpro.Symbology.QRCode Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight For Each r As Row In Tables("表A").Rows bar.Code = r("第一列") Bar.HumanReadableText = r("第一列") Bar.BottomMargin = 2 rg = new prt.RenderGraphics bar.DrawOnCanvas(rg.Graphics,0,0,1) rg.Style.Spacing.All = 3 Doc.Body.Children.Add(rg) Next Doc.Preview() |
-- 作者:zhuzhi -- 发布时间:2015/10/15 10:20:00 -- 非常感谢您! |
-- 作者:zhuzhi -- 发布时间:2015/10/15 12:34:00 -- 老师,请问如何改变条码的大小,比如让一页可以打6排条码,每排5个? |
-- 作者:大红袍 -- 发布时间:2015/10/15 15:11:00 -- Dim doc As New PrintDoc Dim rg As prt.RenderGraphics Dim Bar As New BarCodeBuilder Bar.Symbology = Barpro.Symbology.QRCode Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight Dim count As Integer = 1 For Each r As Row In Tables("表A").Rows bar.Code = r("第一列") Bar.HumanReadableText = r("第一列") Bar.BottomMargin = 2 rg = new prt.RenderGraphics bar.DrawOnCanvas(rg.Graphics,0,0,1) rg.Style.Spacing.All = 3 Doc.Body.Children.Add(rg) If count Mod (3 * 2) = 0 Then rg.BreakAfter = prt.BreakEnum.page Else If count Mod 3 = 0 Then rg.BreakAfter = prt.BreakEnum.line End If count += 1 Next Doc.Preview() |