You want to make a request mostly like normal with the exception that you add _format=csv as an additional query parameter. For example, something like:
/maximo/oslc/os/mxapiwodetail?_format=csv&lean=1&oslc.where=wonum="1022"&oslc.select=wonum,description,assetnum,siteid
will return a response like below (NOTE the line numbers are from the editor, not in the response itself)
Original Message:
Sent: Tue November 15, 2022 07:40 AM
From: jeffk 2BC7
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
Steven that would be very helpful.
what would be the options after that point as far as a csv goes without java customization? i.e. display on another tab, email to a user etc?
------------------------------
jeffk 2BC7
interloc solutions
grand rapids MI
Original Message:
Sent: Mon November 14, 2022 09:12 PM
From: Steven Shull
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
I would think xlsx would work assuming the customer is on a recent version. I did a quick test in my environment and it worked. I don't know if there's a way to do the export to CSV. Once the report is run the BIRT UI allows you to export to CSV but the report execution doesn't have a way to generate a CSV directly that I'm aware of. If you don't need it to be a report, there is a way to generate a CSV from a REST API request (outside of the report framewok). If that's the case let me know and I can provide an example of that.
------------------------------
Steven Shull
Original Message:
Sent: Mon November 14, 2022 04:20 PM
From: jeffk 2BC7
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
Hi Steven.
Is there documentation on the options for reportformat? I tried using reportformat=xlsx but it threw an error: oslc:statusCode: 400 oslc:reasonCode BMXAA5480E
Just trying to get a csv delivered actually.
Thanks
Jeff
------------------------------
jeffk 2BC7
interloc solutions
grand rapids MI
Original Message:
Sent: Mon March 07, 2022 07:50 AM
From: Steven Shull
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
Try all lowercase (IE xls instead of XLS). It's a case sensitive parameter.
------------------------------
Steven Shull
Original Message:
Sent: Fri March 04, 2022 01:59 PM
From: Kevin Benore
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
Steven:
Ken and I almost have it totally working. Thanks for the assistance thus far. We are able to make calls and generate PDF reports. However, when we veer off the default and try to request XLS or XLSX, it doesn't like it.
URL: /maxrest/oslc/os/MXAPIWODETAIL?action=genreport&reportname=Safety.rptdesign&reportformat=XLS&FY=2022
RESPONSE:
BMXAA5480E - The report Safety.rptdesign of the MXAPIWODETAIL application failed to run. Unsupportted report output format requested: XLS
Is there an additional setting that is needed in Maximo?
------------------------------
Kevin Benore
Original Message:
Sent: Thu March 03, 2022 04:09 PM
From: Steven Shull
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
Sorry for the confusion. I'm going to step back to see if this helps or confuses you more.
Maximo reports have an application field (APPNAME) which ties to the app where the report will be exposed. This is typically an App in the traditional sense, but can also be used for object structures that have been configured for object structure security.
There is a second field is Report Folder (REPORTFOLDER). In most scenarios, this matches the application field because the report is unique to that app but it does not have to be.
When you have an existing report (woprint.rptdesign for example) that you are trying to expose in a new application you have two choices. You can re-use the same report folder or you can make the report folder unique. When you re-use the same report folder, the existing report is immediately available and any update to the report on either app (IE WOTRACK or MXAPIWODETAIL) will be used for both. If the report folder is unique, the user must import the report and maintain it for each app (IE 2+ imports) each time there is a change.
My recommendation which I outlined above was to re-use the same reportfolder if these are the same report. Think of it like files on a file system. You can make a dozen copies of the file that you try to keep in sync each time you make a change or you can maintain one file and just know where to go to find it each time.
The UI explanation was when your app is an object structure, the report preview can't handle parameter bindings in the UI. The simplest way to think about it is object structures require the integration framework. But as done out of the box and as I showed in my examples, you can re-use the same reports that already exist in Maximo including ones that have parameters.
------------------------------
Steven Shull
Original Message:
Sent: Thu March 03, 2022 03:30 PM
From: Ken Munyeria
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
Thanks Steven.
Clarification:
So they are not supposed to be run from the UI - does that mean we need 2 copies of the report, one for UI and one for API?
Also, what about if they are in cloned apps - will upgrades that mess with object structures NOT upgrade them if needed?
If so, how do we handle this for reports that are on cloned apps?
------------------------------
Ken Munyeria
Original Message:
Sent: Thu March 03, 2022 11:37 AM
From: Steven Shull
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
The binding error on preview is to be expected. These aren't supported to be run from the UI so if any of the parameters are bound to an attribute it will show that error.
The report parameters are based on the Parameter Names defined in report administration. For example, I duplicated the wotrack_costanalysis.rptdesign and the query parameters are status, worktype, woclass, costesttype, site, etc. The query parameters should be those names exactly. Even if a report parameter is defined with a default, defaults only apply to UI and must be provided in the request.
We discard the where & appname parameters so don't bother providing them. You should build the where utilizing the oslc.where parameter and the oslc.where is currently required because we evaluate report limits and such based on it.
Example request: /maximo/oslc/os/mxapiwodetail?action=genreport&reportname=wotrack_costanalysis.rptdesign&lean=1&oslc.where=wonum="1022"&status=COMP&woclass=WORKORDER&site=BEDFORD&startdate=2022-03-01&enddate=2022-03-04&costesttype=Y&worktype=PM
------------------------------
Steven Shull
Original Message:
Sent: Wed March 02, 2022 04:25 PM
From: Ken Munyeria
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
Stephen,
After doing what you suggested above (see 1.jpg), I got some invalid bindings in the Preview section of the report for some of the parameters (see 2.jpg).
Any thoughts?
Also, when passing report params to the rest api, would we do it like this:
/maxrest/oslc/os/MXAPIWODETAIL?action=genreport&reportname=reportname.rptdesign&Report Param 1=Y&application=WOTRACK3&Report Param 3=12345678
------------------------------
Ken Munyeria
Original Message:
Sent: Wed March 02, 2022 09:30 AM
From: Steven Shull
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
Reports can be associated to object structures like they are with applications. In your example you're using MXAPIWODETAIL and that only has two reports out of the box. If you duplicate the report in Report Administration and associate the app as the object structure that will make that report available (assuming your user has security for the report). I would suggest when you duplicate it that you leave the Report Folder as the original report folder (such as WOTRACK) so that way any updates are reflected automatically on the object structure. Something like the screenshot below.
We also support adding attachments in the response (attachments=true query parameter) as well as providing parameters for the report. To provide parameters you have to know what the name of the parameters are in Maximo, so it's not a good generic solution, but if you know what they are it is possible as well.
------------------------------
Steven Shull
Original Message:
Sent: Tue March 01, 2022 01:17 PM
From: Kevin Benore
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
@Steven Shull:
That is great information. One issue I am seeing, we are authenticating with the "maxadmin" user and just trying to list the reports. When we do so, we get the same two default reports as provided in the REST API manual. Is there something we need to set in the UI to get all reports showing up? It seems like we might be missing some key part.
/maxrest/oslc/os/mxapiwodetail?action=listreports
[ {
"reportname": "woprint.rptdesign",
"description": "Work Order Details",
"genreport": "http:\/\/10.20.1.195\/maxrest\/oslc\/os\/MXAPIWODETAIL?action=genreport&reportname=woprint.rptdesign"
},
{
"reportname": "wotrack.rptdesign",
"description": "Work Order List",
"genreport": "http:\/\/10.20.1.195\/maxrest\/oslc\/os\/MXAPIWODETAIL?action=genreport&reportname=wotrack.rptdesign"
}
]
------------------------------
Kevin Benore
Original Message:
Sent: Fri February 11, 2022 09:17 AM
From: Steven Shull
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
The REST API supports generating a PDF of the report. Your request would look something like:
/maximo/oslc/os/mxapiwodetail?action=genreport&reportname=woprint.rptdesign&lean=1&oslc.where=wonum="1022"
------------------------------
Steven Shull
Original Message:
Sent: Thu February 10, 2022 02:13 PM
From: jeffk 2BC7
Subject: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?
Hi,r
My customer currently invokes the reporting service to run any BIRT report in their Maximo 7.6.1.2 system from a related web application which is outside Maximo/Websphere.
They would like to generate the reports without resorting to RMI.
Is it possible, and if so is there a link or hint on how to accomplish this using perhaps REST or some other interface?
------------------------------
jeffk 2BC7
interloc solutions
grand rapids MI
------------------------------
#AssetandFacilitiesManagement
#Maximo
#MaximoIntegrationandScripting