Foxtable(狐表)用户栏目专家坐堂 → 逐行显示条码的程序报错,请问如何修改


  共有2865人关注过本帖树形打印复制链接

主题:逐行显示条码的程序报错,请问如何修改

帅哥哟,离线,有人找我吗?
hiliuyong
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:436 积分:5082 威望:0 精华:0 注册:2012/3/27 15:33:00
逐行显示条码的程序报错,请问如何修改  发帖心情 Post By:2015/3/13 17:32:00 [显示全部帖子]

Dim doc As New PrintDoc() '定义一个报表
Dim rt As prt.RenderText '定义一个文本对象
Dim rg As prt.RenderGraphics
Dim Bar As BarCodeBuilder
doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight '设置排列方式

For i As Integer = 0 To 10
    Bar.Symbology = Barpro.Symbology.Code128
    bar.Code ="12345678901234567890"
    rg = new prt.RenderGraphics
   
    rg.X = 10
    rg.Y = 25
    bar.BarRatio = 0.8
    bar.BarHeight = 12
    bar.BarWidth = 0.3
    bar.DisplayCode =False
    bar.DrawOnCanvas(rg.Graphics,0,0,1)
   
    rg.Width = 39 '宽度为39毫米
    rg.Height = 35 '宽度为35毫米
    rg.Style.Spacing.All = 2 '设置各个方向的间隔
    rg.Style.Borders.All = New prt.Linedef(1, Color.Red) '设置边框
    rg.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
    rg.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
   
    doc.Body.Children.Add(rg) '将文本对象加入到报表
   
Next
doc.Preview() '预览

 

 

在红色部分报错,是什么原因,帮我看下,谢谢!


 回到顶部
帅哥哟,离线,有人找我吗?
hiliuyong
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:436 积分:5082 威望:0 精华:0 注册:2012/3/27 15:33:00
  发帖心情 Post By:2015/3/13 17:52:00 [显示全部帖子]

还是无法执行,我把代码改了下,如下

但是无法显示出多条条码

只能显示一个

 

Dim doc As New PrintDoc
Dim img As prt.RenderImage
Dim Bar As New BarCodeBuilder
Dim rg As New prt.RenderGraphics
Bar.Symbology = Barpro.Symbology.Code128
Bar.BarRatio = 0.3
Bar.BarHeight = 8
Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight

For i As Integer = 1 To 4
    bar.Code = "12345678901234567890"
   
    rg = new prt.RenderGraphics
    rg.X = 10
    rg.Y = 25
    bar.BarRatio = 0.8
    bar.BarHeight = 12
    bar.BarWidth = 0.3
    bar.DisplayCode =False
    bar.DrawOnCanvas(rg.Graphics,0,0,1)
  
    Doc.Body.Children.Add(rg)
Next

Doc.Preview()


 回到顶部