Foxtable(狐表)用户栏目专家坐堂 → [求助]如何连续打印多页条码?


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

主题:[求助]如何连续打印多页条码?

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/8 9:22:00 [显示全部帖子]

1、高度不要定死

 

2、高度要根据行数设置

 

3、上传例子


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/8 10:03:00 [显示全部帖子]

Dim 公司代码 As String=e.Form.Controls("txb_前缀文本").value
Dim 编号类型 As String=e.Form.Controls("dpb_编号类型").value
Dim 出厂日期 As Date=e.Form.Controls("dtp_出厂日期").value
Dim doc As New PrintDoc

Dim rs As List(Of Row) = Tables(e.Form.name & "_tab_1").GetCheckedRows
Dim count As Integer = rs.count
doc.PrinterName="ZDesigner GT800 (EPL) -2#"
doc.PageSetting.Height=12
'doc.PageSetting.Width=12*count+(count-1) * 5
doc.PageSetting.Width=40
doc.PageSetting.BottomMargin=0
doc.PageSetting.TopMargin=0
doc.PageSetting.RightMargin=0
doc.PageSetting.LeftMargin=0
doc.PageSetting.Landscape=True
'Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
Dim Bar As New BarCodeBuilder
bar.QuietZoneWidth =2   '0.4
Bar.Symbology = Barpro.Symbology.QRCode
'bar.CodeAlignment = Barpro.Alignment.Belowleft

For i As Integer = 0 To rs.Count - 1
    Dim r As Row = rs(i)
    Dim rg As New prt.RenderGraphics
    bar.code=r("打印列")
    MessageBox.show(r("打印列"))
    bar.DrawOnCanvas(rg.Graphics,0,0,0.25)
    Dim rt As New prt.RenderTable() '定义一个表格对象
    rt.Style.GridLines.All = New prt.Linedef(Color.white) '将表格的颜色设为深灰色
    rt.Rows.Count = 1 '设置行数
    rt.Cols.Count = 2 '设置列数
    rt.Width = 40 '设置表格的宽度
    rt.Height = 12 '设置表格的高度
    'If i > 0 Then
     '   rt.Style.Spacing.Top = 4
      '  rt.Height = 16
    'End If
    rt.Rows(0).Height=12
    rt.cols(0).width=15
    rt.cells(0,1).Style.Font=New Font("Times New Roman", 7, FontStyle.Bold) '设置字体
    rt.cells(0,0).Style.TextAlignHorz=prt.AlignHorzEnum.left
    'Dim r As Row=Tables(e.Form.name & "_tab_1").Rows(0)
    rt.Cells(0,0).RenderObject = rg '将单元格内容设置为图片对象rm
    rt.cells(0,1).text=公司代码 & "-" & 编号类型  & vbcrlf & Format(出厂日期,"yyyyMMdd") & "-" & r("流水号")
    doc.Body.Children.Add(rt) '将表格对象加入到报表中
Next


doc.Preview


 回到顶部