COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Arumugam on 25 Sep 2017 04:36:09 AM

Title: Javascript Issue in 11.0.5
Post by: Arumugam on 25 Sep 2017 04:36:09 AM
Hi ,

  We have migrated the reports from 10.2.2 to 11.0.5 and some of the JS are not working.I have tried to one to set the prompt value for multiselect check box value prompt(values are derived from query).Though the value is showing as checked,the selected value is not passing to page from prompt page

<script language="javascript">
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);
if ( !fW || fW == undefined)
   { fW = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ );}
 
fW._oLstChoicesJS[0].click();

//alert(fW._oLstChoicesJS[0].value);


</script>
Title: Re: Javascript Issue in 11.0.5
Post by: patton on 25 Sep 2017 06:18:31 AM
Arumugam, are you running reports with "Run with full interactivity" set to "Yes"? Because HTML items won't work in interactive mode.
Title: Re: Javascript Issue in 11.0.5
Post by: Arumugam on 25 Sep 2017 06:53:29 AM
Interactive mode is set to No
Title: Re: Javascript Issue in 11.0.5
Post by: Arumugam on 27 Sep 2017 05:23:01 AM
Any one else facing the same issue(default selection for multi select checkbox using javascript) in 11.0.5?
Title: Re: Javascript Issue in 11.0.5
Post by: dougp on 27 Sep 2017 10:02:11 AM
Your code looks like something from an ancient version of Cognos.  I would not expect that to work in Cognos 11.x.  Read the documentation for the Prompt API (version 11 or version 10) for syntax that is more likely to survive an upgrade.
Title: Re: Javascript Issue in 11.0.5
Post by: Arumugam on 28 Sep 2017 01:01:15 AM
Can you please share the link for that?

I am running the report with interactive mode as "No" in 11.0.5 and all my code is working fine in 10.2 thats why i got confused.If version 10 .x and 11.x supports same javascript syntax then my report should work fine
Title: Re: Javascript Issue in 11.0.5
Post by: Arumugam on 28 Sep 2017 01:09:34 AM
Code is working fine in one lab version and not in other(we have two different lab version installed in different servers).Both servers are installed with cognos 11.0.5.I have tested the reports in same browser(same version).Will I need to check any other configuration settings?
Title: Re: Javascript Issue in 11.0.5
Post by: dougp on 28 Sep 2017 11:06:00 AM
To find the documentation for the Prompt API, click on the Help button in Cognos.
Title: Re: Javascript Issue in 11.0.5
Post by: MR1690 on 27 Apr 2021 09:25:28 AM
Hi Arumugam,

How did you resolve the issue ? I am facing the same issue,we have cognos 11.1 installed in two servers,the JS is working in one and not in another.
Title: Re: Javascript Issue in 11.0.5
Post by: Mustang030 on 13 May 2021 10:58:40 AM
Quote from: MR1690 on 27 Apr 2021 09:25:28 AM
Hi Arumugam,

How did you resolve the issue ? I am facing the same issue,we have cognos 11.1 installed in two servers,the JS is working in one and not in another.

Hi, MR1690!
You need to use understand how JS is working in Cognos 11. In older version (10, 8) you could use JS on your report page with HTML tag.
In new version of Cognos you need to use JS modules with Custom user controller element in tools.
Also you can find, how to use them in Cognos examples. And you can find them in samples location.
Title: Re: Javascript Issue in 11.0.5
Post by: dougp on 13 May 2021 07:03:43 PM
That's not necessarily true.  CA 11.1.x can still use JavaScript in HTML items in the compatible viewer.

Perhaps MR1690 can provide sufficient detail for someone to be able to help.
What style of JavaScript?
Are the reports identical, including which viewer is being used?
Are both servers running (or not running) SSL?
Are the server configurations identical except for the URI values?  (same folder structures, etc.)
What do you mean by "not working"?  Are there error messages?
Are the JS modules identical on both servers, or are both servers using the same JS repository?