急!解决追加100分!水晶报表怎么用code128 设置条码
我先用BarcodeC128B({RECEIPT_HEADER.RECEIPT_ID}),条码枪扫不出来(枪没问题),然后我用的自定义函数,但代码有问题,哪位大侠指导我下...
我先用BarcodeC128B ({RECEIPT_HEADER.RECEIPT_ID}),条码枪扫不出来(枪没问题),然后我用的自定义函数,但代码有问题,哪位大侠指导我下呗,最好有code128自定义函数代码,谢谢!解决追加100分!
展开
2011-11-22
展开全部
是要在水晶报表中显示条形码吗?可惜我没用过水晶报表,只知道在FineReport报表中是通过“数据形态”来显示条形码的,不知道水晶是怎样的。
展开全部
'CODE128码转换类
Public Class Code128
'字符串转换公式
'保存时,需要保存为UNICODE格式才可以保存
Public Function StringToCode128(ByVal input As String) As String
Try
Dim endchar As Char
Dim total As Int64 = 104
Dim tmp As Integer
For i As Int16 = 1 To input.Length
tmp = Asc(input.Substring(i - 1, 1))
If tmp >= 32 Then
total += (tmp - 32) * i
Else
total += (tmp + 64) * i
End If
Next
Dim endAsc = total Mod 103
If endAsc >= 95 Then
Select Case endAsc
Case 95
endchar = "Ã"
Case 96
endchar = "Ä"
Case 97
endchar = "Å"
Case 98
endchar = "Æ"
Case 99
endchar = "Ç"
Case 100
endchar = "È"
Case 101
endchar = "É"
Case 102
endchar = "Ê"
End Select
Else
endAsc += 32
endchar = Chr(endAsc)
End If
Return "Ì" & input & endchar.ToString() & "Î"
Catch ex As Exception
Return ""
Finally
End Try
End Function
End Class
Public Class Code128
'字符串转换公式
'保存时,需要保存为UNICODE格式才可以保存
Public Function StringToCode128(ByVal input As String) As String
Try
Dim endchar As Char
Dim total As Int64 = 104
Dim tmp As Integer
For i As Int16 = 1 To input.Length
tmp = Asc(input.Substring(i - 1, 1))
If tmp >= 32 Then
total += (tmp - 32) * i
Else
total += (tmp + 64) * i
End If
Next
Dim endAsc = total Mod 103
If endAsc >= 95 Then
Select Case endAsc
Case 95
endchar = "Ã"
Case 96
endchar = "Ä"
Case 97
endchar = "Å"
Case 98
endchar = "Æ"
Case 99
endchar = "Ç"
Case 100
endchar = "È"
Case 101
endchar = "É"
Case 102
endchar = "Ê"
End Select
Else
endAsc += 32
endchar = Chr(endAsc)
End If
Return "Ì" & input & endchar.ToString() & "Î"
Catch ex As Exception
Return ""
Finally
End Try
End Function
End Class
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询