Our Customers
Contact Us Email: support@barcodelib.com
Home > Java Barcode Generator > Java Barcode Generation Guide > Java Barcode Generator for Eclipse BIRT
Download Barcode for Java Trial

How to Get Barcode Data from Database and Generate Barcode Images in BIRT Reports?

BarcodeLib.com is the FIRST Commercial Provider of Java Barcode Library that supports Eclipse BIRT.
We are using BIRT 2.2.2 to test our Barcode for Java library. If developer find any problem with previous version of BIRT, please send email to support@barcodelib.com.
How to Get Barcode Data from Database and Generate Barcode Images in BIRT Reports?
Let's say you want to display customers information (customer name, customer id) on the report. All the data stored in one table named "Customers", there are two columns inside: CUSTOMERNAME (string), CUSTOMERNUMBER (int). And you want to display CustomerId data in Code 39.
  1. Install Java barcode web application to your Java Servlet container like Tomcat, JBoss.
    • Under demo package, copy barcode folder to your java servlet container like tomcat.
    • To test your installation, go to: http://YourDomain:Port/barcode/linear?Data=123456789&Type=CODE39
    • To create barcode image in your JSP or html page, you can pass the url to IMG tag src value.
      For example, <img src="http://YourDomain:Port/barcode/linear?Data=123456789&Type=CODE39" />
  2. Create a new report, setup your data source and data set, and add "Table" report item to your report.
  3. Drag column "CUSTOMERNAME" to your first column of table details section, and drag an "Image" report item to your second column.
  4. On Edit Image Item, in Select Image from, select URI.
  5. Under Enter URI, choose the expression builder button.
    In the expression builder, keyin:
    "http://localhost:8088/barcode/linear?Data=" + row["CUSTOMERNUMBER"] + "&Type=CODE39"
  6. Click all "ok" buttons, ignore the warning message. You will see the report as:

  7. Go to "Preview".

Back to How to Insert Barcode Images into BIRT using Barcode for Java?

Back to Barcode for Java