COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: k2 on 11 Jan 2011 05:02:10 AM

Title: Java Script Waring message in Cognos 8.4, Internet Explorer
Post by: k2 on 11 Jan 2011 05:02:10 AM
Hi,

I am using the following Java Script to make the dynamic default selection in Value Prompt, when i run the report a warning message in Internet Explorer pop us saying 'ONE OR MORE OF THE REQUIRED VALUES IS MISSING. REQUIRED VALUES ARE NEEDED TO PRODUCE THE REPORT' with the option OK, once OK button is clicked, the default selection is made as expected.

Is there any way to get rid of the warning pop up message? All your replies are appreciated. Thanks

1. Add an HTML item to the left and right of the value prompt in the Report Studio

2. For the first HTML item (left) add '<span id = "A1">'

3. For the second HTML item (right) add '</span>'

4. Add an HTML item at the bottom of the prompt page next to "Run" button

5. Add the following script for the third HTML item:

<script type="text/javascript">

                var theSpan = document.getElementById("A1");
                var theSelect = theSpan.getElementsByTagName("select");
                theSelect[0].options[2].selected=true;  //This will make default value in prompt to be the first item after line, change the value '2' for other item
             
               canSubmitPrompt();

</script>

6. The value "A1" can be anything you like. Run the Report.
Title: Re: Java Script Waring message in Cognos 8.4, Internet Explorer
Post by: Gopinath on 11 Jan 2011 05:42:20 AM
remove canSubmitPrompt(); from your script
Title: Re: Java Script Waring message in Cognos 8.4, Internet Explorer
Post by: k2 on 11 Jan 2011 11:41:46 AM
Thanks a lot, Gopinath! It works :) cheers
Title: Re: Java Script Waring message in Cognos 8.4, Internet Explorer
Post by: Arsenal on 11 Jan 2011 01:12:22 PM
Alternatively, if all your prompts have default choices and/or are not required prompts, then if you set them to not required then too the error message should go away even if you keep the cansubmitprompt control