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

Extracting value from a Calender Date prompt using JS in 8.4 - how?

Started by venu_anasapurapu, 22 Sep 2010 09:01:17 AM

Previous topic - Next topic

venu_anasapurapu

Hi, we migrated reports from 8.1 to 8.4. In some reports, we have java script to validate the selection on  two date prompts so that when 'From Date' is greater than 'To Date', a message is displayed.

This the script that we have in 8.1,

Quote
...
...
...
function assignParamValue()
{


var temp=document.forms["formWarpRequest"].elements["_oChoicecalenderdate_From"].value
var temp1=document.forms["formWarpRequest"].elements["_oChoicecalenderdate_To"].value


var enter_from_year=String(temp).substring(0,4)
var enter_from_month=String(temp).substring(5,7)
var enter_from_date=String(temp).substring(8,10)

enter_from_year=parseFloat(enter_from_year)
enter_from_month=parseFloat(enter_from_month)
enter_from_date=parseFloat(enter_from_date)

var enter_to_year=String(temp1).substring(0,4)
var enter_to_month=String(temp1).substring(5,7)
var enter_to_date=String(temp1).substring(8,10)

enter_to_year=parseFloat(enter_to_year)
enter_to_month=parseFloat(enter_to_month)
enter_to_date=parseFloat(enter_to_date)

...
...
...
...
}

The above script does not hold good in 8.4 and instead need to use getFormWarpRequest() now. We have changed the code and come up with the following

Note: var names changed.

Quote
function assignParamValue()
{

var x=getFormWarpRequest ( )

var ctrl1=G_PM_THIS_.getControlByName("calenderdate_From")
var ctrlid1= ctrl1._id_
var ctrlfullid1="PRMT_"+ctrlid1
var temp=document.getElementById(ctrlfullid1).value

var ctrl2= G_PM_THIS_.getControlByName("calenderdate_To")
var ctrlid2= ctrl2._id_
var ctrlfullid2="PRMT_"+ctrlid2
var temp1=document.getElementById(ctrlfullid2).value

...
...
...
</script>

Rest of the code remained same.

Now, eventhough this code is correct syntactically, the script is not working even when user selects a fail condition i.e, 'From Date' greater that 'To Date'.

Any idea what went wrong in the code and what else that we need to do?

Thanks, AJVG

Aditi

hi,

Even i am stuck with JS while upgrading the reports from 8.2 to 8.4.

the following is the code which is giving an error:


<script>
mylist = getFormWarpRequest().elements["_oLstChoicesAOP_CASE"];
mylist.remove(0);
mylist.remove(0);
mylist.onchange();
</script>

i think "mylist" is not supported by 8.4
any guesses??

Thanks,
Aditi