以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 【求助】添加的项目已经有所有者了 问题的解决办法 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=109418) |
||||
-- 作者:李孝春 -- 发布时间:2017/11/11 14:24:00 -- 【求助】添加的项目已经有所有者了 问题的解决办法 【求助】添加的项目已经有所有者了 问题的解决办法 麻烦修正一下红色部分代码 谢谢
下面两个写法 结果都是一样的错误 方法一: If Tables("卷宗入库").Current IsNot Nothing Then Dim CurRow As Row = Tables("卷宗入库").Current Dim drs1 = DataTables("款物明细").Select("案件编号 = \'" & currow("卷宗编号") & "\'") Dim doc As New PrintDoc Dim rm As New prt.RenderImage \'定义一个图片对象 For i As Integer = 0 To drs1.count-1 Dim r = drs1(i) rm.Image = GetImage( r("二维码")) \'设置图片 rm.Style.Borders.All = New prt.Linedef(1, Color.Red) \'设置边框 doc.Body.Children.Add(rm) \'将图片对象加入报 Next Doc.Preview() \'预览 End If 方法二: If Tables("卷宗入库").Current IsNot Nothing Then Tables("款物明细").Filter = "案件编号 = \'" & Tables("卷宗入库").Current("卷宗编号") & "\'" Dim doc As New PrintDoc Dim rm As New prt.RenderImage For Each r As Row In Tables("款物明细").Rows rm.Image = GetImage( r("二维码")) \'设置图片 rm.Style.Borders.All = New prt.Linedef(1, Color.Red) \'设置边框 doc.Body.Children.Add(rm) \'将图片对象加入报 Next Doc.Preview() End If [此贴子已经被作者于2017/11/11 14:50:35编辑过]
|
||||
-- 作者:有点蓝 -- 发布时间:2017/11/11 15:23:00 -- If Tables("卷宗入库").Current IsNot Nothing Then Dim CurRow As Row = Tables("卷宗入库").Current Dim drs1 = DataTables("款物明细").Select("案件编号 = \'" & currow("卷宗编号") & "\'") Dim doc As New PrintDoc Dim rm As prt.RenderImage \'定义一个图片对象 For i As Integer = 0 To drs1.count-1 Dim r = drs1(i) rm = new prt.RenderImage rm.Image = GetImage( r("二维码")) \'设置图片 rm.Style.Borders.All = New prt.Linedef(1, Color.Red) \'设置边框 doc.Body.Children.Add(rm) \'将图片对象加入报 Next Doc.Preview() \'预览 End If
|
||||
-- 作者:李孝春 -- 发布时间:2017/11/13 13:20:00 -- 回复:(有点蓝)If Tables("卷宗入库").Current IsNo... 有点蓝老师 我想再请教一下 怎么按照我设定的缩放比例进行二维码图片列的打印呢? 当前代码如下: If Tables("卷宗入库").Current IsNot Nothing Then Dim CurRow As Row = Tables("卷宗入库").Current Dim drs1 = DataTables("款物明细").Select("案件编号 = \'" & currow("卷宗编号") & "\'") Dim doc As New PrintDoc Dim rg As prt.RenderGraphics Dim rm As New prt.RenderImage \'定义一个图片对象 Dim dr As Row=Tables("打印机").Current doc.PageSetting.Width = val(dr("设置宽度")) doc.PageSetting.Height = val(dr("设置高度") ) doc.PageSetting.LeftMargin=val(dr("左边距") ) doc.PageSetting.RightMargin=val(dr("右边距") ) doc.PageSetting.TopMargin=val(dr("上边距") ) doc.PageSetting.BottomMargin=val(dr("下边距") ) Doc.PrinterName = dr("打印机名称") doc.AutoRotate = dr("是否旋转") doc.PageSetting.Landscape=dr("是否横向") Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight For i As Integer = 0 To drs1.count-1 Dim r = drs1(i) rm = new prt.RenderImage rm.Width = "Parent.Width" \'宽度等于页面宽度 ‘指定高度和宽度结果打印的图片都不如原来按照缩放比例进行打印的清晰和快速识别率’ rm.Height = "Auto" \'高度由图片大小自动决定 rm.Image = GetImage( r("二维码")) \'设置图片 rm.Style.ImageAlign.StretchHorz = True \'禁止图片水平拉伸 rm.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center \'居中显示 rm.Style.ImageAlign.KeepAspectRatio=True rm.Style.Borders.All = New prt.Linedef(1, Color.Red) \'设置边框 doc.Body.Children.Add(rm) \'将图片对象加入报 Next Doc.Preview() \'预览 End If 原来的部分代码如下:因为是代码直接生成了二维码 ,现在是改写了另外的方式,怎么实现按预先设定的缩放比例来进行打印呢? Dim rg As prt.RenderGraphics Dim Bar As New BarCodeBuilder Dim dr As Row=Tables("打印机").Current doc.PageSetting.Width = val(dr("设置宽度")) doc.PageSetting.Height = val(dr("设置高度") ) doc.PageSetting.LeftMargin=val(dr("左边距") ) doc.PageSetting.RightMargin=val(dr("右边距") ) doc.PageSetting.TopMargin=val(dr("上边距") ) doc.PageSetting.BottomMargin=val(dr("下边距") ) Doc.PrinterName = dr("打印机名称") \'Dim xz As String = dr("是否旋转") doc.AutoRotate = dr("是否旋转") doc.PageSetting.Landscape=dr("是否横向") Bar.Symbology = Barpro.Symbology.QRCode Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight For Each r As Row In Tables("入库明细").Rows bar.Text=r("分册编号") & "册" bar.Code = r("加密字符") rg = new prt.RenderGraphics bar.DrawOnCanvas(rg.Graphics,0,0, val(dr("缩放比例") )) rg.Style.Spacing.All = 1 Doc.Body.Children.Add(rg) |
||||
-- 作者:有点甜 -- 发布时间:2017/11/13 15:39:00 -- http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=109478&skin=0
|