Barcode Tools for Crystal Reports > Font barcodes > Creating a font barcode on a report

Step 4

Now enter the formula, such as
DLUnibar ({Customer.Postal Code},"9","0")

 

 

[For CR 8.5

1. Open the report in Design view

2. Select Field Object from the Insert menu

3. Right click on the object and choose Format Template Field

4. Select the Formula Fields item in the dialog box; ensure that the item becomes highlighted.

5. Either hold down the Control key and press N, or select the New icon in the toolbar.

6. Enter a name for the formula - such as barcode1 - then push the OK button. The Formula Editor appears.

7. From the list of Functions (normally the middle list) scroll down to the Additional Functions item; then expand this item by click on the + symbol alongside the Additional Items name.

8. Select the DLUnibar function from the list, then either double click on it or press the Enter key; the function then appears in the formula box below the lists, complete with its parameter brackets and commas, and the cursor in the position of the first parameter. ie.

DLUnibar (,,)

8. Complete the formula by changing it to
DLUnibar ({Customer.Postal Code},"9","0")

]

The first parameter in the DLUnibar function must be a string containing the barcode data. This can be a literal string (ie. data enclosed in quotation marks, such as "1234"), or field data. If field data is to be used it must be text data - so if the required field actually contains numeric data this must be converted into text data.

If a required data field contains text data just double click on the field name in the list of Report Fields, and the field name enclosed in curly brackets will be copied to the function's first parameter position. eg.

DLUnibar ({Customer.Region},,)

If a required field contains numeric data then expand the Strings item in the list of functions and the expand the ToText function; Now select the required function - which will usually be ToText(x,y,z) where the x represent the number to be used as data, y represent the number of decimal places (typically 0) and z is a character used to separate thousands from hundreds etc (which unfortunately defaults to a comma and is generally not wanted in a barcode). Double click on the required version of the ToText function and this will be copied to the first parameter position of the DLUnibar function, with the cursor now placed in the first parameter position of the ToText function, ie.

DLUnibar (ToText (, , ),,)

Now double click on the required data source field in the list of Report fields, eg.

DLUnibar (ToText ({Orders.Order ID}, , ),,)

and fill in the other two ToText parameters with a 0 (the number of decimal places) and a NULL character (two single quotes) respectively, ie.

DLUnibar (ToText ({Orders.Order ID},0 ,'' ),,)

The second parameter of the DLUnibar function represents the type of the barcode to be created. This value (shown in the Barcode Types Table in the Appendix) must be enclosed in double quotation marks.

The final parameter is a flags value (normally a 0 – details are in the Barcodes Help file), also within quotation marks eg.

DLUnibar (ToText ({Orders.Order ID},0 ,' '),"8","0")

 

More:

Step 5