Foxtable(狐表)用户栏目专家坐堂 → [求助]条形码如何放在标签下面


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

主题:[求助]条形码如何放在标签下面

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


加好友 发短信
等级:一尾狐 帖子:475 积分:3548 威望:0 精华:0 注册:2012/8/30 10:58:00
[求助]条形码如何放在标签下面  发帖心情 Post By:2016/3/21 14:55:00 [只看该作者]

rt.cells(0,0).text ="Toplon Industrial Co., Ltd"
  rt.cells(0,0).Style.Font = New Font("宋体", 14, FontStyle.Bold)
 doc.Body.Children.Add(rt)
            Dim rbc As New prt.RenderBarCode()
            rbc.Height = 2
            rbc.BarCodeType = BarCodeEnum.Code39
            rbc.BarDirection = BarDirectionEnum.Normal
            rbc.Text = r("样品编号")
            doc.Body.Children.Add(rbc)


图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160321145416.png
图片点击可在新窗口打开查看

目的想让条形码放在标签内容的下面,代码如何修改呢?


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/3/21 15:17:00 [只看该作者]

本来就是放在下面的。肯定是你设置了排列方式 doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight

 

贴出完整代码测试。


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


加好友 发短信
等级:一尾狐 帖子:475 积分:3548 威望:0 精华:0 注册:2012/8/30 10:58:00
  发帖心情 Post By:2016/3/21 15:46:00 [只看该作者]

 Dim doc As New PrintDoc '定义一个报表
doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight '设置排列方式
For Each r As  Row In Tables("标签打印_table1").GetCheckedRows()
        For i As Integer = 1 To r("份")
            Dim rt As New prt.RenderTable() '定义一个表格对象
            rt.Style.TextAlignHorz = prt.AlignHorzEnum.left '水平居中
            rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
            rt.style.GridLines.bottom = new prt.linedef
            rt.style.gridlines.horz = new prt.linedef
            rt.style.Padding.Top = 2
            rt.Style.Spacing.Right = 18
            rt.style.spacing.Top =4
            rt.Width = 88 '表格宽度为80mm
            rt.cellStyle.Spacing.All = 0.3 '和其他对象之间的间隔为2mm
             rt.SplitVertBehavior = prt.SplitBehaviorEnum.Never '避免垂直换页的时候,表格被分割成两部分.
            rt.Cols(0).Width = 35
            rt.Cells(0,0).SpanCols =2
            rt.cells(0,0).text ="Toplon Industrial Co., Ltd"
            rt.cells(0,0).Style.Font = New Font("宋体", 14, FontStyle.Bold)
            rt.cells(2,0).Text = "DESIGN NO."
            rt.cells(2,1).text = r("样品编号")
            rt.cells(2,0).Style.Font = New Font("宋体", 10)
            rt.cells(2,1).Style.Font = New Font("宋体", 10)
            rt.Cells(4,0).Text = "COMPOSITION"
            rt.cells(4,1).text = r("成份")
            rt.cells(4,0).Style.Font = New Font("宋体", 10)
            rt.cells(4,1).Style.Font = New Font("宋体", 10)
            rt.Cells(6,0).Text= "WIDTH"
            doc.Body.Children.Add(rt)
            Dim rbc As New prt.RenderBarCode()
            rbc.Height = 5
            rbc.style.Padding.Top = 0.5
            rbc.BarCodeType = BarCodeEnum.Code39
            rbc.BarDirection = BarDirectionEnum.Normal
            rbc.Text = r("样品编号")
            doc.Body.Children.Add(rbc)
            
        Next
    Next
目标功能:实现标签打印,一排两个,每张纸打印12个

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/3/21 16:10:00 [只看该作者]

把条码作为表格的一部分,比如代码

 

Dim doc As New PrintDoc '定义一个报表
doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
For i As Integer = 1 To 2
    Dim rt As New prt.RenderTable() '定义一个表格对象
    doc.Body.Children.Add(rt) '将表格对象加入到报表中
    '设置各位置的网格线
    rt.Style.GridLines.All = New Prt.LineDef(0.5, Color.Black)
    rt.width = 50
    '下面的代码向表格中填入值
    rt.cells(0,0).text = 1
    rt.cells(1,0).text = 2
    rt.cells(2,0).text = 3
    Dim rbc As New prt.RenderBarCode()
    rbc.Height = 5
    rbc.style.Padding.Top = 0.5
    rbc.BarCodeType = BarCodeEnum.Code39
    rbc.BarDirection = BarDirectionEnum.Normal
    rbc.Text = "123"
    rt.cells(3,0).RenderObject = rbc
Next
doc.Preview() '预览报表


 回到顶部