Generate Code 128 barcodes

Generate Code 128 Barcode in Crystal Reports

How to generate a Code 128 barcode in Crystal Reports?

To generate a Code 128 barcode in Crystal Reports, create a new formula field using the BCSLinearCode128 function from the Barcodesoft UFL library. Pass your database fields as arguments, place the formula field on your design canvas, and apply the Code128MHr font family.

  1. Step 1: Determine SAP Crystal Reports Bitness and Register DLL

    Determine the bitness of your SAP Crystal Reports version. SAP Crystal Reports 2008 through 2016 are 32-bit, while SAP Crystal Reports 2020 and 2025 are 64-bit.

    For 64-bit Crystal Reports (2020 / 2025):

    Run Command Prompt as Administrator and execute:

    cd "C:\Program Files\Common Files\Barcodesoft\FontUtil"
    %systemroot%\System32\regsvr32.exe cruflbcs_x64.dll
    Registering 64-bit cruflbcs_x64.dll via Administrator Command Prompt

    For 32-bit Crystal Reports (2008–2016):

    Run Command Prompt as Administrator and execute:

    cd "C:\Program Files\Common Files\Barcodesoft\FontUtil"
    regsvr32.exe cruflbcs.dll
    Registering 32-bit cruflbcs.dll via Administrator Command Prompt
  2. Step 2: Create a New Code 128 Formula Field

    Open your Crystal Report layout. Right-click Formula Fields in the Field Explorer pane and select New... from the context menu. Type "code128" in the Name textbox, then click the Use Editor button.

    Creating a new Crystal Reports formula field named code128
  3. Step 3: Locate the Barcodesoft Code 128 Function

    In the Formula Workshop, navigate to the Additional Functions directory and double-click the BCSLinearcode128 function listing located under the Visual Basic UFLs node.

    Selecting BCSLinearcode128 from the Visual Basic UFLs list inside the Formula Workshop
  4. Step 4: Use Your Database Field as a Parameter

    Provide your target database field as the primary string parameter inside the formula brackets. Click the Save button to validate and preserve your new formula logic configuration.

  5. Step 5: Insert code 128 Formula Field Into Your Report Canvas

    Drag your newly saved code128 formula field out of the Field Explorer and drop it onto the design view grid canvas area where you want the barcode to appear.

    Placing the code128 formula field onto the Crystal Reports report design canvas
  6. Step 6: Apply the Code128MHr Font Typeface

    Right-click the placed formula text block object on your canvas and choose Format Field from the context menu. In the Font customization tab pane, select "code128mHr" from the font family drop-down menu selection list.

    Changing the font typeface selection settings to code128mHr in Format Field window
  7. Step 7: Verify Code 128 Barcode Generation

    Click the OK button to apply changes. The text string placeholders will immediately transform and render as an active, readable Code 128 linear barcode inside your report template preview layout.

    Successful generation and visual verification of Code 128 barcode layout in Crystal Reports