Any database field can be printed automatically as any type of bar code, anywhere in your reports.
- Choose menu Tools | Macro and enter a Macro Name. For example, enter ClientNoBarcode.
- Click New.
In the Edit Macro dialog box the default macro appears;
- Edit this macro to look like the code below.
Replace FieldName with the name of the field you want to bar code.
Replace BarCodeType with the type of bar code you want. See Specifying a bar code type for more details. For example, to produce a Code 128 bar codes use C128-0.BA.
Replace DisplayErrors with 1 to display any error messages in a message box. Use 0 to disable error messages.
ClientNoBarcode = BCP("FieldName", "BarCodeType", DisplayErrors)
For example, to print field ClientNo as a Code 128 bar code and to disable error messages;
ClientNoBarcode = BCP("ClientNo", "C128-0.BA", 0)
- Click the Test button and you should see Macro source code compile successful. Click OK.
- Click Save to save your macro, if you want to use it in other reports.
In other reports you can reuse the macro by loading it.
- Choose menu Tools | Derived Fields and enter a Derived Field Name. For example, enter ClientNoBarcode.
- Click the Derived by ReportBasic Macro check box. Click Add.
- In the Choose A Macro dialog box select your macro. For example, select ClientNoBarcode.
- Click the Derived by Report Macro check box. Click OK.
- Click Done.
- Choose menu Insert | Field.
- To list derived fields select Derived Fields in the dropdown box.
- Drag your derived field to your report. For example, drag ClientNoBarcode.
- Select the field
- Right-click it to bring up the properties box
- Select the font name and font size. See Bar code font name and font size to use for more details.
If you make fields too small bar codes could accidentally be clipped. To avoid this;Label Reports - size fields as wide as possible, up to the right side of the label.
Form Reports - size fields as wide as possible, up to the right margin.Column Reports - size the fields as wide as possible. You may find it useful to print bar codes in the last column and use all remaining space, up to the right margin.
Copyright © 2000 CIA (BAR CODES) UK. All rights reserved. Reproduction prohibited.