buildDetail事件,写代码
If e.Book.TempLate = "计价表" Then
If e.region = "订单表" 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")
Else '否则生成条形码图片
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.Code39
Bar.Code = e.DataRow("款号")
Bar.BarRatio = 0.3
Bar.BarHeight = 8
bar.SaveImage(ProjectPath & "Images\BarCode.gif",300)
End If
End If
End If