如何根据“编号”列(字符型),自动生成条形码到“条形码”列,要求条形码产生的图片文件名为“编号.jpg”
编号列=字符型
条形码列=图片型
表属性 DataColChanged 事件:
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.Code39
Dim cdt As DataTable = DataTables("主表")
Dim cdc As DataCol = cdt.DataCols("编号")
Dim ii As Integer = -1
For i As Integer = 0 To DataTables("主表").DataRows.Count - 1
If e.DataRow("编号") = Nothing
Bar.Code = e.DataRow("编号")
Bar.BarRatio = 0.3
Bar.BarHeight = 8
Bar.DisplayChecksum = False
Bar.DisplayStartStopChar = False
'Bar.SaveImage("images\" & cdc &".jpg")
e.DataRow("条形码").FileName= GetImage("images\" & cdc &".jpg")
Else
End If
ii = i
Exit For
Next
[此贴子已经被作者于2021/2/5 22:00:29编辑过]