COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Anantula on 22 Oct 2012 05:00:15 PM

Title: Keep a Tree Prompt Open to Your Current Selection After the Report Execution
Post by: Anantula on 22 Oct 2012 05:00:15 PM
Hi All,

Every time I drill down, select a value and run the report, the tree prompt folds back up to the top and I have to start all over again. Is there any way to keep a tree prompt open to your current selection after the report executes? (Java script?)

We are using Cognos 8.4 and cube based reports. Can some one help us?

Thank you very much.
Title: Re: Keep a Tree Prompt Open to Your Current Selection After the Report Execution
Post by: Anantula on 31 Oct 2012 09:36:42 PM
Hi All,

I have been playing around with Java script, had a little success but not achieving what I want. When I keep below script, the Tree Prompt is keep open, but unable to select any value from tree prompt from 2nd time onwards. Can some one suggest any ideas?

Prompt name: Time

Script:

<SCRIPT LANGUAGE=javascript>

var nodes = window.treeTime.getRootNode().getChildren();
var opt= window.treeTime.getRootNode().getChildren().length;
for (i=0; i < opt; i++)
{
                if ((nodes.hasSelectedChildren() == true) && (nodes.isOpen() == false)) {
                 nodes.setOpen(true); 
                 nodes.fetchChildren(true);
}
}
</script>

Thank you.