COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: qvixote on 13 Jul 2015 12:13:49 PM

Title: JavaScript reference to value prompt
Post by: qvixote on 13 Jul 2015 12:13:49 PM
Hello!

I started this same thread in Cognos 8 Report Studio by mistake. It must be here.

Here at my job I have some reports that use javascript to set the default value in a datepicker placed in a prompt page. I need to replicate the same functionallity in another report, but instead datepickers there's value prompts (select lists).

In the javascript code of the existing report with datepickers, there's a line referencing to the datepicker like this:

pickerControlFechaDesdeP.setValue(strDomingoAnterior);

Where "FechaDesdeP" is the datepicker and "strDomingoAnterior" is the variable with the value to set. What do I need to use insteas "pickerControl..." when using value prompts?

Thanks.
Title: Re: JavaScript reference to value prompt
Post by: gpollock on 13 Jul 2015 05:23:56 PM
Hi qvixote!

I tried viewing source and couldn't find the one of my prompts.  Here is a guide from IBM on how to retrieve the name of a prompt.  https://www-304.ibm.com/support/docview.wss?uid=swg21376964
Title: Re: JavaScript reference to value prompt
Post by: shubh09 on 27 Jun 2017 06:51:30 AM
Hi Team,

I am unable to open the link mentioned in above comment, can you please provide correct link??

Thanks!
Title: Re: JavaScript reference to value prompt
Post by: dougp on 27 Jun 2017 10:20:10 AM
Try the Prompt API.  It is documented in the Reporting help.

https://www.ibm.com/support/knowledgecenter/SSEP7J_11.0.0/com.ibm.swg.ba.cognos.ug_cr_rptstd.doc/c_prmpt_api_overview.html?pos=2#prompt_api_overview (https://www.ibm.com/support/knowledgecenter/SSEP7J_11.0.0/com.ibm.swg.ba.cognos.ug_cr_rptstd.doc/c_prmpt_api_overview.html?pos=2#prompt_api_overview)
Title: Re: JavaScript reference to value prompt
Post by: chinnucognos on 28 Jun 2017 08:02:21 AM
Hi,

Probably below link might help you bit

http://cognos4real.blogspot.in/2012/09/default-prompt-value-using-javascript.html

thanks,

Chinnu