If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Javascript for cognos 8.4 date prompt not working

Started by Aditi, 28 Mar 2011 02:38:17 AM

Previous topic - Next topic

Aditi

Hi ,

I have a report in cognos 8.4 which has furthur 3 levels of drill through reports.

when i select the date prompt in the master report prompt page,it runs fine .
the problem id with the drill through reports.
suppose i hv clicked on jan 2 2011 to march 31 2011; the parent reports gives the monthly data.
but wen i drill through the monthly report(i.e. the drill through) it shows the dates of the page to be from jan 2nd to march 31st 2011 but gives the data correctly for the month selected.

i think the javascript is causing the problem.
<script>
var cntlName;
function right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

for( var i=0; i<preProcessControlArray.length; i++)
{
  cntlName = eval(preProcessControlArray);
  dt = new Date();
  df = new Date( dt - 365*86400000);
  if (cntlName.m_oSubmit.name.toLowerCase() == 'p_pardatefrom' )
{
    cntlName.m_oEditBox.value = df.getFullYear()
         + '-' + right('0'+(1+df.getMonth()),2)
         + '-' + right('0'+df.getDate(),2);
    eval('pickerControl' + cntlName.m_sRef + '.lostFocus()');
  }
  if (cntlName.m_oSubmit.name.toLowerCase() == 'p_pardateto' )
{
    cntlName.m_oEditBox.value = dt.getFullYear() + '-' + right('0'+(1+dt.getMonth()),2) + '-' + right('0'+dt.getDate(),2);
    eval('pickerControl' + cntlName.m_sRef + '.lostFocus()');
  }
}
</script>

here the function "preProcessControlArray" is causing the problem it seems.

Please Help. :(

Regards,
Aditi

Aditi

People,

also the date prompt provided in the drill through report is not working (it seems it is not taking the values from the paramaters) since wen i try to change the dates in the drill through report it is not taking the value in.

suppose instead of march 1 to march 31st i want to keep it as feb 1 to feb 28th then also it will show me march data only.