Eclipse BIRT Designer Version 2.3.2.r232_20090202 Build <2.3.2.v20090218-0730>inlocationIBM Confidential
OCO Source Materials
5724-M19
(C) COPYRIGHT IBM CORP. 2006
The source code for this program is not published or otherwise
divested of its trade secrets, irrespective of what has been
deposited with the U.S. Copyright Office.This template will create a report having a single header with multiple rows of data.MaximoSystemLibrary.maximoThemeTivoli Maximo List TemplateltrMaximoSystemLibrary.rptlibraryMaximoSystemLibrarystaticstringfalsetext-box1=1Unformattedstaticstringfalsetext-boxUnformattedtruestaticstringfalsetext-boxUnformattedtruestaticstringfalsetext-boxUnformattedstaticstringsimpletext-boxBEDFORDtrueUnformattedstaticstringsimpletext-boxGEOtrueUnformattedstaticstringsimpleEnter parentfalsetext-boxWESTtrueUnformatted1siteidstring2locationstring3locdescrstring4systemidstring5sysdescrstring6levelintegersiteidlocationlocdescrsystemidsysdescrlevel1siteidstring2locationstring3locdescrstring4systemidstring5sysdescrstring6levelintegermaximoDataSourcelevelinteger10truetrueparentstring2truetruesystemidstring3truetruesiteidstring4truetrue 0) {
//when child
where = " lochierarchy.parent = ? "
;
if (scriptLogger.isDebugEnabled()) {
scriptLogger.debug("["+maximoDataSet.getName() + "] >>> at child");
}
}
else {
//when root element
where = params["where"];
if(BirtComp.equalTo(BirtStr.trim(params["where"]), "1=1")) {
where += " and lochierarchy.parent is null ";
}
if (scriptLogger.isDebugEnabled()) {
scriptLogger.debug("["+maximoDataSet.getName() + "] >>> at parent");
scriptLogger.debug("["+maximoDataSet.getName() + "] >>> params[\"where\"] " + params["where"]);
}
}
// Add query to sqlText variable.
sqlText = "select locations.siteid, lochierarchy.location, locations.description as locdescr, "
+ " lochierarchy.systemid, locsystem.description as sysdescr "
+ " from lochierarchy inner join "
+ " locations on "
+ " lochierarchy.orgid = locations.orgid "
+ " and lochierarchy.siteid = locations.siteid "
+ " and lochierarchy.location = locations.location inner join "
+ " locsystem on "
+ " locsystem.orgid = lochierarchy.orgid "
+ " and locsystem.siteid = lochierarchy.siteid "
+ " and locsystem.systemid = lochierarchy.systemid "
+ " where " + where
+ " and lochierarchy.siteid = ? "
+ " and lochierarchy.systemid = ? "
+ " order by lochierarchy.location"
;
maximoDataSet.setQuery(sqlText);
if(inputParams["level"] > 0) {
//when child
maximoDataSet.setQueryParameterValue(1, inputParams["parent"]);
maximoDataSet.setQueryParameterValue(2, inputParams["siteid"]);
maximoDataSet.setQueryParameterValue(3, inputParams["systemid"]);
}
else {
//when root
maximoDataSet.setQueryParameterValue(1, params["siteid"].toUpperCase());
maximoDataSet.setQueryParameterValue(2, params["systemid"].toUpperCase());
}]]>1sysdescrstringsysdescr1sysdescrstringmaximoDataSource