Use the following steps to replace the default barcode font in reports with barcode font Code128. Code128 prints smaller barcodes than the default font (barcode font Code39QuarterInch).
Note that Infor's support of barcode font Code128 prints only the characters currently available in the default barcode font.
NOTE: With Code128, Code128Narrow, and Code128VeryNarrow, a font size of 48 or greater is recommended. With Code128Wide and Code128VeryWide, a font size of 36 or greater is recommended.
When using this font, you must use English as the Windows regional setting.
Code 128A does not support lower case characters but Code 128B does support lower case characters.
Code 128A can encode punctuation, the digits 0 through 9, uppercase characters (no lowercase), the standard ASCII control codes, and the special characters shown in the table below. Code 128B can encode punctuation, digits 0 through 9, upper and lower case characters, and the special characters in the table below.
We recommend that you use Code 128B; it is generally the best choice for most circumstances.
ASCII Code | Code 128A | Code 128B |
---|---|---|
32 | FNC3 | FNC3 |
33 | FNC2 | FNC2 |
34 | Shift | Shift |
35 | Code C | Code C |
36 | Code B | FNC4 |
37 | FNC4 | Code A |
38 | FNC1 | FNC1 |
(FNC = Function Key) |
To replace the default barcode font in reports with barcode font Code128:
For Code128 A:
Public Function GetBarCodeOutput t(ByVal inputValue As String) As String Dim CheckDigit As Integer = 0 Dim i As Integer = 0 Dim BarCodeOutput As String = "" Dim BarCodeInput As String Dim BarCodeTemp As String = "" Dim SingleByte As Integer = 0 BarCodeInput = inputValue.ToUpper() For i = 1 To Len(BarCodeInput) SingleByte = Asc(Mid(BarCodeInput, i,1)) BarCodeTemp = BarCodeTemp + Chr(SingleByte - 32) Next CheckDigit = 1 For i = 1 To Len(BarCodeTemp) SingleByte = Asc(Mid(BarCodeTemp, i,1)) CheckDigit = (CheckDigit + (SingleByte * i)) Mod 103 Next BarCodeTemp = BarCodeTemp + Chr(CheckDigit) For i = 1 To Len(BarCodeTemp) SingleByte = Asc(Mid(BarCodeTemp, i, 1)) If SingleByte =0 Then BarCodeOutput = Chr(0) ElseIf SingleByte > 0 And SingleByte < 94 Then BarCodeOutput = BarCodeOutput + Chr(SingleByte + 32) Else BarCodeOutput = BarCodeOutput + Chr(SingleByte + 103) End If Next Return "µ"+ BarCodeOutput + Chr(196) End Function
For Code128 B:
Public Function GetBarCodeOutput(ByVal inputValue As String) As String Dim CheckDigit As Integer = 0 Dim i As Integer = 0 Dim BarCodeOutput As String = "" Dim BarCodeInput As String Dim BarCodeTemp As String = "" Dim SingleByte As Integer = 0 BarCodeInput = inputValue.ToUpper() For i = 1 To Len(BarCodeInput) SingleByte = Asc(Mid(BarCodeInput, i,1)) BarCodeTemp = BarCodeTemp + Chr(SingleByte - 32) Next CheckDigit = 1 For i = 1 To Len(BarCodeTemp) SingleByte = Asc(Mid(BarCodeTemp, i,1)) CheckDigit = (CheckDigit + (SingleByte * i)) Mod 103 Next BarCodeTemp = BarCodeTemp + Chr(CheckDigit) For i = 1 To Len(BarCodeTemp) SingleByte = Asc(Mid(BarCodeTemp, i, 1)) If SingleByte =0 Then BarCodeOutput = Chr(0) ElseIf SingleByte > 0 And SingleByte < 94 Then BarCodeOutput = BarCodeOutput + Chr(SingleByte + 32) Else BarCodeOutput = BarCodeOutput + Chr(SingleByte + 103) End If Next Return "¶"+ BarCodeOutput + Chr(196) End Function
="*" & Replace(UCase(Trim(Fields!item.Value))," ", "_") & "*"
In this example, Trim(Fields!item.Value) is a database field that is replaced with a barcode. Reports can also include formulas for stored procedures
=Code.GetBarCodeOutput(FieldValue)
where FieldValue is the database field or stored procedure field that is replaced with a barcode, for example:
=Code.GetBarCodeOutput(Trim(Fields!item.Value))