以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]条码打印机使用求助  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=66817)

--  作者:jiskin
--  发布时间:2015/4/14 13:59:00
--  [求助]条码打印机使用求助

由于没接触过专业报表

 

这是条码设置


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20150414135514.png
图片点击可在新窗口打开查看

 

我想直接用代码在FT里实现打印(或预览)

Dim doc As New PrintDoc
Dim img As prt.RenderImage
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.Code93
Bar.BarHeight = 7.08
Bar.QuietZoneWidth = 2
Bar.AddCheckSum = False
Bar.BearerBarWidth = 0.27
Bar.DisplayChecksum = False
Bar.TextAlignment = Barpro.Alignment.AboveLeft

Dim t As Table = Tables(e.Form.Name & "_Table1")
Dim rs As List(of Row) = t.GetCheckedRows
For Each r As Row In rs
    Bar.Code = r("编号")
    Bar.Text = "日期:" & r("日期")
    img = new prt.RenderImage
    img.Image = bar.GetImage
    Doc.Body.Children.Add(img)
Next
\'Doc.Preview()

 

不知道怎么写,求助


--  作者:Bin
--  发布时间:2015/4/14 14:02:00
--  
http://www.foxtable.com/help/topics/1949.htm

你要实现什么效果? 打印代码就是这样

--  作者:jiskin
--  发布时间:2015/4/14 14:07:00
--  
以下是引用Bin在2015/4/14 14:02:00的发言:
http://www.foxtable.com/help/topics/1949.htm

你要实现什么效果? 打印代码就是这样

 

打印机是两张一出的,我想按打印机软件中设置(如图)中设置的一样


--  作者:Bin
--  发布时间:2015/4/14 14:10:00
--  
看帮助示例2
--  作者:jiskin
--  发布时间:2015/4/14 14:11:00
--  
以下是引用Bin在2015/4/14 14:10:00的发言:
看帮助示例2

 

实例2中是可以两个一出,但是两个是一样的,我不需要一样的

另外纸张大小尺寸都要设置的吧?

 


--  作者:Bin
--  发布时间:2015/4/14 14:13:00
--  
http://www.foxtable.com/help/topics/1195.htm
[此贴子已经被作者于2015/4/14 14:18:06编辑过]

--  作者:Bin
--  发布时间:2015/4/14 14:18:00
--  
专业报表章节看一下,什么设置都齐全
--  作者:jiskin
--  发布时间:2015/4/14 14:38:00
--  
以下是引用Bin在2015/4/14 14:18:00的发言:
专业报表章节看一下,什么设置都齐全

 

Dim doc As New PrintDoc
Dim img As prt.RenderImage
Dim Bar As New BarCodeBuilder
doc.PageSetting.Width = 106
doc.PageSetting.Height = 30
Bar.Symbology = Barpro.Symbology.Code93
Bar.BarHeight = 7.08
Bar.QuietZoneWidth = 2
Bar.AddCheckSum = False
Bar.BearerBarWidth = 0.27
Bar.DisplayChecksum = False
Bar.TextAlignment = Barpro.Alignment.AboveLeft
doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
Dim t As Table = Tables(e.Form.Name & "_Table1")
Dim rs As List(of Row) = t.GetCheckedRows
For Each r As Row In rs
    Bar.Code = r("编号")
    Bar.Text = "日期:" & r("时间")
    img = new prt.RenderImage
    img.Width = 50
    img.Height = 30
    img.Style.Spacing.All = 2
    img.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中
    img.Style.TextAlignVert = prt.AlignVertEnum.Center
    img.Image = bar.GetImage
    Doc.Body.Children.Add(img)
Next
Doc.Preview()

 

 

能帮我看看哪里不对么


--  作者:Bin
--  发布时间:2015/4/14 14:42:00
--  
看6楼 这里 http://www.foxtable.com/help/topics/1195.htm
--  作者:jiskin
--  发布时间:2015/4/14 15:01:00
--  
以下是引用Bin在2015/4/14 14:42:00的发言:
看6楼 这里 http://www.foxtable.com/help/topics/1195.htm

 

Dim doc As New PrintDoc() \'定义一个报表
Doc.PageSetting.Width = 106
Doc.PageSetting.Height = 30
Dim ra As New prt.RenderArea \'定义一个容器
Dim rt As prt.RenderText \'定义一个文本对象
ra.Stacking = prt.StackingRulesEnum.InlineLeftToRight \'设置容器中对象的排列方式
For i As Integer = 0 To 1
    rt = New prt.RenderText() \'创建文本对象
    rt.Text = "Hello Foxtable " & i \'设置文本对象的内容
    rt.Width = 50 \'宽度为35毫米
    rt.Height = 30 \'高度为15毫米
    rt.Style.Spacing.All = 3 \'设置各个方向的间隔
    rt.Style.Borders.All = New prt.Linedef(1, Color.Red) \'设置边框
    rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中
    rt.Style.TextAlignVert = prt.AlignVertEnum.Center \'垂直居中
    ra.Children.Add(rt) \'将文本对象加入到容器ra中
Next
doc.Body.Children.Add(ra) \'将容器ra加入到报表
doc.Preview() \'预览

 

 

我找不出这个问题出在哪里?