此主题相关图片如下:bar01.jpg
我用下面的代码,能实现上面的状态,并能正常打印Dim doc As New PrintDoc '定义一个报表
Dim rt As New prt.RenderTable()
Doc.PageSetting.Height=30
Doc.PageSetting.Width=20
doc.Body.Children.Add(rt)
Doc.PageSetting.LeftMargin = 1
Doc.PageSetting.RightMargin = 1
Doc.PageSetting.TopMargin = 1
Doc.PageSetting.BottomMargin = 1
'rt.Style.GridLines.All = New prt.Linedef(Color.DarkGray) '将表格的颜色设为深灰色
Dim img As prt.RenderImage
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Bar.BarRatio = 0.2
bar.BarWidth= 25
Bar.BarHeight = 17
'Bar.QRCodeErrorCorrectionLevel = Barpro.QRCodeErrorCorrectionLevel.L
'Bar.QRCodeModuleSize = 0.7
'Bar.Rotate = Barpro.Rotate.Degree90
bar.Code ="G2-99-99"
img = new prt.RenderImage
img.Image = bar.GetImage
rt.Rows.Count = 2
rt.Cols.Count = 3
rt.Width = 25
rt.Height = 17
rt.X=2
rt.Y=2
rt.Cells(0,1).SpanCols = 2
rt.Cells(1,1).SpanCols = 2 '第2行第2个单元格向右合并2列 ’希望这条码图能占用这2列位置并居中放置
rt.cells(1,1).Style.TextAlignHorz=prt.AlignHorzEnum.Center
rt.Cells(0,1).RenderObject = img
rt.Cells(0,1).RenderObject.Style.TextAlignHorz=prt.AlignHorzEnum.Center ‘没有作用,不懂如何写
rt.cells(0,0).text = "取件"
rt.cells(1,0).text = "柜号:"
rt.cells(1,1).text = "G2-99-99" 'e.Form.Controls("BarCode").text
Doc.Preview()
'-----------------------
请教:
如何设置能将 rt.Cells(0,1).RenderObject = img 这行的条码图居中打印?
先谢谢专家!
[此贴子已经被作者于2018/2/1 21:11:11编辑过]