以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 如何设置条码居中显示? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=169322) |
-- 作者:304376480 -- 发布时间:2021/6/11 18:14:00 -- 如何设置条码居中显示? 老师,您好! 用专业报表打印条码,如果条码长短不一的话,如何设置条码居中显示,下面的设置没有效果!
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) |
-- 作者:有点蓝 -- 发布时间:2021/6/12 9:05:00 -- Dim doc As New PrintDoc() \'定义一个报表 Dim ra As New prt.RenderArea \'定义一个容器 ra.Width = 80 \'宽度等于容器宽度 ra.Height = 15 ra.Style.Borders.All = New prt.Linedef(1, Color.Red) \'设置边框 Dim rg As New prt.RenderGraphics Dim Bar As New BarCodeBuilder Bar.Symbology = Barpro.Symbology.Code39 Bar.AddCheckSum = False bar.Code = "123456" rg = new prt.RenderGraphics bar.DrawOnCanvas(rg.Graphics,0,0,1) rg.Width = "Parent.Width" \'宽度等于页面宽度 rg.Height = "Auto" \'高度由图片大小自动决定 rg.Style.ImageAlign.StretchHorz = False \'禁止图片水平拉伸 rg.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center ra.Children.Add(rg) \'将文本对象加入到报表 doc.Body.Children.Add(ra) \'将容器ra加入到报表 doc.Preview() \'预览
|