Generate Data Matrix barcodes in Crystal Reports

Generate Data Matrix Barcode in Crystal Reports

1. Open your crystal report. Right click Formula Fields, choose "New..." from the context menu. Type in "BcsDataMatrix1" in the Name textbox, then click "Use Editor".

data matrix create formula crystal reports

After Data Matrix encoding process, even a short string might have much more code words than you expect.
While Crystal Reports allows no more than 255 characters in a formula field.
Therefore we have to split Data Matrix code words into separate parts, and concatenate them in a Text Object before apply font BcsDataMatrix.
As for how many formula fields are needed, you can find out by using the following function:


data matrix crystal reports ufl

2. Create multiple formula fields as listed below if returned value of BCSDatamatrixFormulaNoForCR({Test.Data}) is larger than one. Then put them in sequence within the same Text Object.

BCSDataMatrixEncodeCR({Test.Data}, 1, 0, 0, 0)
BCSDataMatrixEncodeCR({Test.Data}, 2, 0, 0, 0)
BCSDataMatrixEncodeCR({Test.Data}, 3, 0, 0, 0)

data matrix crystal reports ufl

The first parameter in the formula field is string to encode.
The second parameter in the formula field is index.

The third parameter of the formula is Format. Its values range between 0 and 30. When set to zero, it means auto-selected format.

The fourth parameter is Encodation method. Its values range between 1 and 6 which stand for the following encodation separately: ASCII, C40, TEXT, X12, EDIFACT, BASE256.

The fifth parameter is GS1 indicator. It is a Boolean indicating whether this is a GS1-compliant barcode. Set it to zero when this is not GS1-datamatrix compliant.

3. Insert a text object in your report. Drag and drop all your formula fields into this text object in sequence. You will see some hex codes in your report. Don't worry! You have NOT applied BCSDatamatrix font typeface yet.

data matrix crystal reports UFL

4. Right click Text Object and choose "Format Object" from context menu. Then choose "BcsDatamatrix" as font.

data matrix font crystal reports

5. Click OK button. You will get data matrix barcode in your report.

data matrix crystal reports

  • data matrix barcode download
  • data matrix barcode software order