IDAutomation.com, Inc. IDAutomation.com, Inc.
Tutorial

Native Crystal Reports Generator Tutorial

The Barcode Integration Tutorial: copy the object into your report, set DataToEncode and verify.

The Crystal UFL is considered legacy. Use the Font Formulas when using a font, or the Native Crystal Reports Generator.

Barcode integration tutorial

  1. Extract the package files and open the report for the needed barcode type.

    Code 128 Auto (IDAutomation Native - Code 128 Auto.rpt) is the recommended default.

  2. Switch to Design view and locate the generator object in the Details section.

    Copy the object with Edit - Copy or by right-clicking it and choosing Copy. For GS1 text interpretation, copy the related text object too.

    Locate the Native Barcode Generator object within the details section of the report in SAP Crystal Reports
    Copy the Native Barcode Generator object using the Edit menu in SAP Crystal Reports
  3. Paste the object into the target report, then open Edit Formula.

    Rename the formula if multiple barcodes share a report. GS1 barcodes paste with their text interpretation object, which displays the human readable text.

    Paste the Native Barcode Generator object and the GS1-128 text object into the Details section of the report
    Right-click the barcode field and choose Edit Formula
    GS1 QR Code with human readable text (01)34567890123457 and (17)991231 in IDAutomation Native GS1-QRCode with HRI.rpt in Crystal Reports
  4. Set DataToEncode to the data.

    Optionally adjust the parameters below it. For linear barcodes, enlarge the object when increasing BarHeight. If you see "A string is required", wrap the field with cStr.

    Crystal Reports Formula Workshop with the IDAutomation_C128 formula, where the DataToEncode line is modified to the data to be encoded in the barcode
  5. Set the font point size.

    It is usually 3 to 4 for Courier New. The font must be a mono-spaced Unicode font. Check object sizing, LEFT justification and non-bold text.

    The font selected for the object must be a mono-spaced Unicode font such as Courier New, set to a size of 3 in the Format Editor
  6. Run the report and check the symbol fits its object.

    Distortion appears when the symbol exceeds the object containing it.

    Distortion may appear if the barcode symbol is larger than the Crystal Reports object containing it
  7. Remove white lines on screen.

    Adjust the point size, and set the paragraph line spacing as described in the troubleshooting section. Printed output is the accurate measure.

    Crystal Reports paragraph settings with line spacing set to 0.9 times normal and Can Grow disabled, used to remove white lines in a QR Code symbol
  8. Print and verify scannability.

    Verify GS1, ASCII and UTF-8 encoding with the Barcode Decoder Verification App (opens in a new tab).

Formula syntax

Common DataToEncode formats from the user manual.

DataToEncode = cStr( {Table1_.FloatValueField},0 )
DataToEncode = "StaticData" & Chr(13) & ({Table.Field})
DataToEncode = "|SellerName|VNumber|DateTime|Total|VTotal"
' linear height: Inches = Font Size x BarHeight x 0.015   CM = Font Size x BarHeight x 0.04

Tilde and ASCII codes

Tilde and ASCII codes
Tilde codePurpose
~202FNC1 in Code 128
~1FNC1 in Data Matrix and QR Code
~d???ASCII in Data Matrix and QR Code (three-digit code)
~m??MOD10 check character (GS1)
~f??MOD43 check character (HIBC)
~COCenter Override in QR Code

Tilde processing is enabled with ApplyTilde or ProcessTilde. Chr() codes: 13 return, 9 tab, 30 RS, 29 GS, 4 EOT.

Common parameters and sizes

Linear bar height is set in 0.015 inch increments. 2D matrix symbols (Data Matrix and QR Code) have double the X dimension at a given point size.

  • DataToEncode, BarHeight, N_Dimension, IncludeCheckDigit and ApplyTilde
  • QR Code: Version, EncMode and ErrorCorrectionLevel
  • PDF417: EccLevel, ColumnSpecify, RowSpecify and PDFTruncate
  • Data Matrix: PreferredFormat and EncodingMode
Point size chart showing the X dimension in mils for each font point size used with the Native Crystal Reports Barcode Generator

Using Visual Studio?

The generator also works in ASP.NET Crystal Reports projects.

VISUAL STUDIO