COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: candela_68 on 11 Feb 2015 09:23:34 PM

Title: [Solved] Timeout errors using Cognos Prompt API on Report Page, not Prompt Page
Post by: candela_68 on 11 Feb 2015 09:23:34 PM
Hi all,

I have a different spin on dynamically setting a default prompt value.  In my case, the prompt is on the Report Page, not the traditional prompt page; there are specific reasons for this.

Not long ago, I got it to work with no problems but in revisiting the report again to double-check, I'm getting the below error due to a timeout issue.

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.

Details: RSV-SRV-0042 Trace back:RSReportService.cpp(756): RSException: CCL_CAUGHT: RSReportService::process()RSReportServiceMethod.cpp(263): RSException: CCL_RETHROW: RSReportServiceMethod::process(): promptPagingForward_RequestMethodImpl/RSASyncSecondaryRequestMethod.cpp(199): RSException: CCL_THROW: RSASyncSecondaryRequestMethod::run()

Below is the code I used on the report page so the parameter on my value prompt would be set which I could then pass on to drill throughs.

<script type= "text/javascript">
   var myScripts = {}; 
   var haveFinished;
   oCR = cognos.Report.getReport( "_THIS_" );

   myScripts.getControl = function (promptName) {
      return oCR.prompt.getControlByName(promptName);
   }

   myScripts.getControl('FYCycle').setValues(myScripts.getControl('CurrentFYCycle').getValues(true));

   if(!haveFinished)
   {     
      oCR.sendRequest(cognos.Report.Action.FINISH);
      haveFinished = true;
   }
</script>

I modified it to use a timeout function (below), as I've seen on other posts, but now I can't get the Cognos hour-glass to stop spinning (although it does remove the error).

<script type= "text/javascript">
   setTimeout(function()
   {
      var myScripts = {}; 
      var haveFinished;
      oCR = cognos.Report.getReport( "_THIS_" );

      myScripts.getControl = function (promptName) {
         return oCR.prompt.getControlByName(promptName);
      }
      
                myScripts.getControl('FYCycle').setValues(myScripts.getControl('CurrentFYCycle').getValues(true));

      if(!haveFinished)
      {     
         oCR.sendRequest(cognos.Report.Action.FINISH);
         haveFinished = true;
      }
   }, 100);
</script>

Any thoughts on how I can fix this so that my report page will set the parameter property of my value prompt (for my drill through) without having to deal with the timeout issue that sometimes happens and sometimes doesn't?

Thanks,
candela_68
Title: Re: Timeout errors using Cognos Prompt API on Report Page
Post by: candela_68 on 12 Feb 2015 03:43:17 PM
Well, I solved my own issue  ;D. I moved var haveFinished; and put it outside and above the setTimeout(function().  So now it works.
Title: Re: [Solved] Timeout errors using Cognos Prompt API on Report Page, not Prompt Page
Post by: karthik.kadambi on 10 Aug 2015 04:09:16 PM
I'm facing the same issue (http://www.cognoise.com/index.php/topic,28725.0.html). I would like to know how to include the piece of code where it handles calling the myScripts and setTimeOut functions. I'm not that well versed with JavaScript and appreciate any kinda help from you in solving this.

Thanks,
Karthik