如果不会做,实例发上来
msgbox(e.Book.TempLate)
msgbox(e.DataRow.DataTable.name)
msgbox(e.DataRow("当前表单编号"))
If e.DataRow IsNot Nothing AndAlso e.DataRow.DataTable.Name = "T_Report" AndAlso e.Book.TempLate = e.DataRow("当前表单编号") Then
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.Code39
Bar.Code = e.DataRow("当前表单编号")
Bar.BarRatio = 2
Bar.BarHeight = 10
Bar.QuietZoneWidth = 2
Bar.AddCheckSum = False
Bar.DisplayChecksum = False
Bar.DisplayStartStopChar = False
bar.SaveImage(ProjectPath & "Images\BarCode2.gif",300)
End If