COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: krishna.cog@gmail.com on 29 Apr 2013 07:42:47 PM

Title: Java Script in Prompt Page throwing Exception
Post by: krishna.cog@gmail.com on 29 Apr 2013 07:42:47 PM
Hi Gurus,

I have a report which has Prompt and Report Page.  From the Prompt Page I have one Value Prompt and there is Java Script to bring the first value from the Value Prompt.  When I run this report it has to pickup the first value from the value prompt and run the report with the default value.  But it is getting me the Prompt Page and not passing the default value to the report.  so I changed the java script by adding promptbuttonfinish() is throwing me exception...

Note:  I enabled the Auto Submit Property for value prompt to Yes.  But still no use.

Java Script I used:
=======================
<script type="text/javascript">
function init()
{
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);
if (fW)
fW._oLstChoicesComp.options[2].selected = true;
canSubmitPrompt();
//promptButtonFinish();

// when I put this line promptButtonFinish();  it is throwing me the exception when I remove this from the java script it is bringing me          the Prompt Page.

}
init();
</script>
============================

I am getting the below error message.

RSV-BBP-0028

      The secondary request failed. The requested session does not exist and the secondary request does not contain enough information to recreate the session. Contact your Administrator.


My Objective is - when I run the report it has to take the first value from the value prompt and automatically pass it to the Report and bring the results.

Please advise.

Title: Re: Java Script in Prompt Page throwing Exception
Post by: krishna.cog@gmail.com on 02 May 2013 07:32:23 AM
I fixed this issue.  I changed the java script is now working as is expected.
<script type="text/javascript">
function init()
{
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);
if (fW)
fW._oLstChoicesComp.options[2].selected = true;
setTimeout("promptButtonFinish();",0);
}
init();
</script>