Sunday, September 29, 2024

Maximo BIRT for Parent-Child Records with Costs

Maximo BIRT Sub report to View a Parent-Child Relationship and Costs

These type of reports are required to view parent - child records with their costs displaying individually for parent and child in separate sections. Users may need to know consolidated costs of the list of records for a period of time.

Let us create a sample report for Parent-child records - Work Order with its Actual Materials records

Create a new report of "Tivoli Maximo Subreport Template"


The parent and child data set are linked using a Data Set parameter. 
subDataSet defines a parameter "wonum" with Direction as Input.


 This parameter will take value from parent data set to subDataSet binding. row["wonum"] will get the value from parent layout in the design.



subDataSet query will get the value using the BIRT setQueryParameterValue method against ? place holders inside the sql query.


In report layout design we are displaying costs values of "WO Total Cost" and "Actual Material Line Cost".

WO total cost is displayed for each WOs and a consolidated WO total cost at footer section. 

Actual Material Line Cost is displayed for all WO Material lines below the sub section and a consolidated one for all WOs at footer. 

A couple of report global variables are created to calculate the consolidated sum for all WOs for the specific date range given in the report input parameter. 

Initialization of these report global variables are made in mainDataSet onCreate Script method. 



On data element of WO total cost & Material line cost fields, we add their values to global variable for displaying them at footer section using onCreate Script method. 



To display the consolidated value of all WOs, we using the onRender method of data element totwocost in footer section.



Report Output displays the WO Total Cost & Material Actual Cost at WO level and consolidated one at footer section.



Report design file woactualssubreport.rptdesign