以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 这个打印二维码的代码,打印量少的时候可以正常打印,打印量多的时候会报错 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=135662) |
-- 作者:yetle -- 发布时间:2019/5/31 11:43:00 -- 这个打印二维码的代码,打印量少的时候可以正常打印,打印量多的时候会报错 .NET Framework 版本:2.0.50727.3655 Foxtable 版本:2019.4.12.1 错误所在事件:窗口,分派工序,Button20,Click 详细错误信息: 参数无效。 Dim doc As New PrintDoc Dim img As prt.RenderImage Dim Bar As New BarCodeBuilder Dim rt As new prt.RenderText Bar.Symbology = Barpro.Symbology.QRCode Bar.BarRatio = 0.3 Bar.BarWidth = 5 Bar.BarHeight = 5 Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight \'For Each r As Row In CurrentTable.Rows For Each r As DataRow In DataTables("分箱汇总").Select("[订单号] = \'" & Tables("分派工序_table2").current("订单号") & "\'") Dim ra As New prt.RenderArea ra.SplitHorzBehavior = prt.SplitBehaviorEnum.Never \'禁止水平分割 ra.SplitVertBehavior = prt.SplitBehaviorEnum.Never \'禁止垂直分割 ra.width = 140 ra.height = 120 rt = New prt.RenderText rt.Text = "订单号:" & r("订单号") & "制单号:" & r("制单号") & Chr(13) & Chr(10) & "款号:" & r("款号") & "客款号:" & r("客款号") & "系列:" & r("系列") & Chr(13) & Chr(10) & "箱号:" & r("箱号") & Chr(13) & Chr(10) & "件数:" & r("件数") & Chr(13) & Chr(10) & "颜色:" & r("颜色") & "尺码:" & r("尺码") rt.Style.FontSize = 14 rt.Style.FontBold = True rt.X = 5 rt.Y = 2 ra.Children.Add(rt) \'添加到容器中 \'bar.Code = "http://yetle2019.picp.net:23553/pgmx.htm?ddh="& r("订单号") & "&zdh=" & r("制单号") & "&kh=" & r("款号") & "&xh=" & r("箱号") bar.Code = "http://jemis123.jemis.com.cn:88/ddpgmx.htm?ddh="& r("订单号") & "&zdh=" & r("制单号") & "&kh=" & r("款号") & "&xh=" & r("箱号") img = new prt.RenderImage img.Image = bar.GetImage img.Width = 80 img.height = 80 img.Style.Spacing.All = 2 img.Y = 30 ra.Children.Add(img) Doc.Body.Children.Add(ra) Next Doc.Preview()
|
-- 作者:有点甜 -- 发布时间:2019/5/31 11:54:00 -- 加入代码
output.show("http://jemis123.jemis.com.cn:88/ddpgmx.htm?ddh="& r("订单号") & "&zdh=" & r("制单号") & "&kh=" & r("款号") & "&xh=" & r("箱号") )
在命令窗口那里测试,看执行到什么字符的时候开始报错,看字符有什么异常 |
-- 作者:yetle -- 发布时间:2019/5/31 12:00:00 -- 1、加入这个代码不会弹出任何提示,数量少的就直接正常显示,数量少的还是会弹出参数错误提示参数无效 Dim doc As New PrintDoc Dim img As prt.RenderImage Dim Bar As New BarCodeBuilder Dim rt As new prt.RenderText Bar.Symbology = Barpro.Symbology.QRCode Bar.BarRatio = 0.3 Bar.BarWidth = 5 Bar.BarHeight = 5 Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight \'For Each r As Row In CurrentTable.Rows For Each r As DataRow In DataTables("分箱汇总").Select("[订单号] = \'" & Tables("分派工序_table2").current("订单号") & "\'") Dim ra As New prt.RenderArea \'ra.Stacking = prt.StackingRulesEnum.InlineLeftToRight ra.SplitHorzBehavior = prt.SplitBehaviorEnum.Never \'禁止水平分割 ra.SplitVertBehavior = prt.SplitBehaviorEnum.Never \'禁止垂直分割 ra.width = 140 ra.height = 120 rt = New prt.RenderText rt.Text = "订单号:" & r("订单号") & "制单号:" & r("制单号") & Chr(13) & Chr(10) & "款号:" & r("款号") & "客款号:" & r("客款号") & "系列:" & r("系列") & Chr(13) & Chr(10) & "箱号:" & r("箱号") & Chr(13) & Chr(10) & "件数:" & r("件数") & Chr(13) & Chr(10) & "颜色:" & r("颜色") & "尺码:" & r("尺码") rt.Style.FontSize = 14 rt.Style.FontBold = True rt.X = 5 rt.Y = 2 ra.Children.Add(rt) \'添加到容器中 \'bar.Code = "http://yetle2019.picp.net:23553/pgmx.htm?ddh="& r("订单号") & "&zdh=" & r("制单号") & "&kh=" & r("款号") & "&xh=" & r("箱号") bar.Code = "http://jemis123.jemis.com.cn:88/ddpgmx.htm?ddh="& r("订单号") & "&zdh=" & r("制单号") & "&kh=" & r("款号") & "&xh=" & r("箱号") output.show("http://jemis123.jemis.com.cn:88/ddpgmx.htm?ddh="& r("订单号") & "&zdh=" & r("制单号") & "&kh=" & r("款号") & "&xh=" & r("箱号") ) img = new prt.RenderImage img.Image = bar.GetImage img.Width = 80 img.height = 80 img.Style.Spacing.All = 2 img.Y = 30 ra.Children.Add(img) Doc.Body.Children.Add(ra) Next Doc.Preview() 2、现在是一页有两个二维码,想设置成一页四个二维码怎样弄
[此贴子已经被作者于2019/5/31 12:04:58编辑过]
|
-- 作者:有点甜 -- 发布时间:2019/5/31 12:05:00 -- 把你的条码的宽高弄小,就可以了啊
img.Width = 40 img.height = 40
|
-- 作者:yetle -- 发布时间:2019/6/3 12:36:00 -- 老师,我想把下面这一段,分开两部分,一部分字体小,一部分字体大,要怎么改 rt.Text = "订单号:" & r("订单号") & "制单号:" & r("制单号") & Chr(13) & Chr(10) & "款号:" & r("款号") & "客款号:" & r("客款号") & "系列:" & r("系列") & Chr(13) & Chr(10) & "箱号:" & r("箱号") & Chr(13) & Chr(10) & "件数:" & r("件数") & Chr(13) & Chr(10) & "颜色:" & r("颜色") & "尺码:" & r("尺码") rt.Style.FontSize = 14 是不是这样? rt1 = New prt.RenderText rt1.Text = "订单号:" & r("订单号") & Chr(13) & Chr(10) & "制单号:" & r("制单号") & Chr(13) & Chr(10) & "款号:" & r("款号") & Chr(13) & Chr(10) & "客款号:" & r("客款号") & Chr(13) & Chr(10) & "系列:" & r("系列") & Chr(13) & Chr(10) & "箱号:" & r("箱号") & Chr(13) & Chr(10) & "件数:" & r("件数") rt1.Style.FontSize = 14 rt1.Style.FontBold = True rt1.X = 20 rt1.Y = 15 ra.Children.Add(rt1) \'添加到容器中 rt2 = New prt.RenderText rt2.Text = "颜色:" & r("颜色") & Chr(13) & Chr(10) & "尺码:" & r("尺码") rt2.Style.FontSize = 18 rt2.Style.FontBold = True rt2.X = 20 rt2.Y = 15 ra.Children.Add(rt2) \'添加到容器中 [此贴子已经被作者于2019/6/3 12:39:21编辑过]
|
-- 作者:有点甜 -- 发布时间:2019/6/3 13:04:00 -- 参考
http://www.foxtable.com/webhelp/scr/1183.htm
|