If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to reset the prompt values using javascript

Started by inu, 04 Oct 2016 07:30:57 AM

Previous topic - Next topic

inu

Hi Team,

Can you please refer me js code to reset the prompt values as in my report several prompts are there.


Regards,
Inam

FabianGaussling

Hi,

Cognos offers in the 10.2.x Version the so called prompt api. That is a set of functions to manipulate and validate prompt values. You can use These functions to set up your prompts in your reports.

In my blog you find a tutorial on the prompt api: http://bi-solutions.gaussling.com/cognos-javascript-part-iii-prompt-api/

I hope that helps you...

BR
Fabian

inu

Quote from: FabianGaussling on 04 Oct 2016 07:39:32 AM
Hi,

Cognos offers in the 10.2.x Version the so called prompt api. That is a set of functions to manipulate and validate prompt values. You can use These functions to set up your prompts in your reports.

In my blog you find a tutorial on the prompt api: http://bi-solutions.gaussling.com/cognos-javascript-part-iii-prompt-api/

I hope that helps you...

BR
Fabian

Thanx for your response...but this website is blocked here....

AnalyticsWithJay

Here's a good solution for resetting values to their defaults when you have multiple prompts:
http://www.performanceg2.com/resetting-prompts-default-values-cognos/

If all you need is to just clear the values, you can use the following script:


function clearAllValues() {
var oCR = cognos.Report.getReport("_THIS_");
var aControls = oCR.prompt.getControls();
for (var i = 0; i < aControls.length; i++) {
aControls[i].clearValues();
}
}

inu

Quote from: CognoidJay on 04 Oct 2016 09:49:05 AM
Here's a good solution for resetting values to their defaults when you have multiple prompts:
http://www.performanceg2.com/resetting-prompts-default-values-cognos/

If all you need is to just clear the values, you can use the following script:


function clearAllValues() {
var oCR = cognos.Report.getReport("_THIS_");
var aControls = oCR.prompt.getControls();
for (var i = 0; i < aControls.length; i++) {
aControls[i].clearValues();
}
}


Thanks all of you... solved

inu

Quote from: inu on 04 Oct 2016 10:02:20 AM
Thanks all of you... solved


Thanks a lot CognoidJay, its almost done ... but clearing values didnot resolve the issue... for default prompt values i went through the link, but i could not accomplish the task.. can you please modify the code and send that to me for my convenience.


Regards,
Inam