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

JQuery Slider with Report Studio List or Crosstab

Started by torre2011, 09 May 2013 09:35:45 AM

Previous topic - Next topic

torre2011

Has anyone had any success with implementing JQuery widgets like the slider into Cognos 10x reports?

I have seen a couple of examples on the web where it is has been stated that it is possible.  I have been successful with utilizing the hide and show as well as jquery cookies..but not these other widgets.

Below is the code sample that I was working with as a POC.. I have 4 html items ..1 for the JQuery code seen below, 2 for the #begin and #end div tags, and the last one for the #slide-range.

<link type="text/css" href="cognos8/common/css/ui-lightness/jquery-ui-1.8.5.custom.css" rel="Stylesheet" />
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"></script>
<script type="text/javascript">
jQuery.noConflict(); // Necessary
jQuery(document).ready(function() {
jQuery("#begin").hide(); // Hide the Cognos text prompt that you created
jQuery("#end").hide(); // Hide the other prompt as well
var lastHeader = jQuery("td[uid=15]:first").text(); // From the table header, grab the first Year available (expecting 2002 in my case)
var firstHeader = jQuery("td[uid=15]:last").text(); // Now, take the last Year available (expecting 2011 in my case) - this sets the default values in the slider.
jQuery("#slider-range").slider({
            range: true,
            min: 2001301, // I am using the Year Month field...and I am setting the value by hand
            max: 2001312, // See above
                        values: [firstHeader, lastHeader], // Sets the default values as specified above
            slide: function(event, ui) {
jQuery("#begin input:text").val(ui.values[0]); // When the slider is moved, it will produce a new Year Month - put that Year Month in the hidden text box
jQuery("#end input:text").val(ui.values[1]); // This is the same as the above, but for the second value in the range
setTimeout("promptAction('finish')",3000); // Wait a few seconds, and dispatch the promptAction('finish'), which refreshes the page
}
        });

}); // End Ready
</script>


If there is anyone who could assist me with this POC...that would be GREAT!!

Thanks

ntreddy

Hi,

Did you get this to work?. If so could you please share the details? we need the same solution for one of our report in cognos 10.2 version.

Thanks,
NT Reddy