Dear Ria,
Here is JS coding & IRPT coding respectively:
//**-----------------------------------------------------------------------------------------
$(document).ready(function(){
jQuery.sap.require("sap.m.DateTimeInput");
var nNow = new Date();
var application = "Equipment Status";
/*-------------------- stDate -------------------- */
//*2011-02-10T00:00:00
//*yyyy-MM-dd'T'hh:mm:ss
/*-------------------- stDate -------------------- */
var stDate = new sap.m.DateTimeInput({
width : "99%",
type : "DateTime",
displayFormat : "dd MMMM, yyyy H'h' m'm' a",
dateValue : new Date(nNow-1000*24*60*60),
valueState : "Warning"
});
stDate.placeAt("divStDate");
/*-------------------- endDate -------------------- */
var nNow = new Date();
var endDate = new sap.m.DateTimeInput({
width : "99%",
type : "DateTime",
displayFormat : "dd MMMM, yyyy h'h' m'm' a",
dateValue : new Date(nNow),
valueendDate : "Warning"
});
endDate.placeAt("divEndDate");
/*-------------------- endDate -------------------- */
var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({pattern: "yyyy-MM-ddTHH:mm:ss"});
var addProps = '{'+
'"DisplayTemplate":"NRC_2010/Notifications/UI/EuquipmentStatusUI5",'+
'"QueryTemplate":"NRC_2010/Notifications/UI/XGetEquipmentListAndStatus",'+
'"Content-Type":"image/png"'+
'}';
var EquipStatus = new com.sap.xmii.grid.init.i5Grid('NRC_2010/Notifications/UI/EuquipmentStatusUI5','NRC_2010/Notifications/UI/XGetEquipmentListAndStatus',addProps);
EquipStatus.setGridWidth("450px");
EquipStatus.setGridHeight("400px");
EquipStatus.draw('EquipStatus');
EquipStatus.update(true);
//***-----------------------------------------------------------------------------------------------------------------
//***-------------------------------TagStatisticlist----------------------------------------------------------***///
var addProps = '{'+
'"DisplayTemplate":"NRC_2010/Notifications/UI/StatisticTagListUI5",'+
'"QueryTemplate":"NRC_2010/Notifications/UI/XGetStatisticTagList",'+
'"Content-Type":"image/png"'+
'}';
var TagStatisticlist = new com.sap.xmii.grid.init.i5Grid('NRC_2010/Notifications/UI/StatisticTagListUI5','NRC_2010/Notifications/UI/XGetStatisticTagList',addProps);
TagStatisticlist.setGridWidth("800px");
TagStatisticlist.setGridHeight("400px");
var fnEquipStatusSel = (function(){
var c = EquipStatus.getGridObject().getSelectedCellValue(3);
var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({pattern: "yyyy-MM-ddTHH:mm:ss"});
TagStatisticlist.getQueryObject().setParameter('Param.1', c);
TagStatisticlist.getQueryObject().setParameter('Param.2', oDateFormat.format(stDate.getDateValue()));
TagStatisticlist.getQueryObject().setParameter('Param.3', oDateFormat.format(endDate.getDateValue()));
TagStatisticlist.draw('TagStatisticlist');
TagStatisticlist.update(true);
});
EquipStatus.registerRowSelectionEventHandler(fnEquipStatusSel);
//***-------------------------------TagStatisticlist----------------------------------------------------------***///
//***-------------------------------TagStatistic----------------------------------------------------------***///
var fntagSel = (function(){
var addProps = '{'+
'"DisplayTemplate":"NRC_2010/Notifications/UI/TagStatisticChartUI5",'+
'"QueryTemplate":"NRC_2010/Notifications/Queries/TagStatisticDetail1",'+
'"Content-Type":"image/png"'+
'}';
var TagStatistic = new com.sap.xmii.chart.hchart.i5Chart('NRC_2010/Notifications/UI/TagStatisticChartUI5','NRC_2010/Notifications/Queries/TagStatisticDetail1',addProps);
TagStatistic.setChartWidth("800px");
TagStatistic.setChartHeight("200px");
var d = TagStatisticlist.getGridObject().getSelectedCellValue(8);
var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({pattern: "yyyy-MM-ddTHH:mm:ss"});
//var Query1= TagStatistic.getQueryObject();
//Query1.setParameter("Param.1",d);
//Query1.setParameter("Param.2",oDateFormat.format(stDate.getDateValue()));
//Query1.setParameter("Param.3",oDateFormat.format(endDate.getDateValue()));
TagStatistic.getQueryObject().setTagName(1,TagStatisticlist.getGridObject().getSelectedCellValue(8));
TagStatistic.getQueryObject().setStartDate(oDateFormat.format(stDate.getDateValue()));
TagStatistic.getQueryObject().setEndDate(oDateFormat.format(endDate.getDateValue()));
TagStatistic.draw('TagStatistic');
TagStatistic.update(true);
});
TagStatisticlist.registerRowSelectionEventHandler(fntagSel);
//***-------------------------------TagStatistic----------------------------------------------------------***///
//***-------------------------------Refresh----------------------------------------------------------***///
var refresh = new sap.ui.commons.Button({
text:'Refresh Data',
press:function(){
var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({pattern: "yyyy-MM-ddTHH:mm:ss"});
var startdate = oDateFormat.format(stDate.getDateValue());
var enddate = oDateFormat.format(endDate.getDateValue());
var c = EquipStatus.getGridObject().getSelectedCellValue(3);
var addProps = '{'+
'"DisplayTemplate":"NRC_2010/Notifications/UI/StatisticTagListUI5",'+
'"QueryTemplate":"NRC_2010/Notifications/UI/XGetStatisticTagList",'+
'"Content-Type":"image/png"'+
'}';
var TagStatisticlist = new com.sap.xmii.grid.init.i5Grid('NRC_2010/Notifications/UI/StatisticTagListUI5','NRC_2010/Notifications/UI/XGetStatisticTagList',addProps);
TagStatisticlist.setGridWidth("800px");
TagStatisticlist.setGridHeight("400px");
TagStatisticlist.draw('TagStatisticlist');
TagStatisticlist.getQueryObject().setParameter('Param.1', c);
TagStatisticlist.getQueryObject().setParameter('Param.2', oDateFormat.format(stDate.getDateValue()));
TagStatisticlist.getQueryObject().setParameter('Param.3', oDateFormat.format(endDate.getDateValue()));
TagStatisticlist.update(true);
}
});
refresh.placeAt('refresh');
});
//***-------------------------------Refresh----------------------------------------------------------***///
//**------------------------------IRPT------------------------------------------------------------------**//
<!DOCTYPE HTML>
<HTML>
<HEAD>
<title>{Area}</title>
<META http-equiv="X-UA-Compatible" content="IE=edge">
<META http-equiv='cache-control' content='no-cache'>
<META http-equiv='expires' content='0'>
<META http-equiv='pragma' content='no-cache'>
<LINK href="/XMII/CM/MII_Essentials/00_Common/00_CSS/Content.css" rel="stylesheet" type="text/css"/>
<LINK href="/XMII/CM/MII_Essentials/00_Common/00_CSS/FitToPage.CSS" rel="stylesheet" type="text/css"/>
<SCRIPT type="text/javascript" src="/XMII/JavaScript/bootstrap.js" data-libs="i5Chart,i5Grid"></SCRIPT>
<SCRIPT type="text/javascript" src="/XMII/CM/MII_Essentials/00_Common/10_JSFiles/UtilityFunctions.js" language="javascript"></script>
<SCRIPT type="text/javascript" src="/XMII/CM/MII_Essentials/00_Common/10_JSFiles/cookie.js"></SCRIPT>
<SCRIPT type="text/javascript" src="/XMII/CM/NRC_2010/Maintenance/Maintenance.js" language="javascript"></script>
</HEAD>
<SPAN class="ContentTitle">{##Equipment Status}</SPAN>
<BODY>
<form name="frmMain" action id="frmMain">
<table border="0" cellspacing="1" width="1000" id="table1" valign="top">
<tr>
<td colspan="2">
<table border="0" cellspacing="1" width="100%" id="table3" align="left">
<TABLE style="width:100%;height:100%;CELLPADDING=0;CELLSPACING=0;" >
<TR style="height:50%;">
<TD style="width:8%;text-align:left;">{##Start Date}:</TD>
<TD style="width:22%;">
<DIV id="divStDate" style="text-align: left;"></DIV>
</TD>
<TD style="width:8%;text-align:left;">{##End Date}:</TD>
<TD style="width:22%;">
<DIV id="divEndDate" style="text-align: left;"></DIV>
</TD>
<TD style="width:10%;text-align:right;">
<div id='refresh'></div>
</TD>
</table>
</td>
<input type="hidden" id="Area" name="Area" value="{Area}"/>
</tr>
<tr>
<td>
<table border="0" cellspacing="1" id="table2" valign="top" >
<tr>
<td>
<DIV id="EquipStatus"/></DIV>
</td>
</tr>
<tr>
<td>
</table>
<td>
<table border="0" cellspacing="1" id="table3" valign="top" >
<tr>
<td>
<DIV id="TagStatisticlist"/></DIV>
<tr>
<td>
<DIV id="TagStatistic"/></DIV>
</td>
</tr>
</table>
</td>
</tr>
</form>
</BODY>
</HTML>
//**------------------------------IRPT------------------------------------------------------------------**//
Thanks
Muhammad Ashfaq