以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 报表双排打印快速怎么实现 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=195851) |
-- 作者:13568406997 -- 发布时间:2025/3/14 16:30:00 -- 报表双排打印快速怎么实现 想实现左右两边双排打印相同内容,但第二排好像不能弄到指定的位置,有什么快速实现的方法没? Dim tbl As Table = e.Form.Controls("国外订单_tbl_商贸工单").Table Dim doc As New PrintDoc Dim rbc(1000000), rbc1(1000000) Dim i As Integer Dim y As Integer For Each rw As Row In tbl.Rows Dim intX第一图, intX第二图, int文字宽度, int图片宽度 As Integer intX第一图 = 10 intX第二图 = 60 int文字宽度 = 35 int图片宽度=30 \' Dim rm As New prt.RenderEmpty \'定一个空对象 \' rm.BreakBefore = prt.BreakEnum.Page \'打印前换页 \' doc.Body.Children.Add(rm) \'加入到报表中 Dim rx英文名称 As New prt.RenderText Dim rx中文名称 As New prt.RenderText Dim rxSKU As New prt.RenderText \' Dim rbc As New prt.RenderBarCode() \' Dim rx As New prt.RenderParagraph \' MessageBox.Show(1) Dim drWP As DataRow = DataTables("物品").SQLFind("物品号=\'" & rw("物品号") & "\'") If drWP IsNot Nothing Then rx英文名称.Text = drWP("英文名称") If Functions.Execute("bln是否船", rw("物品号")) = True Then rx中文名称.Text = "model: " & drWP("中文名称") Else rx中文名称.Text = drWP("中文名称") End If rxSKU.Text = "SKU: " & drWP("通用SKU") \' MessageBox.Show(2) Dim f As New Font("Arial", 8, FontStyle.Bold) Dim f1 As New Font("楷体", 9, FontStyle.Regular) Dim f2 As New Font("宋体", 9, FontStyle.Bold) \' MessageBox.Show(3) rx英文名称.Style.Font = f rx中文名称.Style.Font = f1 rxSKU.Style.Font = f2 rx英文名称.Width = int文字宽度 rx中文名称.Width = int文字宽度 rxSKU.Width = int文字宽度 \' rx英文名称.Width = 40 rx英文名称.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rx中文名称.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rxSKU.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rx英文名称.y = "Prev.Bottom + 3" If Len(drWP("英文名称")) > 72 Then rx中文名称.y = "Prev.Bottom + 1" ElseIf Len(drWP("英文名称")) > 48 Then rx中文名称.y = "Prev.Bottom + 2" ElseIf Len(drWP("英文名称")) > 24 Then rx中文名称.y = "Prev.Bottom + 3" Else rx中文名称.y = "Prev.Bottom + 4" End If rxSKU.y = "Prev.Bottom + 2" doc.body.Children.add(rx英文名称) doc.body.Children.add(rx中文名称) doc.body.Children.add(rxSKU) \' Dim rb As New prt.RenderBarCode \' rb.Style.ImageAlign \' rb.Style.TextAlignVert rbc(i + 1) = New prt.RenderBarCode() rbc(i + 1).Height = 10 rbc(i + 1).BarCodeType = BarCodeEnum.Ean13 rbc(i + 1).BarDirection = BarDirectionEnum.Normal \' rbc(i + 1).Text = "690123456789" \'drWP("条形码") rbc(i + 1).Text = left(drWP("条形码"), 12) \' MessageBox.Show(drWP("条形码")) rbc(i + 1).ShowText = True rbc(i + 1).y = 25 rbc(i + 1).x = 9 \' MessageBox.Show(rbc(i + 1).y) rbc(i + 1).Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rbc(i + 1).Style.TextAlignVert = prt.AlignHorzEnum.Center \'水平居中 rbc(i + 1).Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center doc.Body.Children.Add(rbc(i + 1)) rbc(i) = New prt.RenderBarCode() End If MessageBox.Show(0) \'--------------------------------------------------------------------------------------------------------------------------- \'生成第二幅图片 \' Dim rm1 As New prt.RenderEmpty \'定一个空对象 \' rm1.BreakBefore = prt.BreakEnum.Page \'打印前换页 \' doc.Body.Children.Add(rm1) \'加入到报表中 Dim rx英文名称1 As New prt.RenderText Dim rx中文名称1 As New prt.RenderText Dim rxSKU1 As New prt.RenderText \' Dim rbc As New prt.RenderBarCode() \' Dim rx As New prt.RenderParagraph \' MessageBox.Show(1) Dim drWP1 As DataRow = DataTables("物品").SQLFind("物品号=\'" & rw("物品号") & "\'") If drWP1 IsNot Nothing Then rx英文名称1.Text = drWP1("英文名称") If Functions.Execute("bln是否船", rw("物品号")) = True Then rx中文名称1.Text = "model: " & drWP1("中文名称") Else rx中文名称1.Text = drWP1("中文名称") End If rxSKU1.Text = "SKU: " & drWP1("通用SKU") MessageBox.Show(2) Dim f As New Font("Arial", 8, FontStyle.Bold) Dim f1 As New Font("楷体", 9, FontStyle.Regular) Dim f2 As New Font("宋体", 9, FontStyle.Bold) MessageBox.Show(3) rx英文名称1.Style.Font = f rx中文名称1.Style.Font = f1 rxSKU1.Style.Font = f2 rx英文名称1.Width = int文字宽度 rx中文名称1.Width = int文字宽度 rxSKU1.Width = int文字宽度 rx英文名称1.y = rx英文名称.y rx中文名称1.y = rx中文名称.y rxSKU1.y = rxSKU.y rx英文名称1.x = intX第二图 rx中文名称1.x = intX第二图 rxSKU1.x = intX第二图 \' rx英文名称.Width = 40 rx英文名称1.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rx中文名称1.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rxSKU1.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 \'\' rx英文名称1.y = "Prev.Bottom + 3" \' If Len(drWP("英文名称")) > 72 Then \' rx中文名称1.y = "Prev.Bottom + 1" \' ElseIf Len(drWP("英文名称")) > 48 Then \' rx中文名称1.y = "Prev.Bottom + 2" \' ElseIf Len(drWP("英文名称")) > 24 Then \' rx中文名称1.y = "Prev.Bottom + 3" \' Else \' rx中文名称1.y = "Prev.Bottom + 4" \' End If \' MessageBox.Show(4) \' rxSKU1.y = "Prev.Bottom + 2" doc.body.Children.add(rx英文名称1) doc.body.Children.add(rx中文名称1) doc.body.Children.add(rxSKU1) \' Dim rb As New prt.RenderBarCode \' rb.Style.ImageAlign \' rb.Style.TextAlignVert rbc1(i + 1) = New prt.RenderBarCode() rbc1(i + 1).Height = 10 rbc1(i + 1).BarCodeType = BarCodeEnum.Ean13 rbc1(i + 1).BarDirection = BarDirectionEnum.Normal \' rbc1(i + 1).Text = "690123456789" \'drWP("条形码") rbc1(i + 1).Text = left(drWP("条形码"), 12) \' MessageBox.Show(drWP("条形码")) rbc1(i + 1).ShowText = True rbc1(i + 1).y = 25 rbc1(i + 1).x = 60 MessageBox.Show(5) \' MessageBox.Show(rbc1(i + 1).y) rbc1(i + 1).Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rbc1(i + 1).Style.TextAlignVert = prt.AlignHorzEnum.Center \'水平居中 rbc1(i + 1).Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center MessageBox.Show(6) doc.Body.Children.Add(rbc1(i + 1)) MessageBox.Show(7) rbc1(i) = New prt.RenderBarCode() End If i+=1 Next Doc.PageSetting.PaperKind = 13 Doc.PageSetting.Height = 40 \'Doc.PageSetting.width = 50.5 Doc.PageSetting.width = 110.5 Doc.PageSetting.LeftMargin = 5 \'设置左边距 Doc.PageSetting.RightMargin = 5 \'设置右边距 Doc.PageSetting.TopMargin = 0 \'设置上边距 Doc.PageSetting.BottomMargin = 2 \'设置下边距 Doc.Preview() 好像有点太笨了 |
-- 作者:13568406997 -- 发布时间:2025/3/14 16:33:00 -- rx英文名称1.y = rx英文名称.y rx中文名称1.y = rx中文名称.y rxSKU1.y = rxSKU.y 这样写好像没有作用 |
-- 作者:13568406997 -- 发布时间:2025/3/14 17:30:00 -- 解决了 |