以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 条码批量打印不横向输出 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=151102) |
-- 作者:ifox2018 -- 发布时间:2020/6/15 13:33:00 -- 条码批量打印不横向输出 Dim doc As New PrintDoc 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 For Each r As Row In Tables("表A").Rows For i As Integer = 1 To 4 Dim ra As new prt.RenderArea 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("tm") img = new prt.RenderImage img.Image = bar.GetImage img.x = 10 img.y = 10 ra.children.add(img) Doc.Body.Children.Add(ra) Next Next Doc.Preview() 想要一行打印4个,现在输出的是一行一个,同一条码输出4次.
|
-- 作者:有点蓝 -- 发布时间: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() |
-- 作者:ifox2018 -- 发布时间:2020/6/15 15:55:00 -- 如果我需要在A4纸张上打印多行。 1 , 变更纸张高度 doc.PageSetting.Height = 350 2, For i As Integer = 0 To Tables("表A").rows.Count - 1 Step 4 在该语句下 添加什么语句,可以变更Y轴数据。 |
-- 作者:有点蓝 -- 发布时间: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()
|