THE BPD Blog

From blogs to case studies to news, we love sharing our tips and tricks for asset management, cloud, IoT and smarter operations.

by | May 20, 2021

How to call a Report directly from the Action Menu in IBM Maximo

In IBM Maximo, it’s possible to add a direct print option to a report. This adds a printer icon to the toolbar and allows you to run the report with just one click. But where the report requires parameters before running, this option is not available…

 

Usually, a user will have to click the “Run Reports” action, then find their report in the list of all reports available for that application. They then click on the one they want before being taken to the IBM Maximo Reports Request page.

In this blog, I’ll show you how to get around that problem. In our example, we use an Action launch point for an Automation Script and link it to a menu item in IBM Maximo Application Designer.

(It’s worth noting at this point that the script uses some functionality that’s only available in 7.6.1 and above; if you’re on an older version and would still like to achieve this, get in touch and we can talk through the best way to do so.)

In the video above I show you how we can make a new action to automatically load up the Request page for a report. This can be achieved by creating a new script with an action launch point in IBM Maximo Automation Scripts.

We need to give the launch point a name, which will be the same name used in the Signature option in Application Designer. This is limited to 25 characters on a standard Out-Of-The-Box Maximo, so we’ll just keep it short for now, and call both the launchpoint and action ‘AMREP’. In the description fields, we will add ‘Asset Movement Report’.

Create script with action launch point BPD Zenith IBM Maximo step 1

We can give the script the same name too. For this example, we won’t add in any variables. However, if you wanted to use this to call multiple reports or multiple applications, there would be no issue with adding a variable to include the name of the report.

This can be left as PYTHON or JYTHON. We then bring in the code (see below)…

This will bring back the REPORTNUM for the report ‘assetmove_history.rptdesign’ on the Asset application.

You could just hard code this number. Alternatively, you can also pass it in as a launch point variable if you are able to query the database for it yourself. The script then calls the dialogue for that report using the reportnum.

Create script with action launch point BPD Zenith IBM Maximo

This should then have created both a launch point and an action. With these in place, we can go to Application Designer, and to the Asset application. The we can add a new signature option – ‘AMREP’. Once entered, we then open up the Advanced Signature options and choose the option ‘This is an action that must be invoked by the UI’. The system then knows that this option name matches an action. This, in turn, is going to call our launch point for the script.

Advanced Signature options BPD Zenith IBM Maximo

Once we have done this, the action should now be added. However, we may also want to add it to our actions menu on the left-hand side of the app… Click Add New – the element type is ‘Option’, and the key-value should show up as AMREP. We then give this a position (try and find one that isn’t currently in use).

We can choose which tabs this will show up on.

There is a request page that allows you to enter the parameters for the asset number. In this case, we’ll allow ALL tabs, but in some cases, you may only want this to appear in your main tabs.

Everything should now be in place; we just need to grant permissions into Security Groups – click on the Asset application, then Asset movement Report, Grant permission…

We then just need to sign out, and back in for that to take effect!

When we log back into the Assets application, we should now see an option for the Asset Movement Report. This will bring up the Report Request page for that report, rather than going to Run Reports and Asset Move history.


Here’s the code – ‘Calling a Report directly from the Action Menu in IBM Maximo

################################################################### 

# AUTHOR P IRVING # 

# DATE 05/11/2020 # 

# BPD ZENITH Ltd # 

# https://www.bpdzenith.com/ # 

################################################################### 

from psdi.mbo import SqlFormat; 

from psdi.webclient.system.session import WebClientSession; 

  

wcs = service.webclientsession() 

  

#If there's two we'll get the first in the sequence 

sqf = SqlFormat(mbo, "APPNAME=:1 AND REPORTNAME=:2") 

sqf.setObject(1, "REPORT", "APPNAME", app) 

sqf.setObject(2, "REPORT", "REPORTNAME", "assetmove_history.rptdesign") 

where = sqf.format() 

                                 

reportSet = mbo.getMboSet("$REPORTSPI","REPORT",where) 

#Set the set as disposable, we're not changing the report just reading it 

reportSet.setFlag(39L,True) 

reportSet.reset() 

  

report = reportSet.moveFirst() 

  

reportnum = str(report.getInt("REPORTNUM")) 

pageName = "reportd"+reportnum 

wcs.loadDialog(pageName) 

  

reportSet.close() 



Things to remember – IBM Maximo Launch Points, Security Groups and Application Designer:

Keep your launch point name under 25 characters. The script launch point name and action can be up to 30 characters, the signature option can only be 25. They must match, so we need to make this under 25 characters.

Calling Reports Advanced Signature options BPD Zenith IBM Maximo

  • If your option doesn’t show up in the list but you’ve granted it to a security group, you need to make sure everyone in that group has logged out at the same time for the changes to take effect.
  • If you want it in the common actions menu or on the toolbar you can do this in the application designer by choosing Add/Modify Toolbar Menu. Then add a new row for your option.

Calling Reports Advanced Signature options BPD Zenith IBM Maximo

 

You could extend this script further and make it more versatile. Do this by adding a script variable called report with a binding type of LITERAL. You can then override the value for each new launchpoint you have – one for each report you want to run. Change line 9 of the script to look at the variable instead of the string I hardcoded in the video:

sqf.setObject(2, "REPORT", "REPORTNAME", report)

 

 

 

BPD Zenith regularly offers technical tips and support through MaxTECH – a global Maximo user support community built and ran by BPD Zenith. The group has continued to grow over recent years, especially with the move away from physical events due to COVID. This has seen the online community grow exponentially with further reach to a wider variety of Maximo users and experiences.

If you’d like to know more about this or anything else regarding IBM Maximo we’d love to hear from you! You can get in touch using any of the contact links below. You can also subscribe to the latest news, blogs, videos and events at the bottom of this blog.

 

Paul Irving

Paul Irving

Paul is leading our group Product Development Team. Paul is currently focussing on building more IoT products including a subscription to Asset Health Monitoring for assets around the world. He was previously in the role of Maximo Technical Consultant in both Aberdeen and Calgary. Paul has been involved in all aspects of the product development lifecycle for Maximo in the Oil and Gas, Power Generation and FM sectors. Paul is not your typical IT nerd. He enjoys spending time outdoors in the Lakes and the Rockies. He is a lover of animals and has a dog, a cat, a cockerel, 15 hens, and 43 cows!

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Defence Seaworthiness – A session from AMPEAK 2021

Defence Seaworthiness – A session from AMPEAK 2021

I recently got the opportunity to attend Asset Management Council of Australia’s AMPEAK conference. It has been a great experience interacting directly with the true practitioners of Asset Management, and understanding some of the technology challenges that they are...

BPD Zenith’s Asset Health Monitoring Solution, LoveYourAsset

BPD Zenith’s Asset Health Monitoring Solution, LoveYourAsset

Throughout the history of mankind, technology has always played a great role in facilitating our lives and simplifying critical challenges for progress in every field, particularly in the area of Asset Management where we are seeing many companies investing in a good...

Asset Management Best Practice and Maximo: Schedule Compliance

Asset Management Best Practice and Maximo: Schedule Compliance

This is the second of 3 articles outlining the configuration of Maximo to align with a number of Asset Management best practice elements. In this blog, we will be focusing primarily on Schedule Compliance. Maximo has a number of standard features that can easily make...

Sign up to our free newsletter to explore emerging technologies, industry events and Maximo best practice.

Come with BPD Zenith to the future of Asset Management

Listen to your assets!

Most companies are aware of waste in their preventative maintenance efforts, but aren’t quite sure how to eliminate it.