Home:  Products:  Barcode Fonts:  Font Tools:  Business Objects® Crystal Reports Barcode UFL:

Crystal Reports Barcode Font Tutorial

Crystal Reports Barcode Font UFL

Function List | Support | Native Crystal Barcode Generator | Font Formulas | Integration Guide | Barcode Fonts

 Crystal Reports Barcode UFL Tutorial

The Crystal Reports Barcode UFL is the easiest product to use when creating barcodes in reports. However, if reports are to be distributed, IDAutomation recommends the Native Crystal Reports Barcode Generator, which allows embedded distribution without any required fonts, UFLs or plug-ins.

This UFL supports many linear barcode types including Code-128, GS1-128, Code-39, Interleaved 2 of 5, Code-93, UPC, EAN, Postnet and Intelligent Mail. GS1 DataBar and advanced 2D barcodes such as Aztec, DataMatrix, PDF417 and QR-Code must use the UFL supplied with that product.

“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

Easy Barcode Tutorial for Crystal 12 and greater:

New functionality introduced in Crystal Reports version 12 makes it easy to turn fields into barcodes. When using Crystal versions below 12, the standard UFL tutorial must be followed.

  1. Install the appropriate barcode fonts. If in doubt about which font to use, IDAutomation recommends the Universal Barcode Font.
  2. Download and install the latest version of IDAutomation's Crystal Reports UFL. Only the latest version released in March 2008 is compatible with the new "change to barcode" functionality introduced in Crystal Reports 12.
  3. Add a field to the report that contains only the data that is to be encoded in the barcode. If necessary, a formula field may be created to append text or concatenate fields.
  4. Select the Preview tab (or File - Print Preview) to ensure the correct data appears in the field.
  5. Right-click on this field, choose "Change To Barcode" and select from the list of installed barcode fonts, the type of barcode to create.
    Crystal Reports 12 Change To Barcode
  6. The barcode should be instantly created in the report. To create a text interpretation, simply add the same field to the report again and position it below the barcode as necessary.
  7. Print one page of the report and test with a barcode scanner. IDAutomation suggests testing with the IDAutomation USB Barcode Scanner, which scans all popular linear, GS1 DataBar and PDF417 barcodes. When 2D Data Matrix, QR Code, Aztec or Intelligent Mail symbols need to be verified, IDAutomation suggests the 4600G 2D Imager with PQA.

Barcode UFL Tutorial for Crystal Reports Versions 7 to 11:

  1. Install the appropriate barcode fonts. If there is a doubt as to which font to use, IDAutomation recommends the Code 128 Barcode Font Advantage Package. When using Code 128 or Interleaved 2 of 5, if the character set is not US English, 1252 Latin-1, 1250 European, 1251 Cyrillic, 1253 Greek, 1254 Turkish, 1255 Hebrew or 1256 Arabic, the Universal Barcode Font Advantage™ must be used. This example uses the Code 128 Barcode Font Advantage Package. Some font packages also include Font Formulas, which allow the font formatting routines to be embedded in a report without the need for a UFL.
  2. Download IDAutomation's Crystal Reports UFL and install it. After installing the UFL, the barcode functions should show up under Additional Functions in the formula editor. For backward compatibility with formulas of previous reports, IDAutomation also provides the previously released COM based Crystal UFL. If the earlier version of the UFL is used, refer to the documentation in that package.
  3. Choose the Design tab to enter the design mode of the report.
  4. Open the Field Explorer. In version 9, choose View - Field Explorer. In versions prior to 9, choose Insert - Formula Field.
  5. Right click on Formula Fields and select New.
  6. In the Formula Name dialog box, enter a name to identify the formula field. This can be any name, for example, "Code128Barcode." In this example, the formula is simply named "Barcode."
    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". 
  7. Click OK and select Use Editor if asked. The Formula Editor should now be open.
  8. In the Functions Column, expand Additional Functions and expand the IDAutomation section. From the list provided, choose the appropriate function. If the IDAutomation functions do not show up in the Additional Functions section after installing the UFL, copy the U25IDAutomation.dll file from the Windows System directory (for example C:\Windows\System32) to the directory where the Crystal DLLs are located. In Crystal 11, the file may be copied to C:\Program Files\Common Files\Business Objects\3.0\bin; in Crystal 10 and previous versions, the file may be copied to %Windows%\Crystal where %Windows% is the directory where Windows is installed.
  9. Make sure the function utilized matches the font listed in the "font to use" column. As an example, only use the IDAutomation_Code128() function with the IDAutomationC128 Font.
  10. With the cursor in between the parentheses of the function, select the data field that is to be encoded. Data fields used in this formula must be formatted as text. If the data fields are not text, use ToText for conversion. The syntax of the formula should look similar to the formula below which formats Field1 of Table1 to a Code 128 barcode font. IDAutomation_Code128 ({Table1.Field1}) or IDAutomation_Code128 (ToText( {Table1.Field1} ) )
  11. Choose Save and then Close. If an error such as "A string is required" appears, convert the data to text with the ToText function. For example: IDAutomation_Code128 (ToText( {Customers.CustNum} ) )
  12. To include a text interpretation of what is being encoded below the barcode; it is recommended to create an additional formula. In this example, the formula is named BarcodeHR to return the "human readable" text for Table1.Field1:
    {Table1.Field1}
    When creating GS1-128 (UCC/EAN) barcodes which require specific text interpretations, the appropriate HR function may be used for that purpose. For example, to display the text for a GS1-128 barcode, BarcodeHR is created with a different formula to return the formatted text from Table1.Field1: IDAutomation_Code128HumanReadable ({Table1.Field1})
  13. Return to the Field Explorer dialog box.
  14. Click on the formula field and drag it onto the report.
    Click on the formula field and drag it onto your report.
  15. Now that the fields have been created in the Crystal Report, choose the Preview tab to make sure the data is being retrieved from the fields and properly formatted to the barcode font. Strange characters will append to the beginning and ending of the data from the fields, which are required for the start and stop characters in the barcode. Additional formatting may also be necessary that scrambles the data; this is normal for Code 128, Interleaved 2 of 5 and all functions in the Universal Barcode Font. The graphic below in this tutorial shows the first field produced by the @Barcode formula and the second produced by the @BarcodeHR formula.
    Choose the Preview tab to make sure the data is being pulled from the fields and properly formatted to the barcode font.
  16. Choose the Design tab again and size the barcode formula field to display the appropriate barcode font in the report.
  17. Change the font of the formula field to be the appropriate barcode font and set the point size to 12 points or another appropriate size. Ensure the formula used matches the font listed in the "font to use" column. This is a very important step; if this is not correct, barcodes will not be properly created.
    NOTE: When selecting the font from the pull down menu, please do not use the fonts that begin with the "@" Symbol. Instead, scroll down in the list and select fonts that begin with "IDAutomation.
  18. Select the Preview tab (or File - Print Preview) to view the barcodes in the report. Print one page of the report and test with a scanner. IDAutomation suggests testing with the easy-to-use IDAutomation USB Barcode Scanner, which scans all popular linear, GS1 DataBar and PDF417 barcodes. When 2D Data Matrix, QR Code, Aztec or Intelligent Mail symbols need to be verified, IDAutomation suggests the 4600G Hand Held Products Imager.
    When you choose the Preview tab you should see your barcodes in the report.

 Creating Formulas to Combine Multiple Fields or Encode Functions:

It is easy to combine multiple fields, append text and/or place functions (such as a tab or return) in a single barcode when using Code 128 or 2D barcodes in a report. For example, the following formula appends the text "ECC200", combines two fields in a single barcode and places a tab function between them:
IDAutomation_Code128ApplyTilde ( "ECC200" & {Table1.DataField1} & "~009" & {Table1.UPC})

 Support:

Free product support may be obtained by reviewing articles that are documented at the IDAutomation's Barcode Font Support Site and by searching the resolved public help desk issues. Priority phone, email and help desk support is also provided up to 30 days after purchase. Additional priority phone, email and help desk support may be obtained if the Priority Support and Upgrade Subscription is active. For assistance with other Crystal reports issues refer to Crystal Reports Support Site.

 Font Formulas:

Many of IDAutomation's font packages include Font Formulas, which allow the font formatting routines to be embedded in a report without the need for a UFL. These formulas are saved as part of the report file (.rpt) and do not have any external dependencies (with the exception of the required barcode font). When distributing reports, IDAutomation suggests using this method or implementation of the Native Barcode Generator for Crystal Reports, which creates dynamic embedded barcodes without the installation of any barcode fonts or components.

 Distributing IDAutomation's UFL and Fonts with Crystal Runtime Files

If the report is being distributed, it is recommended that IDAutomation's Native Barcode Generator be considered which allows for distribution of a Crystal report without the need for any additional fonts, UFLs or plug-ins. Additionally, IDAutomation Formulas for Crystal Reports only require the applicable barcode font to be installed.

IDAutomation's UFL is free to use and distribute with the application if one of IDAutomation's licensed barcode fonts has been purchased. The following is a list of runtime files that should be distributed with the application:

Crystal Reports UFL Files to Distribute
(IDAutomation recommends using an advanced installation application to distribute files for Windows)
Purpose of File File to Distribute Notes
Font File(s) ???.ttf The TrueType barcode fonts. Font files may be distributed only if a Developer License has been purchased.
Crystal UFL U25IDAutomation.dll The IDAutomation Crystal UFL. It should be installed in the Windows System directory (for example C:\Windows\System32).

 UFL Barcode Function List:

The functions listed below are available in IDAutomation's UFL and are only valid when used with the barcode font listed in the "font to use" column. All the functions listed below are preceded with IDAutomation_. Functions beginning with IDAutomation_Uni_ are only to be used with the IDAutomation Universal Barcode Font Advantage™. The data input type for all functions is a single string.

Function Name Font to Use Notes
Functions in this section are all preceded with IDAutomation_
Code128(DataToEncode) IDAutomationC128 The "Code 128 Auto" function will automatically encode any data from ASCII 1 to ASCII 127 and format the output to the Code 128 barcode fonts. It will automatically switch to character set C to encode numbers as necessary.
To encode alpha-numeric GS1-128 or UCC/EAN-128, ASCII 202 or character Ê is entered as the FNC1 before each AI. When any barcode begins with the FNC1, it automatically starts in Set C as required.
For example, the UCC number of (8100)712345(21)12WH5678 should be entered as a formula of:
IDAutomation_Code128 ("Ê8100712345Ê2112WH5678")
or
IDAutomation_Code128 ("Ê" &
{Table1.DataField1} & "Ê" & {Table1.DataField2})
More information about AIs and GS1-128.
Code128ApplyTilde (DataToEncode) IDAutomationC128 The ApplyTilde function allows encoding of ASCII characters with the format of ~ddd to specify the ASCII code of the character to be encoded. It may also be used to calculate the MOD 10 for UCC and EAN barcodes according to IDAutomation's Code128 Barcode FAQ. The following example formats output to the Code 128 barcode fonts for GS1-128:
IDAutomation_Code128ApplyTilde ("~202" & "912312214123442441134" & "~m19" )
Code128Human
Readable (
DataToEncode)
Text font If Code 128 barcodes are being created which need the text formatted, this function may be used. It is generally used to format the text for UCC/EAN barcodes according to IDAutomation's Code128 Barcode FAQ. For example:
IDAutomation_Code128HumanReadable ("Ê" & "8100712345" & "Ê" & "2112345678" )
Code128Human
ReadableTilde (
DataToEncode)
Text font If Code 128 barcodes are being created which need the text formatted, this function may be used. It is generally used to format the text for the MOD 10 Check Digit or UCC/EAN barcodes according to IDAutomation's Code128 Barcode FAQ. For example:
IDAutomation_Code128HumanReadableTilde ("~202" & "912312214123442441134" & "~m19" )
Code128A (DataToEncode) IDAutomationC128 Formats output to set A of the Code 128 barcode fonts. Use caution with this option because any lowercase character creates a function. Use the letter "i" for a tab and "m" for a return.
Code128B (DataToEncode) IDAutomationC128 Formats output to the Code 128 fonts, character set B. For most purposes, it is better to use the Code128() function instead of this one.
Code128C (DataToEncode) IDAutomationC128 The code128 function "interleaves" numbers into pairs for high density to the Code 128 barcode fonts. An even number of digits is required. For most purposes, it is better to use the Code128() function instead of this one.
Code39(DataToEncode) IDAutomationC39
or
IDAutomationHC39
Formats the output to print using Code 39 fonts. Commonly used when the data to encode contains a space; this function will assign the space character to the equal sign for proper printing.
Code39Mod43 (DataToEncode) IDAutomationC39
or
IDAutomationHC39
Performs the mod43 checksum calculation for increased accuracy and then formats the output to print using Code 39 fonts. The mod43 checksum is usually required for DOD and LOGMARS applications. This function will also assign the space character to the equal sign for proper printing.
Code93(DataToEncode) IDAutomationC93 Formats the output to print with the 2 required check digits using Code 93 fonts.
EAN13(DataToEncode) IDAutomationUPCEAN Formats a number string of 12, 13, 14, 15, 17 or 18 digits with or without a check digit; add-ons are supported. Formats output to the UPC/EAN barcode font. Entering incorrect data will create a barcode containing all zeros.
EAN8(DataToEncode) IDAutomationUPCEAN Formats a number string of 7 or 8 characters (EAN-8 without the check digit). Formats output to the UPC/EAN barcode font. Entering incorrect data will create a barcode containing all zeros.
I2of5(DataToEncode) IDAutomationI25
or
IDAutomationHI25
This function "interleaves" numbers into pairs for high density without check digits and formats the return string to the Interleaved 2 of 5 fonts. An even number of digits are required.
I2of5Mod10 (DataToEncode) IDAutomationI25
or
IDAutomationHI25
This function performs the mod10 checksum calculation for increased accuracy and formats the return string to the Interleaved 2 of 5 fonts. MOD 10 checksums are required for SSC-14 when using Interleaved 2 of 5 for that purpose. An odd number of digits are required.
Postnet(DataToEncode) IDAutomationPOSTNET
or
IDAutomationPLANET
Enter a single string of Zip, Zip + 4 or Zip + 4 + Delivery Point. The input for Data must be a number and can include dashes and spaces. Formats output to the POSTNET or PLANET barcode fonts.
MSI(DataToEncode) IDAutomationMSI
or
IDAutomationHMSI
Formats output to the MSI barcode fonts and includes 1 MOD 10 check digit.
MOD10(DataToEncode) not applicable Data is a number string. A MOD 10 check digit is returned. This is useful in calculating check digits for UCC/EAN 128 barcodes where a MOD check digit is needed. More information about UCC/EAN-128 is located here.
SpliceText(DataToEncode, Optional SpacingNumber, Optional ApplyTilde) Text font Returns text with a space inserted every SpacingNumber of digits to improve readability. If ApplyTilde is set to True, the tilde will be processed as described here. ApplyTilde is False by default.
UCC128(DataToEncode) IDAutomationC128 This symbology option encodes an even number of number digits and includes the FNC1 character in set C as required. Use the UCC128 function for UCC-128 applications where the input data is an even number such as in SSCC-18 and SCC-14 barcodes. For example, to encode an SSCC-18 barcode, the user would enter 00000123455555555558 as the data input. For more information, please visit the UCC/EAN FAQ. Formats output to the Code 128 barcode fonts.
UPCa(DataToEncode) IDAutomationUPCEAN Formats a UPC-A number string of 11, 12, 13, 14, 16 or 17 digits with or without a check digit; add-ons are supported. Formats output to the UPC/EAN barcode font. Entering incorrect data will create a barcode containing all zeros.
UPCe(DataToEncode) IDAutomationUPCEAN Formats a UPC-A number string of 11, 12, 13, 14, 16 or 17 digits with or without a check digit; add-ons are supported. The purpose of this function is to print the UPC-E barcode from a UPC-A barcode that can be compressed. It will print a UPC-A if it cannot be compressed by zero suppression rules. Formats output to the UPC/EAN barcode font. Entering incorrect data will create a barcode containing "00005000000".
Functions that have changed with this release:
These functions are no longer provided and have been replaced by IDAutomation's
Code128ApplyTilde() function.
USPS_EAN128 (DataToEncode) IDAutomationC128 The USPS_EAN128 function is no longer provided because it has been replaced by IDAutomation's Code128ApplyTilde() function.
Used for 22 digit USPS special services labels, such as delivery confirmation in EAN128 according to the USPS Delivery Confirmation Service as defined in the September 2002 version of Publication 91. This is used with IDAutomation's Code 128 font IDAutomationC128L at 16 points. The following formula will create USPS_EAN128 in Code 128 with the Code128ApplyTilde() function:
IDAutomation_Code128ApplyTilde ("~202" & "912312214123442441134" & "~m19" )
Where the number of 912312214123442441134 may be replaced with the user's data field, for example:
IDAutomation_Code128ApplyTilde ("~202" &
{Table1.DataField1} & "~m19" )
This number encoded is made up of the following: 2 digit service code + 9 digit customer ID + 8 digit sequential package ID + MOD 10 check digit.
For more information, refer to the USPS portion of the Code 128 FAQ and the UCC/EAN portion of the Code128 Barcode FAQ.
SCC14(DataToEncode) IDAutomationC128 The SCC14 function is no longer provided because it has been replaced by IDAutomation's Code128ApplyTilde() function.
The following formula will create SCC14 in Code 128 with the Code128ApplyTilde() function:
IDAutomation_Code128ApplyTilde ("~202" & "013001234567890" & "~m13" )
For more information, refer to the UCC/EAN portion of IDAutomation's Code128 Barcode FAQ.
SSCC18(DataToEncode) IDAutomationC128 The SCC18 function is no longer provided because it has been replaced by IDAutomation's Code128ApplyTilde() function.
The following formula will create SCC18 in Code 128 with the Code128ApplyTilde() function:
IDAutomation_Code128ApplyTilde ("~202" & "0000801234999999999" & "~m17" )
For more information, refer to the UCC/EAN portion of IDAutomation's Code128 Barcode FAQ.
All the functions listed below are preceded with IDAutomation_Uni_ and are only to be used with the IDAutomation Universal Barcode Font Advantage
Functions in this section are all preceded with IDAutomation_Uni_
C128(DataToEncode, ApplyTilde) IDAutomation_Uni The "Code 128 Auto" function will automatically encode any data from ASCII 1 to ASCII 127. It will automatically switch to character set C to encode numbers as necessary. To encode alpha-numeric GS1-128 or UCC/EAN-128, ASCII 202 or character Ê is entered as the FNC1 before each AI. When any barcode begins with the FNC1, it automatically starts in Set C as required.
For example, the UCC number of (8100)712345(21)12WH5678 should be entered as a formula of:
IDAutomation_Uni_C128 ("Ê8100712345Ê2112WH5678", TRUE)
or
IDAutomation_Uni_C128 ("~202" &
{Table1.DataField1} & "~202" & {Table1.DataField2}, TRUE)
More information about AIs and UCC/EAN-128 is located here.

If ApplyTilde is set to True, the tilde will be processed. ApplyTilde is False by default in this function.

C128HR(DataToEncode, ApplyTilde) Text font If the user is creating Code 128 barcodes that need the text formatted, this function may be used. It is generally used to format the text for GS1-128 (UCC/EAN) barcodes according to IDAutomation's Code128 Barcode FAQ. For example:
IDAutomation_C128HR ("~202" & "8100712345" & "~202" & "2112345678"
, TRUE )

If ApplyTilde is set to True, the tilde will be processed. ApplyTilde is True by default in this function.

C128A(DataToEncode) IDAutomation_Uni Formats output to set A of Code-128. Use caution with this option because any lowercase character creates a function. Use the letter "i" for a tab and "m" for a return. For most purposes, it is better to use the C128() function instead of this one.
C128B(DataToEncode) IDAutomation_Uni Formats output to Code-128, character set B. For most purposes, it is better to use the C128() function instead of this one.
C128C(DataToEncode) IDAutomation_Uni This code128 function "interleaves" even numbers into pairs for high density. An even number of digits is required. For most purposes, it is better to use the C128() function instead of this one.
C39(DataToEncode, N_Dimension, IncludeCheckDigit) IDAutomation_Uni Formats the output for barcoding in Code 3 of 9 with the universal font. A MOD 43 checksum will be calculated if IncludeCheckDigit is true. For example: IDAutomation_Uni_C39 ("123456789", 3, TRUE )
Codabar(DataToEncode, N_Dimension, StartChar, StopChar) IDAutomation_Uni Creates Codabar (aka NW7) barcodes with the universal font. StartChar and StopChar are also required as the start and stop characters. Valid start and stop characters are A, B, C and D.
I2of5(DataToEncode, N_Dimension, IncludeCheckDigit) IDAutomation_Uni This function "interleaves" numbers into pairs for high density without check digits and formats the return string to the universal font. An even number of digits is required. A MOD 10 checksum will be calculated if IncludeCheckDigit is true.
MSI(DataToEncode, N_Dimension, IncludeCheckDigit) IDAutomation_Uni Formats output for barcoding in the MSI/Plessey barcode symbology. A MOD 10 checksum will be calculated if IncludeCheckDigit is true.
OneCode(DataToEncode) IDAutomation_Uni
or
IDAutomationPOSTNET
This function works with the IDAutomationPOSTNET font and the XS, S or M size of the Universal Font. DataToEncode is a single string according to the OneCode section of the USPS FAQ.
Planet(DataToEncode, IncludeCheckDigit) IDAutomation_Uni Because this barcode type has a specific height requirement, this function only works with the XS, S or M size of the Universal Font. XS is the normal version, S has the bars narrow by 10% and the M font has the bars narrow by 20%. DataToEncode is a single string of Zip, Zip + 4 or Zip + 4 + Delivery Point. A MOD 10 checksum will be calculated if IncludeCheckDigit is true.
Postnet(DataToEncode, IncludeCheckDigit) IDAutomation_Uni Because this barcode type has a specific height requirement, this function only works with the XS, S or M size of the Universal Font. XS is the normal version, S has the bars narrow by 10% and the M font has the bars narrow by 20%. DataToEncode is a single string of Zip, Zip + 4 or Zip + 4 + Delivery Point. A MOD 10 checksum will be calculated if IncludeCheckDigit is true.
UCC128(DataToEncode) IDAutomation_Uni This symbology option automatically encodes the FNC1 character in set C as required for UCC-128 barcodes. All functions of ApplyTilde are enabled in this function for calculating the required MOD 10 check digit and cannot be disabled, for example:
IDAutomation_Uni_C128 ("00000123455555555558"
& "~m19" ) For more information, please visit the UCC/EAN FAQ.
MODU10(DataToEncode) not applicable A MOD 10 check digit is returned. This is useful in calculating check digits for UCC/EAN 128 barcodes where a MOD check digit is needed. More information about UCC/EAN-128 is located here.

Description of the parts of the functions:


To sign up for monthly updates about new products or upgrades, please click here.Advanced GS1 DataBar and 2D Integration:

Related Information:

Overview of Bar-coding Options:

  1. The easiest product to use in versions 9 and above is IDAutomation's Native Barcode Generator for Crystal Reports, which creates barcodes without additional fonts or plug-ins. Tutorial...
  2. For support of many barcode types, IDAutomation's Barcode UFL for Crystal Reports is an easy to use plug-in. Tutorial...  Download now...
  3. For technical users, IDAutomation's IDAutomation Formulas for Crystal Reports allow distribution of a crystal report without the need for the Barcode UFL. Tutorial...
  4. For developers using Crystal 9 or above, Report Custom Functions can be created from IDAutomation's formulas and placed into the Repository of Custom Functions. For more information...
  5. For some double byte language settings such as Chinese, Korean and Japanese languages, use the IDAutomation Universal Barcode Font Advantage™ with IDAutomation's Barcode Crystal Reports UFL.
  6. When using Crystal Version XI and above, barcode images may be streamed from a server and dynamically placed in the report. This implementation does not require any fonts or software to be installed when using IDAutomation's hosted Dynamic Barcode Generator Service.

 

© Copyright 2000-2008 IDAutomation.com, Inc., All Rights Reserved.  Legal Notices.

Over 70% of Fortune 100 companies use IDAutomation's products to automate their businesses.