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.

Resourcing for Success

Resourcing for Success

Project resourcing is frequently one of the hot topics in our meetings. I frequently receive questions such as: Can we start the project now? Can we commit this resource to deliver from start to finish? Can we upskill one of our techs? Can we provide an additional...

Maximo Mobile Review

Maximo Mobile Review

The Maximo Mobile app recently released by IBM is something to get excited about!  IBM's Maximo mobility journey has been a little checkered in the past – previous solutions (Everyplace and Anywhere) didn't quite meet all the needs and requirements of many...

Developing Custom Mobile App using Maximo REST API

Developing Custom Mobile App using Maximo REST API

The mobile app for Maximo operations is a gateway to IoT and Advanced Analytics by capturing precise data at the point of performance and data not being captured when using the desktop version of Maximo. As assets become smarter and existing businesses need more...

Asset Management for Net-Zero Futures

Asset Management for Net-Zero Futures

Sustainability is not a new concept and BPD Zenith have always strived to be socially responsible, however, it is a critical imperative for today’s business operations – and for the planet. There has been a shift from using digital to improve the bottom line, to...

The Hidden Value of CMMS Master Data

The Hidden Value of CMMS Master Data

Having made a significant investment in your CMMS, advances in Data analytics are prompting rethinks about the Master Data that underpins your ability to launch programs such as Asset performance management, Monitor Asset health and enhance Predictive Maintenance. A...

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

Discover the Maximo Application Suite

Discover BPD's award winning Maximo and IoT Services

Come with BPD Zenith to the future of Asset Management

Partner Ecosystem

BPD Zenith partners with a diverse array of the world’s top Technology, Business and Solution Integration leaders.