COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sir_jeroen on 23 May 2010 07:19:37 PM

Title: [Script] Change default selection in Search and Selection prompt
Post by: sir_jeroen on 23 May 2010 07:19:37 PM
A handy script I created.....

The procedure is as follows:
1. On your prompt page add an HTML Item in your page header
2. In this HTML item place the following code:

<script src="http://code.jquery.com/jquery-1.4.2.js"></script>
<script type="text/javascript">
// Possible options:
// swsStartAny  = Starts with any of these keywords
// swsStartAll  = Starts with the first keyword and contains all of the remaining keywords
// swsMatchAny  = Contains any of these keywords
// swsMatchAll  = Contains all of these keywords
var $j = jQuery.noConflict();
$j(document).ready(function(){
       $j("input[id*='swsMatchAll']").attr("checked","true");
});
</script>


3. In the line: $j("input[id*='<Your default option>']").attr("checked","true");
       change <Your default option> with one of the provided possible options. E.g. swsMatchAny
4. Click on OK
5. Run your report.

Good Luck!

RA

Btw: This script is also sent to SupportLink, so maybe you'll see it there too...
Title: Re: [Script] Change default selection in Search and Selection prompt
Post by: MFGF on 26 May 2010 09:08:45 AM
Thanks J - much appreciated!