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

Using prompt to navigate to a URL

Started by pmartins, 02 Oct 2012 12:00:59 PM

Previous topic - Next topic

pmartins

Hi everyone,

A client posed an interesting challenge to me today: a report that we have should have a prompt, with a set of values that, when clicked, should take us to a new report, in a new page. Meaning, use a prompt, rather than a hyperlink, or drill through, to navigate from one report to another.

Has anyone done this before? My guess is that we can use the useValue/displayValue of the prompt to store the URL/report name, and then some Javascript to, on selection, pick the URL and open a new browser window with that same URL.

I'm just not good enough with Javascript to sort this last part out... Can anyone help? :-)

Kind regards,
Pedro Martins

pricter

I have Succedd this by doing the following
1.Add a name to your prompt (in my example is Period01)
2.Add a Html item with the following code
<script>
document.formWarpRequest._oLstChoicesPeriod01. onchange= function ShowHide()
{
dropdown=document.formWarpRequest._oLstChoicesPeriod01;
for (var i=0; i <dropdown.options.length; i++)
{
if (i >1 && dropdown.options[i].selected==true) //skip the first two default options Cognos generate
{
prmtr=dropdown.options[i].text;
page="https://www.google.gr/search?q="+prmtr;
window.open(page,'mywindow','width=500,height=500');
}
//alert (dropdown.options[i].text) ; //call alert function to display the text value of the option
}
};
</script>


In my example when the user change the prompt a google page open with results that are related to the selection of the prompt.