Java Barcode How-Tos


Home > Java Barcode Generator > Java Barcode Generation Guide > Java Barcode Generator for iReport


How to Insert Barcode Images in iReport using Barcode for Java?

BarcodeLib.com Java Barcode Generator is the FIRST Commercial Java Barcode Library Supports iReport.
We are using latest iReport-3.5.3 to test our Barcode for Java library. If developer find any problem with previous version of iReport, please send email to support@barcodelib.com.

Java Barcode Generator Library

QR Code, Data Matrix, Code 128, GS1, EAN/UPC. ASCII, Unicode encode in Java, Servlet, Spring web, desktop application.

Download Now
Java 4+
BIRT, JasperReports report supported




How to Generate Barcode Images in iReport?
  1. Create a new report.
  2. Add barcode.jar to report classpath.
    Select menu "Tools", "Options", then select "classpath" tab. add barcode.jar to the classpath.
  3. Drag an image item in Palette to report.
  4. Click "Cancel" button, in "Select an image file" window.
  5. Select the image item, and edit it's properties.
    Set property "Expression Class" to "net.sf.jasperreports.engine.JRRenderable";
    Set property "Image Expression" to "new com.barcodelib.barcode.BarcodeJasperRenderer(com.barcodelib.barcode.BarcodeJasperFactory.createDataMatrix("123456789", 0, 0, 5))";


  6. You can preview the data matrix barcode in your report.
How to Generate Barcode Images using Data from Database?
  1. Define your data fields in report template.
  2. Set property "Image Expression" to "new com.barcodelib.barcode.BarcodeJasperRenderer(com.barcodelib.barcode.BarcodeJasperFactory.createLinear(22, $F{Your_Data_Field_Name}))";