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

 

Javascript to dynamically default prompt values and refresh on loading 10.1.1

Started by twister, 18 Feb 2015 10:29:44 AM

Previous topic - Next topic

twister

I am using cognos 10.1.1
I am working on a report which contains multiple parameters.

Whenever the user runs the report, the parameters should automatically populate the values dynamically (I have some dimensional function written) and refresh the report also. Basically the javascript should get invoked automatically whilst the user runs the report. I can only think of couple of ways(given below) to do this but the first option given below works intermittently. yet to try the second one.

Any thoughts?

A) Call the javascript using body onload function but the problem is my script loads before the prompt gets loaded in the report (most of the times). when the script loads before the prompt, then my prompts will not get populated with dynamic values and therefore wouldn't run. That is what I have seen in 10.1.1
B) I am yet to try this one - to have a hidden prompt page and load all the default values in this page and run the report as a next step.

Any thoughts? Please share the code if you already have one

Thank you

bdbits

One alternative is to set your prompts to optional. If the user selects nothing, the parameter will be null. You can use an expression in your report to check for this and use your dimensional function to determine the default if they do not choose something. With this approach, no javascript is required.