Foxtable(狐表)用户栏目专家坐堂 → 条码批量打印不横向输出


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

主题:条码批量打印不横向输出

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


加好友 发短信
等级:超级版主 帖子:110581 积分:562801 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/6/15 14:10:00 [显示全部帖子]


Dim doc As New PrintDoc
doc.PageSetting.Width = 220
doc.PageSetting.Height = 50
Doc.PageSetting.LeftMargin = 0 '设置左边距
Doc.PageSetting.RightMargin = 0 '设置右边距
Doc.PageSetting.TopMargin = 0 '设置上边距
Doc.PageSetting.BottomMargin = 0 '设置下边距
Dim img As prt.RenderImage
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.Code39
'Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
Bar.BarRatio = 0.3
Bar.BarHeight = 18

Bar.QuietZoneWidth = 2
Bar.AddCheckSum = False
Bar.DisplayChecksum = False
Dim rm As prt.RenderEmpty '定一个空对象

For i As Integer = 0 To Tables("表A").rows.Count - 1 Step 4
    rm = new prt.RenderEmpty '定义一个新的空对象
    rm.BreakBefore = prt.BreakEnum.Page '打印前换页
    doc.Body.Children.Add(rm) '加入到报表中
    For j As Integer = 0 To 3
        If i+j < Tables("表A").rows.Count
            Dim r As Row = Tables("表A").rows(i + j)
            Dim ra As new prt.RenderArea
            ra.width = 50
            ra.X = j * 50 + 5
            ra.Y = 5
            ra.Style.Spacing.Right = 2 '设置标签之间的所有和上下间隔为2毫米
            ra.Style.Spacing.Bottom = 2
            ra.Style.Padding.All = 1 ' 标签内容距离边框为1毫米
            ra.Style.Borders.All = New prt.Linedef(0.3, Color.Red) '设置边框
            Dim txt As new prt.RenderText
            
            txt.text = "XXXXXX公司"
            txt.X = 10
            txt.y = 5
            ra.children.add(txt)
            
            txt = new prt.RenderText
            txt.text = r("第一列")
            txt.x = 40
            txt.y =5
            ra.children.add(txt)
            
            
            bar.Code = r("第二列")
            img = new prt.RenderImage
            img.Image = bar.GetImage
            img.x = 10
            img.y = 10
            
            ra.children.add(img)
            Doc.Body.Children.Add(ra)
        End If
    Next
Next
Doc.Preview()


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


加好友 发短信
等级:超级版主 帖子:110581 积分:562801 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/6/15 16:02:00 [显示全部帖子]

Dim doc As New PrintDoc
doc.PageSetting.Width = 220
doc.PageSetting.Height = 350
Doc.PageSetting.LeftMargin = 0 '设置左边距
Doc.PageSetting.RightMargin = 0 '设置右边距
Doc.PageSetting.TopMargin = 0 '设置上边距
Doc.PageSetting.BottomMargin = 0 '设置下边距
Dim img As prt.RenderImage
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.Code39
'Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
Bar.BarRatio = 0.3
Bar.BarHeight = 18

Bar.QuietZoneWidth = 2
Bar.AddCheckSum = False
Bar.DisplayChecksum = False
Dim rm As prt.RenderEmpty '定一个空对象

Dim idx As Integer = 0
For i As Integer = 0 To Tables("表A").rows.Count - 1 Step 4

    For j As Integer = 0 To 3
        If i+j < Tables("表A").rows.Count
            Dim r As Row = Tables("表A").rows(i + j)
            Dim ra As new prt.RenderArea
            ra.width = 50
            ra.X = j * 50 + 5
            ra.Y = 5  + idx * 50
            ra.Style.Spacing.Right = 2 '设置标签之间的所有和上下间隔为2毫米
            ra.Style.Spacing.Bottom = 2
            ra.Style.Padding.All = 1 ' 标签内容距离边框为1毫米
            ra.Style.Borders.All = New prt.Linedef(0.3, Color.Red) '设置边框
            Dim txt As new prt.RenderText
            
            txt.text = "XXXXXX公司"
            txt.X = 10
            txt.y = 5
            ra.children.add(txt)
            
            txt = new prt.RenderText
            txt.text = r("第一列")
            txt.x = 40
            txt.y =5
            ra.children.add(txt)
            
            
            bar.Code = r("第二列")
            img = new prt.RenderImage
            img.Image = bar.GetImage
            img.x = 10
            img.y = 10
            
            ra.children.add(img)
            Doc.Body.Children.Add(ra)
        End If
    Next
idx += 1
Next
Doc.Preview()

 回到顶部