COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognosdelaware on 19 Jul 2017 08:31:05 AM

Title: Is there a way to run javascript code first when user click Finish on a report?
Post by: cognosdelaware on 19 Jul 2017 08:31:05 AM
Hi,

  I am running Report Studio 10.2.2 and wondered if there was a way, when the prompt page is filled out and the user clicks on the "Finish" button, if there was an event I could wire to run to do some validation before the report is generated?

Thanks
Title: Re: Is there a way to run javascript code first when user click Finish on a report?
Post by: CognosPaul on 19 Jul 2017 09:54:25 PM
The Prompt API is your friend here. But why not have the validation happen as the users fill in the prompts?

Look up the setValidator function in the help, it has some decent examples.
Title: Re: Is there a way to run javascript code first when user click Finish on a report?
Post by: cognosdelaware on 20 Jul 2017 08:09:42 AM
Depending on my radio button selection, I clear the values of the other Text Box Prompt.

The user will enter their selections on the prompt page that they want to use for searching and when they click the "Finish" button, I want to check which radio button was selected and make sure the associated Text Box Prompt has data in it(as opposed to making it mandatory), since I have two and only one needs to be required at a time.

I was hoping there was some sort of "onclick" that the "Finish" button has, or some way to associate an "onclick" event to it and then I can have it run a function to check.