未声明 Barpro 它可能因其保护级别而不可访问
当前代码:
Dim cmd As new SQLCommand
cmd.Connec tionNa me="主数据源"
cmd.Comman dText = "sel ect * from {SYS_二维码参数及标签打印机设置}"
Dim dt11 As DataTable = cmd.ExecuteReader()
Dim dr11 As DataRow = dt11.DataRows(0)
output.show(1)
Dim fl As String
If dt11.datarows.count > 0 Then '如果有数据,就操作,反之不操作
Dim doc As New PrintDoc() '定义一个报表
doc.PageSetting.Width = cint(dr11("纸张宽度")) '纸张宽度
doc.PageSetting.Height = cint(dr11("纸张高度")) '纸张高度
Doc.PrinterName = dr11("二维码打印机") '设定打印机为当前选择的打印机'
Dim img As C1.C1Preview.RenderImage '定义一个图像'
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Bar.BarWidth = cint(dr11("二维码宽度"))
Bar.BarHeight = cint(dr11("二维码高度"))
Bar.QuietZoneWidth = cint(dr11("二维码静区"))
Bar.QRCodeModuleSize = dr11("模组尺寸")
Doc.Stacking = C1.C1Preview.StackingRulesEnum.InlineLeftToRight
cmd.CommandText = "sele ct * from {办案装备_管理台账} where guid='" & guid & "'"
Dim dt111 As DataTable = cmd.ExecuteReader()
Dim dr111 As DataRow = dt111.DataRows(0)
If dt111.datarows.count > 0 Then
fl = ProjectPath & "Reports\" & dr111("编号") & "二维码.jpg"
Bar.Code = dr111("编号")
End If
img = new C1.C1Preview.RenderImage
img.Image = bar.GetImage
img.X=cint(dr11("图片x"))
img.y=cint(dr11("图片Y"))
img.Width = cint(dr11("图片高度")) '宽度等于页面宽度
img.Height = cint(dr11("图片宽度"))''高度由图片大小自动决定
Doc.Body.Children.Add(img)
If dr11("打印或预览")="打印" Then
doc.Print
Else
doc.SaveImage(fl)
End If
End If
Bar.Symbology = Barpro.Symbology.QRCode
红色部分如果换成:
Bar.Symbology = C1.BarCode.CodeType.QRCode
运行提示 BarCode不是c1的成员
[此贴子已经被作者于2022/12/14 11:52:55编辑过]