以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 打印标签产品标签,每个产品都需要打印,每行产品不同,而且每行数量也不仅仅是一个,请问老师如何打印标签 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=110826) |
-- 作者:whtb999 -- 发布时间:2017/12/10 15:38:00 -- 打印标签产品标签,每个产品都需要打印,每行产品不同,而且每行数量也不仅仅是一个,请问老师如何打印标签 产品编号 产品名称 产品数量 001 产品1 5 002 产品2 4 意思就是产品1连续打印5个,产品2 连续打印4,以此类推,请老师我如何处理呢
[此贴子已经被作者于2017/12/10 15:39:01编辑过]
|
-- 作者:有点甜 -- 发布时间:2017/12/10 20:44:00 -- 参考代码
Dim doc As New PrintDoc \'定义一个报表 |
-- 作者:whtb999 -- 发布时间:2017/12/11 9:01:00 -- 谢谢老师,我想在里面假如条码,但是不知道错误在哪里,求助老师帮我看看 Dim doc As New PrintDoc \'定义一个报表 doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight \'设置排列方式 Dim t As Table = Tables("表A") For Each dr As Row In t.Rows For i As Integer = 1 To dr("第四列") Dim rt As New prt.RenderTable() \'定义一个表格对象 rt.Style.GridLines.All = New prt.LineDef \'将网格线类型设为默认类型 rt.Width = 50 \'表格宽度为50mm rt.Style.Spacing.All = 2 \'和其他对象之间的间隔为2mm rt.SplitVertBehavior = prt.SplitBehaviorEnum.Never \'避免垂直换页的时候,表格被分割成两部分. rt.Cols(0).Width = 20 rt.cells(0,0).Text = "姓名" rt.Cells(0,1).Text = dr("第一列") rt.Cells(1,0).Text = "职务" rt.Cells(1,1).Text = dr("第三列") rt.Cells(2,0).Text= "数量" rt.cells(2,1).Text = dr("第四列") Dim ra As New prt.RenderArea ra.Children.Add(rt) Dim rpar As New prt.RenderParagraph() Dim img As prt.RenderImage Dim Bar As New BarCodeBuilder Bar.Symbology = Barpro.Symbology.Code128 \'条码规则 Bar.BarRatio = 0.3 Bar.BarHeight = 8 Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight bar.Code = dr("第三列") img = new prt.RenderImage img.Image = bar.GetImage Dim rm As New prt.RenderImage \'定义一个条码图片对象 rm.Image =bar.getimage \'设置条码图片 rm.Width = "Parent.Width" \'宽度等于页面宽度 rm.Height = "Auto" \'高度由条码图片大小自动决定 rm.Style.ImageAlign.StretchHorz = False \'禁止条码图片水平拉伸 rm.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center \'水平居中 rm.X=2 rm.y="Prev.Bottom + 2" ra.Children.Add(rm) \' doc.Body.Children.Add(rt) \'将表格对象加入到报表中 Next Next Doc.Preview() \'预览报表 |
-- 作者:有点甜 -- 发布时间:2017/12/11 9:48:00 -- Dim doc As New PrintDoc \'定义一个报表 doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight \'设置排列方式 Dim t As Table = Tables("表A") For Each dr As Row In t.Rows For i As Integer = 1 To dr("第四列") Dim rt As New prt.RenderTable() \'定义一个表格对象 rt.Style.GridLines.All = New prt.LineDef \'将网格线类型设为默认类型 rt.Width = 50 \'表格宽度为50mm rt.Style.Spacing.All = 2 \'和其他对象之间的间隔为2mm rt.SplitVertBehavior = prt.SplitBehaviorEnum.Never \'避免垂直换页的时候,表格被分割成两部分. rt.Cols(0).Width = 20 rt.cells(0,0).Text = "姓名" rt.Cells(0,1).Text = dr("第一列") rt.Cells(1,0).Text = "职务" rt.Cells(1,1).Text = dr("第三列") rt.Cells(2,0).Text= "数量" rt.cells(2,1).Text = dr("第四列") Dim img As prt.RenderImage Dim Bar As New BarCodeBuilder Bar.Symbology = Barpro.Symbology.Code128 \'条码规则 Bar.BarRatio = 0.3 Bar.BarHeight = 8 bar.Code = dr("第三列") img = new prt.RenderImage img.Image = bar.GetImage rt.cells(3,0).text = "条码" rt.cells(3,1).RenderObject = img doc.Body.Children.Add(rt) \'将表格对象加入到报表中 Next Next Doc.Preview() \'预览报表 |
-- 作者:whtb999 -- 发布时间:2017/12/11 14:59:00 -- 谢谢老师! |