【问题标题】:Duplicate barcode in the same report同一报告中的重复条码
【发布时间】:2015-09-02 13:35:43
【问题描述】:

我想在同一个报告页面上打印一个确定数量的同一个条形码,我使用了这个代码但它不起作用:

' ###### I try to repeat the function to generate the same barcode 6 times #######
Private Sub ExampleBarcode_BeforePrint(sender As Object, e As System.Drawing.Printing.PrintEventArgs) Handles Me.BeforePrint
    For i As Integer = 1 To 6
        Me.Detail.Controls.Add(CreateQRCodeBarCode("01234ft78"))
    Next
End Sub

Public Function CreateQRCodeBarCode(ByVal BarCodeText As String) As XRBarCode

    Dim barCode As New XRBarCode()

    barCode.Symbology = New Code128Generator()

    barCode.Text = BarCodeText
    barCode.Width = 240
    barCode.Height = 70

    barCode.Module = 1

    CType(barCode.Symbology, Code128Generator).CalcCheckSum = False
    CType(barCode.Symbology, Code128Generator).CharacterSet = Code128Charset.CharsetAuto
    Return barCode
End Function

【问题讨论】:

  • 什么不起作用? XRbarCode 是不是可以添加到 contol-collection 的类?
  • 正在工作,但它只打印一次条形码,而不是连续打印 6 次。问题是我无法上传图片来展示我需要的东西。

标签: vb.net devexpress xtrareport


【解决方案1】:

您的条形码位于同一位置。您需要为每个控件设置不同的位置。为此,您可以使用 LeftFTopF 属性。
这是一个例子:

For i As Integer = 0 To 5
    Dim barCode = CreateQRCodeBarCode("01234ft78")
    barCode.TopF = i * barCode.HeightF

    Me.Detail.Controls.Add(barCode)
Next

【讨论】:

  • 非常感谢您的回答,正是我需要的
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-28
  • 2021-03-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多