Maximo

 View Only
Expand all | Collapse all

BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

  • 1.  BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Thu February 10, 2022 02:13 PM
    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
    ------------------------------



    #Maximo
    #AssetandFacilitiesManagement
    #MaximoIntegrationandScripting


  • 2.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Fri February 11, 2022 09:18 AM

    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
    ------------------------------



  • 3.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Wed March 02, 2022 09:16 AM
    @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
    ------------------------------



  • 4.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Wed March 02, 2022 09:31 AM
    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
    ------------------------------



  • 5.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Thu March 03, 2022 10:14 AM
    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
    ------------------------------



  • 6.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Thu March 03, 2022 11:37 AM
    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
    ------------------------------



  • 7.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Thu March 03, 2022 03:30 PM
    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
    ------------------------------



  • 8.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Thu March 03, 2022 04:09 PM

    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
    ------------------------------



  • 9.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Fri March 04, 2022 02:00 PM

    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
    ------------------------------



  • 10.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Mon March 07, 2022 07:50 AM
    Try all lowercase (IE xls instead of XLS). It's a case sensitive parameter.

    ------------------------------
    Steven Shull
    ------------------------------



  • 11.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Tue March 08, 2022 12:59 PM
    Steven,
    This seems to be working correctly.
    Thanks for your help.

    ------------------------------
    Ken Munyeria
    ------------------------------



  • 12.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Mon November 14, 2022 04:20 PM
    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
    ------------------------------



  • 13.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Mon November 14, 2022 09:13 PM
    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
    ------------------------------



  • 14.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Tue November 15, 2022 07:41 AM
    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
    ------------------------------



  • 15.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Tue November 15, 2022 02:00 PM

    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)



    As far as what you do after you make the request, this REST API is for retrieving the data but doesn't really do anything about displaying/emailing it to someone. You can probably write your own action on the object structure if you need to download and email this as a CSV but I've never tried.



    ------------------------------
    Steven Shull
    ------------------------------



  • 16.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Fri July 22, 2022 06:11 PM
    Steven, follow-up on this question.

    I'm trying to use oslc.where with in to return a report with a list of Work Orders. For example:

    http://maximohost/maximo/oslc/os/mxapiwodetail?action=genreport&reportname=myreport.rptdesign&lean=1&oslc.where=wonum in [95007,95006,95250,97729,102381,110679,110681,112138]

    For some reason I'm only getting the first (earliest) record, in this case 95006. Any thoughts on why I'm only getting one returned and how to get the full set?

    ------------------------------
    Tim Ferrill
    Solutions Consultant
    Intelligent Technology Solutions
    tferrill@webuildits.com
    www.webuildits.com
    @tferrill/@webuildits
    ------------------------------



  • 17.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Fri July 22, 2022 09:31 PM
    WONUM being a string you can put in double quotes but that wouldn't explain the issue. Can you confirm this report is not parameterized and it works in core Maximo from the list tab correctly? 

    The only other thing I can think of is that the query parameter value is not being encoded properly. A comma should get encoded as %2C for example. If you test this in a tool like Postman it will automatically encode as necessary. Depending on how you're building the URL it may not be encoding that parameter value and that could be the issue. I'd expect it would cause more issues than returning a single record though.

    ------------------------------
    Steven Shull
    ------------------------------



  • 18.  RE: BIRT Integration i.e. invoking reports from outside Maximo without RMI perhaps REST?

    Posted Wed July 27, 2022 10:14 AM
    Steven,

    Confirmed this is a report issue, though I don't quite have it fixed yet. If I run from the list tab on the same set of records it still gives me only the first.

    Thanks for the assist.

    ------------------------------
    Tim Ferrill
    Solutions Consultant
    Intelligent Technology Solutions
    tferrill@webuildits.com
    www.webuildits.com
    @tferrill/@webuildits
    ------------------------------