这个代码只是同一个二维码保存了两次而已
试试
If e.Book.TempLate = "物料二维码打印" Then
If e.region = "条码生成明细_table1" 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("条码生成明细_table1").FindRow(e.DataRow)
If idx > -1 AndAlso idx < Tables("条码生成明细_table1").Rows.Count
Dim r As Row = Tables("条码生成明细_table1").Rows(idx+1)
Bar = New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Dim size As String
size = r("二维码")
'size += "," & e.DataRow("发料数量")
Bar.Code = size
Bar.BarRatio = 0.3
Bar.BarHeight = 8
bar.SaveImage(ProjectPath & "Images\BarCode1.gif",300)
End If
End If
End If
End If