Monday, 5 May 2014

How to Design Reports for Printing Bar Codes

Barcode Overview
The barcode that was selected to be supported for OneWorld was BC C39 3 to 1 Medium. The basis for the selection was that there was a greater requirement for it from the customers.
What does BC C39 3 to 1 Medium stand for ?
3 to 1 – 3 to 1 implies that the width of the wide element in the 3 to 1 ratio barcode fonts are 3 times the width of the narrow elements.
Medium – the width of a single character is 65% its height.

Barcode Printer
Initially a Barcode Printer must be setup within OneWorld®. Please note before printing to either a PostScript or PCL printer the printer font name and true type font name need to be tied together with the physical printer in the Bar Code Support application. Please refer to the System Administration publication, and the section Printing OneWorld® Reports, Setting up a OneWorld® Printer to Use a Barcode Font for printer setup. Another help setup document is How to Print Bar Codes within OneWorld®.

Report Design
You may want to refer to the Enterprise Report Writing Publication and Working with Barcodes under the Advanced Reports Enhancements section.
Some important steps to follow are:
  1. Launch the Report Design Aid (RDA) Tool for your report
  2. Select the section where you wish to place the barcode
  3. From the Insert menu, choose Constant Field, place the constant within the section
  4. Double click on the new constant to launch the properties window.
Change the Font to BC C39 3 to 1 (Note: if this is not available in the list, please contact your System Administrator to load C39m3.ttf into your local WINNT\Fonts folder and the B7\system\Resource\truetype folder)
  1. A barcode constant variable can be loaded in 2 ways as discussed in the following two scenarios:
Scenario 1:
If the barcode will always hold the same value, then you only need to enter the value into the Name for the Constant Properties. This value MUST be surrounded by asterisks to let the scanner know when to start and stop. Please see the following section about Barcodes and encoding characters.
Scenario 2:
If the barcode will change from row to row, then leave the Name for the Constant Properties as provided by the Tool or change it to be identifiable to the developer, but do NOT surround it by asterisks. Within the Do Section Event Rules for the section, use an assignment statement and assign the Constant variable the appropriate value. This value must be surrounded by asterisks to let the scanner know when to start and stop. If the value is a variable then you can use the concatenate string system function within the event rules to surround the value within the variable by asterisks.
Example:
RC Constant 000018 = concat([RC Constant 000018],"*")
RC Constant 000018 = concat("*", [RC Constant 000018])

Encoding: Programming a Barcode String
If you are using utilizing Scenario 1 above and your barcode is manually assigned then you must encode it (or program it) specifically for Extended Code 39. The Code 39 barcode consist of three segments and an area of white space before and after the barcode symbol.
The three segments are:
1. A start code ( * ).
2. The character string to be mapped to the barcode string.
3. A stop code ( * ).
For example to encode the string - ABCD1234 in Code 39, just add an asterisk to the beginning and end of the string so the result should be - *ABCD1234* and place this in the Name for the Constant Properties. Or to substitute with a Character as found in the chart below then substitute with the Barcode Characters column shown. For example to encode !"#$%&-. then place */A/B/C/D/E/F-.* in the Name for the Constant Properties.
The following table provides a chart of the supported Code 39 characters.


No comments:

Post a Comment