刚学习做专业报表,跟excel报表比较了一下,有条形码的情况还是专业报表的条形码打印最清晰,宽度设置大一点,扫描非常畅顺;excel报表用条形码字体做出来的,不知道如何调节字体,扫描失败;excel报表里生成条形码图片再引用进来的方法,用热转打印机打印出来会起毛,不够清晰,但是扫描还算畅顺。
以上心得。
回归正题
我做的查询窗口和帮助里的类似
http://www.foxtable.com/help/topics/1058.htm
专业报表代码如下: 打印纸为100 x 100 不干胶,打印内容只占了页面的50%,这个没关系。 内容除了文本还带有一个条形码。我无法将条形码放到容器里面,执行显示内存不足。不知道如何打印筛选后的内容,全部打印出来了,批量打印简直就是混乱。请老师们帮我解解~谢谢
'For Each r As Row In CurrentTable.Rows
Dim doc As New PrintDoc '定义一个报表
doc.PageSetting.Width = 100 '纸张宽度为100毫米
doc.PageSetting.Height = 100 '纸张高度为100毫米
Doc.PageSetting.LeftMargin = 4.8 '设置左边距
Doc.PageSetting.RightMargin = 4.8 '设置右边距
Doc.PageSetting.TopMargin = 4.8 '设置上边距
Doc.PageSetting.BottomMargin = 2.8 '设置下边距
Doc.Stacking = prt.StackingRulesEnum.BlockTopToBottom
Dim ra As New prt.RenderArea
Dim rt As prt.RenderText
ra.Width = 90.4 '对象宽度等于页面宽度
ra.Height = 25
ra.Style.Padding.All = 1 ' 标签内容距离边框为1毫米
ra.Style.Borders.All = New prt.Linedef(0.3, Color.black) '设置边框
ra.DataBinding.DataSource = BindTables("批量查询_Table1") '将容器绑定到"批量查询_Table1"
Doc.Body.ChildRen.Add(ra) '将容器加入到报表中
rt = New prt.RenderText
rt.Text = "Description of Contents"
rt.Style.Font = New Font("Arial", 8)
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = "SKU:[Fields!shichang.Value]#" & "[Fields!楼层.Value]-" & "[Fields!dangkou.Value]-" & "[cint(Fields!单价.Value)*10]"
rt.Style.Font = New Font("Arial", 8)
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = "Model:[Fields!货号.Value]"
rt.Style.Font = New Font("Arial", 8)
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = "Color/Size:[Fields!颜色规.Value]"
rt.Style.Font = New Font("Arial", 8)
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = "Qty:[Fields!数量.Value]"
rt.Style.Font = New Font("Arial", 8)
ra.Children.Add(rt) '添加到容器中
Dim rg As New prt.RenderGraphics
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.Code128
Bar.BarWidth = 0.4
Bar.BarHeight = 6
'bar.Code = r("订单子编号")
bar.Code = CurrentTable.Current("订单子编号")
rg = new prt.RenderGraphics
rg.Style.Padding.Left = 10
'rg.Style.Padding.Bottom = 0
bar.DrawOnCanvas(rg.Graphics,0,0,1)
ra.Children.Add(rg) '添加到容器中
'Doc.Body.ChildRen.Add(rg)
ra.BreakBefore = prt.BreakEnum.Page
rg.BreakBefore = prt.BreakEnum.Page
Doc.Preview() '预览报表
Doc.PrinterName = "ZDesigner TLP 2844"
'doc.Print()
CurrentTable.Current("拣货标签") = True
'r("拣货标签") = True
'Next
[此贴子已经被作者于2014-3-16 5:30:48编辑过]