以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助] 关于二维码问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=102783)

--  作者:wumingrong1
--  发布时间:2017/6/25 20:01:00
--  [求助] 关于二维码问题

Dim doc As New PrintDoc
Dim rg As prt.RenderGraphics
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
Dim r As Row = Tables("二维码清单表").current
    bar.Code = r("二维码编号")
    rg = new prt.RenderGraphics
    bar.DrawOnCanvas(rg.Graphics,0,0,3) \'X Y 坐标 放大倍数
    rg.Style.Spacing.All = 3
    Doc.Body.Children.Add(rg)
Doc.Preview()

 


图片点击可在新窗口打开查看此主题相关图片如下:360截图20170625195942832.jpg
图片点击可在新窗口打开查看

--  作者:有点蓝
--  发布时间:2017/6/26 9:02:00
--  
Dim doc As New PrintDoc
Dim rg As prt.RenderGraphics
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
Dim r As Row = Tables("二维码清单表").current
bar.Code = r("二维码编号")
rg = new prt.RenderGraphics
bar.DrawOnCanvas(rg.Graphics,0,0,3) \'X Y 坐标 放大倍数
rg.Style.Spacing.All = 3
Doc.Body.Children.Add(rg)
Dim rx As new prt.RenderText
rx.Text = "二维码编号"
rx.X = 40
Doc.Body.Children.Add(rx)
Doc.Preview()

--  作者:有点色
--  发布时间:2017/6/26 9:21:00
--  

 设置条码,直接用工具

 

http://www.foxtable.com/webhelp/scr/2076.htm

 


--  作者:wumingrong1
--  发布时间:2017/7/4 15:56:00
--  

想实现只打印 【起始】-【截止】的二维码,命令该怎么修改?

 

 

Dim doc As New PrintDoc
Dim rg As prt.RenderGraphics
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
For Each r As Row In Tables("二维码清单表").Rows \'所有二维码
bar.Code = r("二维码编号")
r("打印员工") = User.name
r("打印时间") = dt
rg = new prt.RenderGraphics
bar.DrawOnCanvas(rg.Graphics,0,0,3) \'X Y 坐标 放大倍数
rg.Style.Spacing.All = 3  \'统一设置边框
rg.Style.Spacing.Top = 20 \'与上一个对象相隔距离
Doc.Body.Children.Add(rg)
Dim rx As new prt.RenderText
rx.Text = r("二维码编号")
rx.X = 57 \'X轴起始位置
rx.Style.Spacing.Top = 1 \'与上一个对象相隔距离

Doc.Body.Children.Add(rx) \'添加到容器中

Next
Doc.Preview()

 

 

 


图片点击可在新窗口打开查看此主题相关图片如下:360截图20170704155502348.jpg
图片点击可在新窗口打开查看

--  作者:有点甜
--  发布时间:2017/7/4 16:16:00
--  

Dim ks As Integer = val(e.form.controls("Textbox1").Text)

Dim js As Integer = val(e.form.controls("Textbox2").Text)

For i As integer = ks to js

    Dim r As Row = Tables("二维码清单表").Rows(i)

 

 

 

Next


--  作者:wumingrong1
--  发布时间:2017/7/5 12:29:00
--  

1、【打印二维码】按钮命令如下:

 


图片点击可在新窗口打开查看此主题相关图片如下:360截图20170704155502348.jpg
图片点击可在新窗口打开查看

Dim cmd As New SQLCommand
Dim dt As Date
cmd.C
cmd.CommandText = "Select GetDate()"
dt = cmd.ExecuteScalar()

 

Dim doc As New PrintDoc
Dim rg As prt.RenderGraphics
Dim ra As New prt.RenderArea \'定义一个容器
Dim Bar As New BarCodeBuilder \'增加一个文本
Bar.Symbology = Barpro.Symbology.QRCode
\'Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
ra.Stacking = prt.StackingRulesEnum.InlineLeftToRight
\'For Each r As Row In Tables("二维码清单表").Rows \'所有二维码
Dim ks As Integer = val(e.form.controls("起始").Text)
Dim js As Integer = val(e.form.controls("截止").Text)
For i As Integer = ks To js
    Dim r As Row = Tables("二维码清单表").Rows(i)
bar.Code = r("二维码编号") \'文本内容
r("打印员工") = User.name
r("打印时间") = dt
rg = new prt.RenderGraphics
bar.DrawOnCanvas(rg.Graphics,0,0,1.5) \'X Y 坐标 放大倍数
rg.Style.Spacing.All = 3  \'统一设置边框
rg.Style.Spacing.Top = 25 \'与上一个对象相隔距离
Doc.Body.Children.Add(rg)
Dim rx As new prt.RenderText
rx.Text = r("二维码编号")
rx.X = 20 \'X轴起始位置
rx.Style.Spacing.Top = 0.8 \'与上一个对象相隔距离

Doc.Body.Children.Add(rx) \'添加到容器中

Next
Doc.Preview()

 

2、目前以上命令出来的效果如下:

图片点击可在新窗口打开查看此主题相关图片如下:360截图20170705121913453.jpg
图片点击可在新窗口打开查看

3、想要实现以下效果、命令该怎么改?(注意二维码图片下面的【二维码编号】也要跟随着对应的二维码图片移动到对应的位置)

图片点击可在新窗口打开查看此主题相关图片如下:微信图片_20170705122721.jpg
图片点击可在新窗口打开查看

[此贴子已经被作者于2017/7/5 12:32:32编辑过]

--  作者:有点甜
--  发布时间:2017/7/5 14:44:00
--  

参考代码

 

Dim doc As New PrintDoc
Dim rg As prt.RenderGraphics
Dim Bar As New BarCodeBuilder \'增加一个文本
Bar.Symbology = Barpro.Symbology.QRCode
Dim rt As new prt.RenderTable
rt.Cols.Count = 3 \'设置列数

Dim ks As Integer = 0
Dim js As Integer = 10
Dim x As Integer = 0
Dim y As Integer = 0
For i As Integer = ks To js
    Dim r As Row = Tables("表A").Rows(i)
    bar.Code = r("第二列") \'文本内容
    rg = new prt.RenderGraphics
    bar.DrawOnCanvas(rg.Graphics,0,0,1.5) \'X Y 坐标 放大倍数
    rt.Cells(x, y).RenderObject = rg
    Dim rx As new prt.RenderText
    rx.Text = r("第二列")
    rt.cells(x+1, y).RenderObject = rx
    y += 1
    If y >=3 Then
        y = 0
        x += 2
    End If
Next
Doc.Body.Children.Add(rt) \'添加到容器中
Doc.Preview()


--  作者:wumingrong1
--  发布时间:2017/7/5 16:01:00
--  

Dim doc As New PrintDoc
Dim rg As prt.RenderGraphics
Dim Bar As New BarCodeBuilder \'增加一个文本
Bar.Symbology = Barpro.Symbology.QRCode
Dim rt As new prt.RenderTable
rt.Cols.Count = 3 \'设置列数

Dim x As Integer = 0
Dim y As Integer = 0

Dim ks As Integer = val(e.form.controls("起始").Text)
Dim js As Integer = val(e.form.controls("截止").Text)
For i As Integer = ks To js
    Dim r As Row = Tables("二维码清单表").Rows(i)
    bar.Code = r("二维码编号") \'文本内容
    rg = new prt.RenderGraphics
    bar.DrawOnCanvas(rg.Graphics,0,1,1.5) \'X Y 坐标 放大倍数
    rg.Style.Spacing.Top = 25 \'与上一个对象相隔距离
    rt.Cells(x, y).RenderObject = rg
    Dim rx As new prt.RenderText
    rx.Text = r("二维码编号")
    rx.X = 15 \'X轴起始位置
    rx.Y = 40 \'X轴起始位置
   
    rt.cells(x+1, y).RenderObject = rx
    y += 1
    If y >=3 Then
        y = 0
        x += 2
    End If
Next
Doc.Body.Children.Add(rt) \'添加到容器中
Doc.Preview()

 

 

 


图片点击可在新窗口打开查看此主题相关图片如下:360截图20170705160010412.jpg
图片点击可在新窗口打开查看

--  作者:有点甜
--  发布时间:2017/7/5 16:08:00
--  

自行设置单元格的宽、高,即可。

 

Dim doc As New PrintDoc
Dim rg As prt.RenderGraphics
Dim Bar As New BarCodeBuilder \'增加一个文本
Bar.Symbology = Barpro.Symbology.QRCode
Dim rt As new prt.RenderTable
rt.Cols.Count = 3 \'设置列数
rt.Style.GridLines.All = New prt.Linedef(Color.DarkGray)
Dim ks As Integer = 0
Dim js As Integer = 10
Dim x As Integer = 0
Dim y As Integer = 0
For i As Integer = ks To js
    Dim r As Row = Tables("表A").Rows(i)
    bar.Code = r("第二列") \'文本内容
    rg = new prt.RenderGraphics
    bar.DrawOnCanvas(rg.Graphics,0,0,1.5) \'X Y 坐标 放大倍数
    rg.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center
    rt.Cells(x, y).RenderObject = rg
    Dim rx As new prt.RenderText
    rx.Text = r("第二列")
    rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center
    rt.cells(x+1, y).RenderObject = rx
    y += 1
    If y >=3 Then
        y = 0
        x += 2
    End If
Next
Doc.Body.Children.Add(rt) \'添加到容器中
Doc.Preview()


--  作者:wumingrong1
--  发布时间:2017/7/9 14:45:00
--  

 想要实现,下图中的二维码图片;不要跟着边框进行拉伸;想让它变小一点。以下命令该怎么修改?

 

 
图片点击可在新窗口打开查看此主题相关图片如下:360截图20170709144203873.jpg
图片点击可在新窗口打开查看

Dim cmd As New SQLCommand
Dim dt As Date
cmd.C
cmd.CommandText = "Select GetDate()"
dt = cmd.ExecuteScalar()

Dim doc As New PrintDoc
Dim rg As prt.RenderGraphics
Dim Bar As New BarCodeBuilder \'增加一个文本
Bar.Symbology = Barpro.Symbology.QRCode
Dim rt As new prt.RenderTable
rt.Style.GridLines.All = New prt.LineDef \'将网格线类型设为默认类型
\'rt.Style.GridLines.All = New prt.Linedef(Color.DarkGray)

rt.Cols.Count = 3 \'设置列数

rt.Rows.Count = 3
rt.Cols(0).Width = 195
rt.Cols(1).Width = 209
rt.Cols(2).Width = 200

rt.Rows.Count = 8
rt.Rows(0).Height = 57
rt.Rows(1).Height = 10
rt.Rows(2).Height = 64
rt.Rows(3).Height = 10
rt.Rows(4).Height = 64
rt.Rows(5).Height = 10
rt.Rows(6).Height = 60
rt.Rows(7).Height = 10

Dim ks As Integer = val(e.form.controls("起始").Text)
\'Dim zs As Integer = val(e.form.controls("张数").Text)
Dim x As Integer = 0
Dim y As Integer = 0
For i As Integer = ks To ks+11
    Dim r As Row = Tables("二维码清单表").Rows(i)
    bar.Code = r("二维码编号") \'文本内容
    r("打印员工") = User.name
    r("打印时间") = dt
    r("二维码使用者") = e.form.controls("二维码使用者").Text
    rg = new prt.RenderGraphics
    bar.DrawOnCanvas(rg.Graphics,0,0,0.1) \'X Y 坐标 放大倍数


 \'   rg.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center
    rt.Cells(x, y).RenderObject = rg
    Dim rx As new prt.RenderText
    rx.Text = r("二维码编号")
    rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center
    rt.cells(x+1, y).RenderObject = rx
    y += 1
    If y >=3 Then
        y = 0
        x += 2
    End If
    \'    rt.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center \'图片水平居中
      \'  rt.Style.ImageAlign.AlignVert = prt.ImageAlignVertEnum.Center \'图片垂直居中
Next
Doc.Body.Children.Add(rt) \'添加到容器中
Doc.Preview()