Articles in this section

How to add 1D and 2D barcodes in Bold Reports React Report Designer

Published:
Updated:

To add barcodes in the Bold Reports React Report Designer, install the @boldreports/javascript-reporting-extensions package, import and register the EJBarcode (1D) and EJQRBarcode (2D) report items, then list them in the reportItemExtensions property. The designer then shows a Barcodes category you drag onto the report surface.

Applies to: Bold Reports Embedded Reporting — React Report Designer.

When to use this

Use this when you need scannable barcodes in RDL (Report Definition Language) reports — for product labels, inventory tracking, shipping, or QR-based workflows. After setup, you can bind a barcode to a dataset field so it changes per row at run time.

Steps

1. Install the extensions package

Run this in your project root:

npm install @boldreports/javascript-reporting-extensions

2. Import the barcode scripts and styles

Open src/App.js (or the file where the Report Designer component is defined) and add these imports at the top:

import '@boldreports/javascript-reporting-extensions/barcode.reportitem.css';
import { EJBarcode } from '@boldreports/javascript-reporting-extensions/barcode.reportitem';
import { EJQRBarcode } from '@boldreports/javascript-reporting-extensions/qrbarcode.reportitem';

3. Export the extension scripts

Open the installed package folder:

your-project/node_modules/@boldreports/javascript-reporting-extensions/

Add the export statement at the end of each file so the import above resolves.

barcode.reportitem.js

export { EJBarcode };

qrbarcode.reportitem.js

export { EJQRBarcode };

Edits inside node_modules are overwritten when the package is reinstalled. If you reinstall or run a clean CI build, reapply these exports or add a postinstall patch step.

4. Register the barcode components globally

In the same App.js file, register the components before defining your main component:

// Register barcodes globally
window.EJBarcode = EJBarcode;
window.EJQRBarcode = EJQRBarcode;

5. Configure the report item extensions in the designer

Update your BoldReportDesignerComponent:

function App() {
  const designerStyle = { width: '100%', height: '100vh' };

  return (
    <div style={designerStyle}>
      <BoldReportDesignerComponent
        id="reportdesigner_container"
        serviceUrl="https://<your-service-host>/api/ReportingAPI"  // replace with your service URL
        reportItemExtensions={[
          {
            name: 'barcode',
            className: 'EJBarcode',
            imageClass: 'customitem-barcode',
            displayName: '1D Barcode',
            category: 'Barcodes'
          },
          {
            name: 'matrixbarcode',
            className: 'EJQRBarcode',
            imageClass: 'customitem-qrbarcode',
            displayName: '2D Barcode (QR)',
            category: 'Barcodes'
          }
        ]}
      />
    </div>
  );
}

export default App;

6. Run and verify

  1. Save all files.
  2. Start your React application: npm start.
  3. Open the Report Designer.
  4. In the Items toolbox, confirm a new Barcodes category appears with 1D Barcode and 2D Barcode (QR).
  5. Drag a barcode item onto the report surface, set its Value property to a dataset field, and preview the report.

Barcode items shown under the Barcodes category in the React Report Designer toolbox

Result

The Barcodes category appears in the toolbox with the 1D and 2D items. When you drop a barcode, bind its Value, and preview, the designer renders a scannable barcode that updates per dataset row. The same barcode renders on export when the backing service has the barcode extension registered.

Download sample application

Download a ready-to-run React sample project with barcode support enabled from the barcode React sample project.

Troubleshooting

Barcode items do not appear in the toolbox

The scripts were not imported, the components were not registered on window, or the reportItemExtensions entries are missing. Recheck steps 2, 4, and 5, and confirm the className values are exactly EJBarcode and EJQRBarcode.

Barcodes show as blank or an error in preview and export

The client designer shows the item, but the reporting service behind serviceUrl cannot render it. Register the barcode extension on that service (for a .NET service, add the BoldReports.CRI.Barcode assembly and register it in Application_Start), then retry.

Frequently asked questions

Which barcode symbologies are supported?

1D types include Code 39, Code 128, Codabar, UPCA, EAN-13, and EAN-8; 2D types include QR Code, DataMatrix, and PDF417. See the supported barcode types reference for the full list and valid input characters.

Can I bind a barcode to data?

Yes. Set the barcode’s Value (or Text) property to a dataset field or an expression such as =Fields!ProductID.Value, and the barcode encodes that value at run time.

Do I need both EJBarcode and EJQRBarcode?

Only register what you use. Keep EJBarcode for 1D (linear) barcodes and EJQRBarcode for 2D (QR) barcodes; you can register just one if that is all you need.

Why does the barcode render in the designer but not on export?

Export rendering happens on the reporting service, not the browser. The service must have the barcode extension registered, as noted in the prerequisites.

Related articles

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied