If e.Book.TempLate = "物料二维码打印" Then
If e.region = "P包装条码明细" Then
If e.DataRow Is Nothing OrElse e.DataRow.IsNull("二维码") Then '如果是空行或者Lot列为空
Dim img As New System.Drawing.Bitmap(1,1) '生成一个空白图片
img.Save(ProjectPath & "Images\BarCode.gif")
img.Save(ProjectPath & "Images\BarCode1.gif")
Else '否则生成条形码图片
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Dim size As String
size = e.DataRow("二维码")
'size += "," & e.DataRow("发料数量")
Bar.Code = size
Bar.BarRatio = 0.3
Bar.BarHeight = 8
bar.SaveImage(ProjectPath & "Images\BarCode.gif",300)
Dim idx As Integer = Tables("P包装条码明细").FindRow(e.DataRow)
If idx > -1 AndAlso idx < Tables("P包装条码明细").Rows.Count
Dim r As Row = Tables("P包装条码明细").Rows(idx+1)
Bar = New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Dim size1 As String
size1 = r("二维码")
'size += "," & e.DataRow("发料数量")
Bar.Code = size1
Bar.BarRatio = 0.3
Bar.BarHeight = 8
bar.SaveImage(ProjectPath & "Images\BarCode1.gif",300)
End If
End If
End If
End If
这是用EXCEL模板生成的二维码,两栏,发现第二栏生成的二维码很多扫出来结果不一样