1、例子没有问题
2、如果要排序,红色代码改一下
static idx As Integer
static drs As List(Of DataRow)
If e.Book.TempLate = "工序排配计划表" Then
If e.region = "工序计划表" Then
If e.DataRow IsNot Nothing Then
For i As Integer = idx To idx + 9
If i < drs.Count
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.Code39
Bar.Code = drs(i)("工序ID")
Bar.BarRatio = 0.3
Bar.BarHeight = 8
Bar.Rotate = Barpro.Rotate.Degree270
Bar.AddCheckSum = False
bar.SaveImage(ProjectPath & "Images\BarCode" & i-idx & ".gif",300)
Else
Dim bit As new bitmap(1,1)
bit.Save(ProjectPath & "Images\BarCode" & i-idx & ".gif")
End If
Next
idx += 10
End If
ElseIf e.Region = "BOM表" Then
drs = DataTables("工序计划表").Select("零件id = '" & e.DataRow("零件id") & "'", "_Identify")
idx = 0
End If
End If