To create your own barcode on a report follow the steps below:
1. Open the report in Design view
2. Select Field Object from the Insert menu
3. Select the Formula Fields item in the dialog box; ensure that the item becomes highlighted.
4. Either hold down the Control key and press N, or select the New icon in the toolbar.
5. Enter a name for the formula - such as barcode1 - then push the OK button. The Formula Editor appears.
6. From the list of Functions (normally the middle list) scroll down to the Additional Functions item; the expand this item by click on the + symbol alongside the Additional Items name.
7. Select the DLDmbars 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.
DLDmbars (,,)
8. The first parameter 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.
DLDmbars ({@address1&2},,)
If a required field contains numerical 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 DLDmbars function, with the cursor now placed in the first parameter position of the ToText function, ie.
DLDmbars (ToText (, , ),,)
Now double click on the required data source field in the list of Report fields, eg.
DLDmbars (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.
DLDmbars (ToText ({Orders.Order ID},0 ,'' ),,)
9. Now complete the other two DLDmbars parameters with the mode ( 0=square, 1=rectangular, 2=square GS1, 3=rectangular GS1) and security level parameters (see above for a complete list of these), both enclosed in quotation marks, eg.
DLDmbars (ToText ({Orders.Order ID},0 ,''),"0","0")
10. Now click on the Save and Close icon to return to the Field Explorer and the formula named by you will be present in the list. Double-click on the formula name the move the cursor to locate the object (ie. the barcode) where you want it on the report.
11. Finally select the barcode object, right click on it, choose Format Field from the drop down menu, and click on the Font tab in the displayed dialog box. From the list of fonts presented select the AZ.. font you require and select a suitable size (typically 4 - 10 point). The character spacing must be left at 0, otherwise the barcodes will look nice but wont scan. Then click on OK.
12 Return to the report's Preview display and you should have a perfect barcode. If you are using data from a database as the data source for the barcode, then the barcode will change as you navigate around the record source.
More: