Topic
  • 11 replies
  • Latest Post - ‏2013-07-16T14:13:16Z by diz420
SystemAdmin
SystemAdmin
15496 Posts

Pinned topic Javascript doesn't work in portal page after upgrade to Cognos 10.2

‏2013-01-29T14:15:03Z |
I have a couple of reports with a small piece of javascript on the prompt page to autoselect prompt values and autosubmit the report. The javascript automatically selects the first value in prompt objects and submits the report by clicking on the 'Finish' butten. The script is working fine when running the report from Report Studio or Cognos Connection. But when the report is part of a multi-page portal tab the javascript doesn't seem te work.

Do i have to use the prompt api functions to achieve this in Cognos 10.2? If so, can anybody provide me with a working example? The prompt api sample reports do not provide a solution for this specific use case. I'm not a javascript hero, so any help would be appreciated?

Thanks,
Steven
  • Arun_Santhosh
    Arun_Santhosh
    4 Posts

    Re: Javascript doesn't work in portal page after upgrade to Cognos 10.2

    ‏2013-07-10T18:13:37Z  

    Steven,

    I know it's been several months since your post and you probably found a solution / work around already.

    I'm in process of doing a 10.1 to 10.2 upgrade and faced a similar issue yesterday.

    A portal page (which runs a report having javascript) refuses to load in 10.2 - It just sits there with the spinning hour glass and then messes with the cognos instance - 100% CPU utilization - forcing either a product or full machine bounce. 

    Came across your post when I searched for solutions. Couldn't find answers elsewhere on internet either.

    So, rolled up my sleeves and dug in. Found the issue and solution to my issue. Sharing the details here as it might help others down the lane.

     

    Issue

    I was using following generic template to get the form handle in javascript. I picked this off some IBM page when I coded the javascript on 10.1

    -------------------------------------------------------------------------------------------------------------

     var form = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]); 

     if ( !form || form == undefined) 
     {
      form = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ );
     } 

    -------------------------------------------------------------------------------------------------------------

    This used to work from report studio, cognos connection and portal pages in 10.1

    However, on 10.2, it fails to get the form handle and that was causing the issue for me.

     

    Solution

    I played around a bit with cognos.Report.getReport(), <report>.prompt.getControlByName(), getValue() APIs. They worked in report studio and cognos connection but failed in portal page.

    So, went a round about way to get the form handle. Involves an extra step..but works for now.

    1) Create a text box prompt in the report with Name set to _RN_<report name>

    2) Replace the form handle retrieval code section with the following.

    //Iterate through forms to get the report form.
     var formCount=document.forms.length;
     for (formIndex=0; formIndex < formCount; formIndex++)
     {
            if(document.forms[formIndex]._textEditBox_RN_<report name>)
            {
                   form=document.forms[formIndex];
                   break;
            }
     }
     

    Word of caution

    My portal page just has got two portlets and I don't see any difference in response time.

    If your portal page has got a very large number of portlets, this might slow you down a bit as it has to look at all the forms to get the right handle.

     

    Hope this helps!

     

    Regards,

    Arun Santhosh

     

    Updated on 2013-07-11T04:15:31Z at 2013-07-11T04:15:31Z by Arun_Santhosh
  • OpherB
    OpherB
    664 Posts

    Re: Javascript doesn't work in portal page after upgrade to Cognos 10.2

    ‏2013-07-10T19:13:57Z  

    Steven,

    I know it's been several months since your post and you probably found a solution / work around already.

    I'm in process of doing a 10.1 to 10.2 upgrade and faced a similar issue yesterday.

    A portal page (which runs a report having javascript) refuses to load in 10.2 - It just sits there with the spinning hour glass and then messes with the cognos instance - 100% CPU utilization - forcing either a product or full machine bounce. 

    Came across your post when I searched for solutions. Couldn't find answers elsewhere on internet either.

    So, rolled up my sleeves and dug in. Found the issue and solution to my issue. Sharing the details here as it might help others down the lane.

     

    Issue

    I was using following generic template to get the form handle in javascript. I picked this off some IBM page when I coded the javascript on 10.1

    -------------------------------------------------------------------------------------------------------------

     var form = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]); 

     if ( !form || form == undefined) 
     {
      form = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ );
     } 

    -------------------------------------------------------------------------------------------------------------

    This used to work from report studio, cognos connection and portal pages in 10.1

    However, on 10.2, it fails to get the form handle and that was causing the issue for me.

     

    Solution

    I played around a bit with cognos.Report.getReport(), <report>.prompt.getControlByName(), getValue() APIs. They worked in report studio and cognos connection but failed in portal page.

    So, went a round about way to get the form handle. Involves an extra step..but works for now.

    1) Create a text box prompt in the report with Name set to _RN_<report name>

    2) Replace the form handle retrieval code section with the following.

    //Iterate through forms to get the report form.
     var formCount=document.forms.length;
     for (formIndex=0; formIndex < formCount; formIndex++)
     {
            if(document.forms[formIndex]._textEditBox_RN_<report name>)
            {
                   form=document.forms[formIndex];
                   break;
            }
     }
     

    Word of caution

    My portal page just has got two portlets and I don't see any difference in response time.

    If your portal page has got a very large number of portlets, this might slow you down a bit as it has to look at all the forms to get the right handle.

     

    Hope this helps!

     

    Regards,

    Arun Santhosh

     

    Thank you! You may want to send this solution to Tech Support. I know they have received reports about the problem, but so far no fix has been made official. This may lead to a fix or at least documentation for others to use.

    Regards,
    Opher

     

  • Arun_Santhosh
    Arun_Santhosh
    4 Posts

    Re: Javascript doesn't work in portal page after upgrade to Cognos 10.2

    ‏2013-07-11T04:18:18Z  
    • OpherB
    • ‏2013-07-10T19:13:57Z

    Thank you! You may want to send this solution to Tech Support. I know they have received reports about the problem, but so far no fix has been made official. This may lead to a fix or at least documentation for others to use.

    Regards,
    Opher

     

    Correction.. I had missed an underscore in the variable name in step 1. Have edited my original post to correct that.

     

    Opher,

    I will open a PMR with the issue. Will provide my solution in there and will ask IBM support to publish this or any other more optimal solution that they may have for this. Got to work on another open issue before I can get to it. Will update PMR number in this thread once I have it open.

     

    Regards,

    Arun Santhosh

  • Arun_Santhosh
    Arun_Santhosh
    4 Posts

    Re: Javascript doesn't work in portal page after upgrade to Cognos 10.2

    ‏2013-07-11T05:07:24Z  

    Correction.. I had missed an underscore in the variable name in step 1. Have edited my original post to correct that.

     

    Opher,

    I will open a PMR with the issue. Will provide my solution in there and will ask IBM support to publish this or any other more optimal solution that they may have for this. Got to work on another open issue before I can get to it. Will update PMR number in this thread once I have it open.

     

    Regards,

    Arun Santhosh

    Have notified tech support of the above issue and solution - PMR 48697.122.000

  • rperzul
    rperzul
    25 Posts

    Re: Javascript doesn't work in portal page after upgrade to Cognos 10.2

    ‏2013-07-11T12:37:44Z  

    Have notified tech support of the above issue and solution - PMR 48697.122.000

    We had exactly the same issue. As far as I can remember the "this" keyword in combination with portal pages was the main cause. We received an interim fix so support should already be aware of that.

    One more tip from my side: Be careful when using the prompt API examples in reports on portal pages 1:1. The HTML tags for the commenting sections are not properly formatted all of the time. So this could cause issues on portal pages when using IE (reports running forever and never coming back).

    Regards,

    Ron

  • diz420
    diz420
    6 Posts

    Re: Javascript doesn't work in portal page after upgrade to Cognos 10.2

    ‏2013-07-11T18:53:18Z  
    • rperzul
    • ‏2013-07-11T12:37:44Z

    We had exactly the same issue. As far as I can remember the "this" keyword in combination with portal pages was the main cause. We received an interim fix so support should already be aware of that.

    One more tip from my side: Be careful when using the prompt API examples in reports on portal pages 1:1. The HTML tags for the commenting sections are not properly formatted all of the time. So this could cause issues on portal pages when using IE (reports running forever and never coming back).

    Regards,

    Ron

    Hello,

    Just came across this problem today.  Did IBM provide a hot fix for this or did they have you upgrade to 10.2.1?  I'd hate it if I had to install another new instance of Cognos for this.

  • rperzul
    rperzul
    25 Posts

    Re: Javascript doesn't work in portal page after upgrade to Cognos 10.2

    ‏2013-07-12T11:00:15Z  
    • diz420
    • ‏2013-07-11T18:53:18Z

    Hello,

    Just came across this problem today.  Did IBM provide a hot fix for this or did they have you upgrade to 10.2.1?  I'd hate it if I had to install another new instance of Cognos for this.

    According to: http://www-01.ibm.com/software/analytics/cognos/support/fixpacks.html the 10.2 FP1 is scheduled for Q3/2013. Seems like you have to wait for it.

  • diz420
    diz420
    6 Posts

    Re: Javascript doesn't work in portal page after upgrade to Cognos 10.2

    ‏2013-07-12T13:53:18Z  
    • rperzul
    • ‏2013-07-12T11:00:15Z

    According to: http://www-01.ibm.com/software/analytics/cognos/support/fixpacks.html the 10.2 FP1 is scheduled for Q3/2013. Seems like you have to wait for it.

    Yes, but you said you got an interim fix.  Was this a fix from IBM, or did you find a workaround?  In either case, would you be able to provide a PMR or the code you used to make it work? 

  • Arun_Santhosh
    Arun_Santhosh
    4 Posts

    Re: Javascript doesn't work in portal page after upgrade to Cognos 10.2

    ‏2013-07-15T14:09:52Z  
    • diz420
    • ‏2013-07-12T13:53:18Z

    Yes, but you said you got an interim fix.  Was this a fix from IBM, or did you find a workaround?  In either case, would you be able to provide a PMR or the code you used to make it work? 

    diz420,

    fyi

    I just got off a call with IBM support for the PMR 48697.122.000.

    It was said that they will see if a tech note can be published with either the work around I used (details in my prior post) or any other better solutions that might be available.

     

    Regards,

    Arun Santhosh

     

  • rperzul
    rperzul
    25 Posts

    Re: Javascript doesn't work in portal page after upgrade to Cognos 10.2

    ‏2013-07-15T19:00:44Z  
    • diz420
    • ‏2013-07-12T13:53:18Z

    Yes, but you said you got an interim fix.  Was this a fix from IBM, or did you find a workaround?  In either case, would you be able to provide a PMR or the code you used to make it work? 

    Unfortunately I cannot provide the PMR number from SR tool as it is already archieved. The same is true for any sort of code. Sorry for that.

  • diz420
    diz420
    6 Posts

    Re: Javascript doesn't work in portal page after upgrade to Cognos 10.2

    ‏2013-07-16T14:13:16Z  

    diz420,

    fyi

    I just got off a call with IBM support for the PMR 48697.122.000.

    It was said that they will see if a tech note can be published with either the work around I used (details in my prior post) or any other better solutions that might be available.

     

    Regards,

    Arun Santhosh

     

    Hi,

     

    Thanks for the update.  I believe that this problem has been fixed in 10.2.1, but will need to run some tests.  Would prefer an overlay vs. a completely new installation!