Wednesday, June 16, 2021

Maximo 7.6.x Barcode Generation in BIRT reports

What is Barcode ? 

A barcode, consists of bars and shapes of varying width, is a machine-readable form of alphanumeric characters that can be read with an optical barcode scanner. Barcodes are used for many applications across many Industries such as Manufacturing, Distribution, Retail, Food, Pharmaceutical, Transportation, Entertainment etc.,

Why Barcodes are needed in Maximo ?

Maximo is designed for managing assets in many industries where barcodes are used. One such use case is Spare parts management in Inventory. Stocks are scanned in front of the shelves (or bin) to enter actual balance of Inventory - it increases Inventory accuracy and Work efficiency. 

Maximo Product team don't support for any issues barcode in BIRT. So, we need to know the methods of generating barcodes for Maximo application.

Barcode Generation in BIRT Report

As Maximo uses BIRT for reporting, we will see on how barcodes can be displayed in a report. We have following methods of creating barcodes in BIRT report. 

  •         Barcodes using plugins
  •         Barcodes using ZXing API

Barcode by plugins

Plugins are provided by different vendors, available in BIRT marketplace. 

We need to place the barcode plugin jar files in this path <folder>\birt_431\eclipse\plugins to display an extension item for barcode in Report Item palette in Eclipse Report Designer. 



Preview Barcode in Eclipse
                    


For running the barcode report from Maximo application, we need to upload the plugin jar file in this installed path 

\IBM\SMP\maximo\applications\maximo\maximouiweb\webmodule\WEB-INF\birt\platform\plugins,

then build and deploy the EAR for making this report runtime generate barcode in browser. 


For development purpose, we used the trial version of the plugin, which will display the barcode with trial trademark.  Plugins for production are priced based on number of users.

Barcodes by ZXing API

Zxing (Zebra Crossing) - It’s open source API barcode image processing library implemented in Java. It supports one and two dimensional barcodes.

Download the zxing jars and add them to the Windows -> Preferences -> Report Design -> Classpath of report design.


The jars can be downloaded from git : jarsforzxingbarcode

Add a normal Image in the report design, right click on the Image -> click on Properties -> Edit. Choose the dynamic Image and Select Image Data from Container Data Set.



On the Data Binding of imgbar (BLOB), we write our code in Expression section for generating barcode in Image object.


You can modify the writer object to any format like Code39, QRCode etc., In this method of creating barcode, we don't need write any custom java code for deployment. It will be embedded in the report file and runs by the jars files in the Maximo libraries path. 

In order to make this report run from maximo application, we need to add the jars files in this Maximo installed path -
IBM\SMP\maximo\applications\maximo\maximouiweb\webmodule\WEB-INF\lib and proceed with deployment of EAR process.

Preview of report from Maximo application


Sample Report: inventory_barcode_zxing_mx76.rptdesign

References:

Fundamentals and Applications of Barcode Create Barcode Images Dynamically by Java Code in BIRT

Javadocs for ZXing

Sample Javascript to display barcode using ZXing

Download ZXing Jar files

2 comments:

  1. Hi Surendar, This post really helpful to about the Bar Code Generation. We used Zxing jar for QR code Generation in Maximo. Zxing QR code is generating when executing report via report viewer, browser viewer but Zxing QR code is not generating via direct print Option of Maximo. The report shows as blank when report running via direct print option. Could you have any idea on this to help or any suggestion?

    ReplyDelete
    Replies
    1. Hi Nivethitha, We won't get support from zxing or IBM product team on direct print report with QR Code. Please customize the solution with work around to achieve your requirement. An action with automation script to execute the report and email to a user - the user can print the report from their mailbox.

      Delete