老师,您好!
用专业报表打印条码,如果条码长短不一的话,如何设置条码居中显示,下面的设置没有效果!
Dim rs As New prt.RenderArea
rs.SplitHorzBehavior = prt.SplitBehaviorEnum.Never '禁止水平分割
rs.SplitVertBehavior = prt.SplitBehaviorEnum.Never '禁止垂直分割
rs.Width = 80 '宽度等于容器宽度
rs.Height = 15
rs.X = CInt(SPtm("横坐标"))
rs.Y = CInt(SPtm("纵坐标"))
rs.Style.Borders.All = New prt.Linedef(1, Color.Red)
ra.Children.Add(rs)
Dim rg As New prt.RenderGraphics
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.Code39
Bar.AddCheckSum = False
bar.Code = n("商品条码")
rg = new prt.RenderGraphics
bar.DrawOnCanvas(rg.Graphics,0,0,1)
rg.Style.Borders.All = New prt.Linedef(0.3, Color.Red) '设置边框
rg.Style.TextAlignHorz = prt.AlignHorzEnum.Center '(水平居中这里的设置不起作用!)
rg.Style.TextAlignVert = prt.AlignVertEnum.Center
rs.Children.Add(rg)