Displaying A non Persistent field from a table in BIRT

italugyajaitalugyaja Junior Member
edited December 1969 in Designing Analytics Reports
HI Guys,

I am designing a very simple report in BIRT for Maximo 7.1 .The tables that are used in this SR[Service Request] and CLASSSTRUCTURE Table in Maximo database.

The Column and the Fields that are going to be displayed in the report are as follows

TABLE COLUMN
SR TICKETNUM
SR ASSETID
SR BCUSTOMERNAME
SR BCUSTOMERADDRESS
SR BTELEPHONEHOME
SR BTELEPHONEMOB
SR BTELEPHONEWORK
SR REPORTDATE
SR REPORTBYID
SR BCALLERNAME
SR BCALLERTELMOB
CLASSSTRUCTURE HEIRARCHYPATH

The problem here is that CLASSSTRUCTURE table does not have a persistent HEIRARCHYPATH column in it that means this column doesnt exist in maximo databse table of classstructure.

Now can anyone please throw some light on the thing that CAN ONE PULL A non persistent Column into BIRT dataset for this report [e.g let us say Dataset1]
.If yes Please kindly explain.

Please this is urgent do send in your responses.
If you require more info on this also let me know.
I will post the same

Thanks
AJ

Comments

  • italugyajaitalugyaja Junior Member
    edited December 1969
    From Maximo Perspective If one goes into Database Configuration by logging into Maximo 7.1 and searches for CLASSSTRUCTURE object i.e table .One can find in the Attribute tab [That is column] that HEIRARCHYPATH is present as a Non- Persistent Field.

    So any suggestion of manually entering the field into the CLASSSTRUCTURE table ccannot be done in maximo .

    Our aim is to pull this non persistent field called HEIRARCHYPATH and show it on the rptdesign along with a label called Classifcation : row["HEIRARCHYPATH"]

    If any more clarification is needed..kindly reply in.

    thanks
    AJ
  • edited December 1969
    Hello,

    I guess that i'm answering too late, but i believe my solution can help to somebody.





    Im using Maximo 7.5.0.3 and SQL server 2008.



    All u need is to use nested dataset.

    maximoDataSet.open()

    {

    maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());

    maximoDataSet.open();

    var sqlText = new String();

    sqlText += "select assetnum, classstructureid from asset "

    maximoDataSet.setQuery(sqlText);

    }




    DataSet fetch method is called for every row of selected data.

    so we need to create our dataset in the fetch method.



    maximoDataSet.fetch(){

    if (!maximoDataSet.fetch())

    return (false);



    row["assetnum"] = maximoDataSet.getString("assetnum");





    //gets asset.classstructureid

    var classstructureid = maximoDataSet.getString("classstructureid");





    var hierarchypath = new String();

    if( classstructureid != null) {

    downtimeDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), "classstructure");

    downtimeDataSet.open();



    var downSql = " with Hierarchy(classstructureid, parent, Level) "

    + " as "

    + " ( "

    + " select classstructureid, parent, 0 as Level "

    + " from classstructure l "

    + " where l.classstructureid = '" + classstructureid +"'"

    + " union all "

    + " select l.classstructureid, l.parent, ch.Level + 1 "

    + " from classstructure l "

    + " inner join Hierarchy ch "

    + " on ch.parent = l.classstructureid "

    + " ) "

    + " select Hierarchy.*, classstructure.classificationid "

    + " from Hierarchy "

    + " join classstructure on classstructure.classstructureid = Hierarchy.classstructureid "

    + " order by Level desc ";





    downtimeDataSet.setQuery(downSql); // gets classstructure hierarchy of our classification





    while (downtimeDataSet.fetch()) { // adds " \ " between recrods

    hierarchypath += downtimeDataSet.getString("classificationid") + " \\ ";

    }

    downtimeDataSet.close();



    // removes " \ " after last classification

    hierarchypath = hierarchypath.substring(0,hierarchypath.length -2);



    row["hierarchypath"] = hierarchypath;

    }


    return (true);

    }


  • Hello,

    I guess that i'm answering too late, but i believe my solution can help to somebody.



    Im using Maximo 7.5.0.3 and SQL server 2008.


    All u need is to use nested dataset.
    maximoDataSet.open()

    {

    maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());

    maximoDataSet.open();

    var sqlText = new String();

    sqlText += "select assetnum, classstructureid from asset "

    maximoDataSet.setQuery(sqlText);

    }



    DataSet fetch method is called for every row of selected data.

    so we need to create our dataset in the fetch method.

    maximoDataSet.fetch(){

    if (!maximoDataSet.fetch())

    return (false);


    row["assetnum"] = maximoDataSet.getString("assetnum");


    //gets asset.classstructureid

    var classstructureid = maximoDataSet.getString("classstructureid");



    var hierarchypath = new String();

    if( classstructureid != null) {

    downtimeDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), "classstructure");

    downtimeDataSet.open();


    var downSql = " with Hierarchy(classstructureid, parent, Level) "

    + " as "

    + " ( "

    + " select classstructureid, parent, 0 as Level "

    + " from classstructure l "

    + " where l.classstructureid = '" + classstructureid +"'"

    + " union all "

    + " select l.classstructureid, l.parent, ch.Level + 1 "

    + " from classstructure l "

    + " inner join Hierarchy ch "

    + " on ch.parent = l.classstructureid "

    + " ) "

    + " select Hierarchy.*, classstructure.classificationid "

    + " from Hierarchy "

    + " join classstructure on classstructure.classstructureid = Hierarchy.classstructureid "

    + " order by Level desc ";



    downtimeDataSet.setQuery(downSql); // gets classstructure hierarchy of our classification



    while (downtimeDataSet.fetch()) { // adds " \ " between recrods

    hierarchypath += downtimeDataSet.getString("classificationid") + " \\ ";

    }

    downtimeDataSet.close();


    // removes " \ " after last classification

    hierarchypath = hierarchypath.substring(0,hierarchypath.length -2);


    row["hierarchypath"] = hierarchypath;

    }


    return (true);

    }




     


     


    What are the required modification to make this work on an oracle database



  • What are the required modification to make this work on an oracle database




     


     


    Found this issue.  renamed level

  • HI Steve ,

    I am also facing the same issue in Maximo BIRT 4.3.2 version .What are all the steps that i need to follow from the above script .I can able understand the section Open and Fetch section.I was not able to under stand the Highlighted script

Sign In or Register to comment.