Barcode UFL Plug-ins
Custom Functions/Formulas for Crystal Decisions Crystal Reports
Whether you are an end user or an advanced Crystal Reports developer,
we offer several methods of implementing barcodes in Crystal Reports to suit your
needs:
- For end users, our UFL (User Function Library) for Crystal
Reports an easy to install and use plug-in
- For technical users, our ID-Automation Formulas for Crystal
Reports allow distribution of a crystal report without the need for the Bar
Code UFL.
- For developers using Crystal 9 or above, Report Custom
Functions can be created from our formulas and placed into the Repository of
Custom Functions.
User Comment
“This is easily the best software I’ve found for
barcode printing in Crystal by a long way -- I must have downloaded 6 or 7 other
fonts and packages, but none are as easy to use as this.” Michael Ainley, IT Manager,
UK
Tutorial
s for creating bar codes in Crystal Reports:
In this tutorial, we describe a few methods of implementing barcodes
in Crystal Reports:
- If you are an end user or not highly technical, we suggest you follow our
Barcode UFL Tutorial.
- If you are distributing your report, we recommend the ID-Automation Formulas
for Crystal Reports Tutorial which allows distribution of a Crystal Report without
the need for the UFL, or any other DLLs.
Advanced 2D barcodes, such as PDF417 and DataMatrix, must use the UFL
supplied with that product. Formulas are not available for these barcodes, because
of their complexity.
Crystal Reports Barcode UFL
Tutorial
The Crystal Reports UFL is free to use as long as you are using it
with one of our licensed barcode fonts. This UFL is designed to work with Crystal
Reports 6.0 and above. It is also compatible with the version of Crystal Reports
that is distributed with Visual Studio .NET and the implementation is the same as
described in this tutorial. The UFL plug-in is supplied in an easy to install executable
file. Once installed, barcode functions appear in the formula editor. These functions
can be easily applied to fields on reports that require barcodes.
- Install the appropriate barcode fonts on your system. If you
are unsure of which you need, we recommend the Code 128 Font Advantage Package
because this barcode can encode numbers and letters, plus it is very compact.
This example uses Code 128. We also have a Complete TrueType Font package that
includes all linear barcode fonts.
- Download our Crystal Reports UFL and install it on your
system. After installing the UFL, the barcode functions should show up under
additional functions in the formula editor. Enter a database field name in the
formula text column to pass data to the appropriate barcode function. For example:
ID-AutomationFontEncoderUPCa({Table.Field}) or
ID-AutomationFontEncoderCode128({Table.Field},0)
A complete function list for use in formulas is provided below.
- Choose the Design tab to enter the design mode of the
report you need to add a barcode to.
- Open the Field Explorer. In version 9, choose View -
Field Explorer. In versions prior to 9, choose Insert
- Formula Field.
- Right click on Formula Fields and select New.
- In the Formula Name dialog box, enter the name you want to identify
the formula by. This can be any name, for example, "barcode1". In this example
we name the formula "Barcode".
- Click OK. The Formula Editor appears.
- In the Functions Column, choose the appropriate barcode formatting
function under the "Additional Functions" section. In version 9 and later, the
barcode functions show up under Additional Functions - Visual Basic UFLs.
- Then, with the cursor in between the parentheses of the function
(but before the comma if it exists), select the data field you wish to format.
Note that if your formula has a comma in it, you will need to place a zero after
the comma or enter the appropriate number for the way you want the function
to perform. The data fields used in this formula MUST be formatted as text,
if they are not you will have to use some type of conversion formula to convert
the data to text. The syntax of your formula should look similar to the image
below which formats DataField1 of Table1 to a Code 128 barcode
font.
- When the formula has the correct syntax, click save then
close. If you receive an error such as "A string is required", you will
need to convert your data to text with the ToText function. For example:
ID-AutomationFontEncoderCode128 (ToText( {Employee.EmployeeID} ) ,0)
- You may also wish to create other formulas to return the Human
Readable text if your function includes this option. In this example, we create
another formula and name it BarcodeHR. Then we enter the formula with the return
type of "1":
- Next, you should return to the Field Explorer dialog box.
- Click on the formula field and drag it onto your report.
- Now that we have the fields in the report, choose the Preview
tab to make sure the data is being pulled from the fields and properly formatted
to the barcode font. You should see that some strange characters have been appended
to the beginning and ending of the data from the fields - this is normal. Sometimes
the data has to be formatted so much it appears to be scrambled. This is normal
for Code 128 and Interleaved 2 of 5 when numbers need to be compressed within
the barcode. In the graphic below, the first string is produced by the @Barcode
formula and the second one is produced by the @BarcodeHR formula.
- Choose the Design tab again and size the Barcode formula
field to display the appropriate barcode font in the report.
- Change the font of the formula field to be the appropriate
barcode font and set the point size to match the specs of your scanner.
This is a very important step; if you do not do this, no barcodes can be displayed.
If you are unsure of the point size to use, try 14 or 16 points. UPC and EAN
fonts should be 22 points or greater.
NOTE: When selecting the font from the pull down menu, be sure not use
the fonts that begin with the "@" Symbol. Instead, scroll down in the
list and select the ones that begin with "ID-Automation".
- Now, when you choose the Preview tab (or File - Print
Preview) you should see your barcodes in the report.
- It is also possible to combine multiple fields and place functions
in a single barcode when using Code 128 in a report. For example, the following
formula combines two fields in a single barcode and places a tab function between
them:
ID-AutomationFontEncoderCode128 ({Table1.DataField1}
& CHR(9) & {Table1.UPC},0)
The following formula places a tab function and a return function after
the barcode:
ID-AutomationFontEncoderCode128 ({Table1.DataField1}
& CHR(9) & CHR(13), 0)
Use CHR(9) for tab and
CHR(13) for a return.
Special
!
Free Choice of
Complete Excel
Training Course
or
Excel Add-ins Collection
on all purchases totaling over $70.00. ALL purchases totaling over $150.00
gets you BOTH! Send payment proof to special@ozgrid.com 31 days after purchase
date. All purchases can be made via
Id-Automations site
See Also:
Barcodes
- Fonts,
ActiveX, labels and DLL's Index. Barcode
MICR CMC-7
|| Codabar Barcode
Font
|| Code 11 Barcode Font
|| Code 128 Barcode Font
||
Code 25 Barcode Font
||
Code 39 Barcode Font
||
Code 93 Barcode Font
||
Code39 Full ASCII Barcode Font
|| Data Matrix Encoder
||
Interleaved 25 Barcode Font
|| MICR E13B Font
||
MSI Barcode Font
||
OCR Font
||
PDF417 Encoder
||
Telepen Barcode Font
||
UPC EAN Barcode Font
Instant Download and Money Back Guarantee on Most Software
Excel Trader Package
Technical Analysis in Excel With $139.00 of FREE software!