Showing posts with label birt. Show all posts
Showing posts with label birt. Show all posts

Saturday, November 25, 2023

Maximo server host name for hyperlink in BIRT report

What?  get the server hostname of the environment where the BIRT report is running.

Why? In a few scenarios, we need to form a URL in hyperlink property to point it to Maximo record or any other integrated application specific to environment.

Maximo BIRT framework don’t support implicit variable :HOSTNAME. This variable is handy on getting the server host name inside Maximo applications like communication template.

How? In order to achieve it inside BIRT, we need to run the sql query in MAXPROPVALUE table from the system property mxe.hostname on the beforeOpen method of the dataSet; it can also be from any instance or custom system property.



Store the hostname in a Global variable - hostname to use them inside the report.



Use the variable in a cell hyperlink property to point to specific Maximo host name

"https://" + reportContext.getPersistentGlobalVariable ("hostname") + "/maximo/ui/login?event=loadapp&value=asset&additionalevent=sqlwhere"
+"&additionaleventvalue=assetid = (select assetid from asset where siteid = '"+row["siteid"]+"' and assetnum = '"+row["assetnum"]+"')"




Courtesy: Madhavan

Friday, March 18, 2022

Maximo Asset Hierarchy BIRT Report

Asset Hierarchy is used to define the physical or functional parent-child relationship of assets created within the Location application. 

The real advantage of developing such location/asset hierarchy is to easily locate an asset to perform work orders, grouping of assets under a location to represent plant systems, etc.,

OOB Maximo has Location Hierarchy by system report, but it doesn't have similar report to display the Asset Hierarchy. 

A report for asset hierarchy using ASSET and ASSETANCESTOR tables is available in gitlab asset_hierarchy.rptdesign

The flowchart describes the nested table structure used to design the hierarchy report.


                                               



Configure the dataSet with a Parameter to accept the value from the parent table design


Parent parameter should be linked to the assetnum of parent table


Always use - Auto Layout - Fixed Layout would cause the results go in separate pages.

Report Parameters need to be filled with attribute (siteid,location,assetnum) and lookup values (site,locations,asset) to let the user choose values from the lookup.
 

Report Output:

2) We can also build an Asset Hierarchy Data structure using a SQL query. But it won't be work in BIRT design file. 

SELECT

    level,  assetnum,  parent,  lpad (' ', level * 4, ' ') || assetnum,

    description,  location,  siteid

FROM asset

WHERE  siteid = 'BEDFORD'

START WITH siteid = 'BEDFORD'  AND parent IS NULL AND children = 1 

CONNECT BY PRIOR assetnum = parent


References:

Saturday, February 26, 2022

Forecast reports using Cross Tab feature in BIRT Maximo

Why Forecast is needed ? 
For planning of work or budgeting for long term operations, we need to forecast the upcoming work along with costs/labors/services/materials/tools associated with them.

What is Cross tab ? 
A Crosstab (or Cross Tabulation) is a table showing the relationship between two or more variables for quantitative analysis by showing the correlation change from one group of variables to another. It allows for the identification of patterns, trends and probabilities within data sets. Cross Tabulation is used across various industries, job roles and analysts. It benefits many people for forecasting cost or material requirement for the company.

Sample Requirement
I would like to create steps to develop a crosstab table in Maximo BIRT reporting functionality with a use case.; PM (Preventive Maintenance) Cost Forecast Reporting using Cross Tab feature.

Development steps
Create a report with predefined template – “Tivoli Maximo List Template”

Remove the “Detail Row” section from the template. Cross tab inserted into Detail section would result in duplicated rows, so it needs to be created in Header section.

 

Merge the cells in the Table header and insert the “Cross Tab” element into the table header


Construct the Data Set with all required output columns – this report shows all OOB fields to display the PM Cost forecast report with required Work Orders per month



Create a new Data Cube 

Associate the Data Set for Data Cube. Add Groups (Dimensions) for columns that we want to display in rows section and for column header (month in this case) of Cross Tab Section.

Summary field is the one which is at the right-hand side of Cross Tab element design.



Drag and drop the fields from Dimensions to rows section of the Cross Tab element.

Place the MONTH field from Dimension to column header section of cross tab

Place the Summarize field in the column field section. 



The design file is available in gitlab - https://gitlab.com/bysurendar/maximo/-/blob/master/reports/pmcostforecast.rptdesign

Output of the report:

Rows are the list of Preventive Maintenance records which have forecast generated for the given date range

Columns are months for which the forecast exists. 

Summarized values are the Work Orders that would be needed for a month to perform the Work.



Courtesy: Vijayabanu Pitachi 

References: 

https://www.ibm.com/docs/en/elo-mc/7.6.0?topic=tab-tutorial-creating-cross

https://www.youtube.com/watch?v=LKuCNuz67YA


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