Maximo Open Forum

 View Only
  • 1.  include long description in report

    Posted 08-27-2024 12:37

    Hello!

    I am looking to see if there is a way to do a report for a work order and include the text/notes included in the long description box.

    Thanks!


    #EverythingMaximo

    ------------------------------
    Bill Poelma
    City of Grand Rapids
    ------------------------------


  • 2.  RE: include long description in report

    Posted 08-28-2024 09:30

    Hi Bill,

    As I'm sure you've surmised, the Long Description field is non-persistent meaning it doesn't exist in the database. Thus, it can't be added to a report. That being said, there is an out of the box relationship between the WORKORDER and LONGDESCRIPTION objects called LONGDESCRIPTION. If it does not already exist, you can add the LONGDESCRIPTION object to the Reporting Object Structure you're using the create the report. Ensure the object has a cardinality of SINGLE.

    Thanks,



    ------------------------------
    Matt McGuire
    Aquitas Solutions
    https://www.aquitas-solutions.com/
    ------------------------------



  • 3.  RE: include long description in report

    Posted 08-28-2024 10:05

    As Matt said, it's not a persistent field in the Work Order table.  So in your SELECT statement for your Data Set, you'll need to do something to go get it.  This could be as simple as something like:

    maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());
    maximoDataSet.open();
    
    var sqlText = new String();
    
    // Add query to sqlText variable.
    sqlText = "SELECT workorder.siteid, workorder.orgid, workorder.wonum, workorder.description AS wodesc, workorder.location, locations.description AS locdesc, "
    + "longdescription.ldtext AS longdesc "
    + "FROM workorder "
    + "LEFT OUTER JOIN longdescription ON workorder.workorderid = longdescription.ldkey AND longdescription.ldownertable = 'WORKORDER' AND longdescription.ldownercol = 'DESCRIPTION' "
    + "LEFT OUTER JOIN locations ON workorder.location = locations.location AND workorder.siteid = locations.siteid ";

    That's an example of how to properly use the JOIN to get the Description's Long Description.  Then add it to your report design layout by using a Dynamic Text control from the Palette.

    You can also look at the out-of-the-box WOPRINT.RPTDESIGN file as a different, similar way to do it.  Click on the mainDataSet then the Fetch script, and scroll down, to see what they did there.



    ------------------------------
    Travis Herron
    Pensacola Christian College
    ------------------------------