COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: raj.kanag.s on 20 Apr 2012 10:22:48 AM

Title: ISSUE!---- Java script to pass parameter from one report to other
Post by: raj.kanag.s on 20 Apr 2012 10:22:48 AM
Hi Guys,
         I am using a Javascript to pass parameter from one report to other. It looks like parameter is being passed to the other report (I kept "paramdisplay" in the second report to check this) but the actual report is coming as blank eventhough there is data corresponding to the parameter value.

Below is the script:

********* ********* **************** *****************
<script language=javascript>

function showDetail()
{
var link = event.srcElement;
var sProductType = link.productLine;
var cell = link.parentElement.parentElement;
var iframe = (cell.getElementsByTagName("iframe").length > 0) ? (cell.getElementsByTagName("iframe")[0]) :(null);

if(link.innerText == "Hide Details")
{
link.innerText = "Show Details";
if(iframe != null)
{
iframe.style.display="none";
}
}
else
{
link.innerText = "Hide Details";
if(iframe == null)
{
//Set up the IFrame
iframe = document.createElement("iframe");
iframe.style.height="200px";
iframe.style.width="500px";
iframe.frameBorder="0";
iframe.scrolling="no";
//Create a URL
var src = "https://devbicrp.jnj.com:443/cognos10crp/cgi-bin/cognosisapi.dll?b_action=cognosViewer&ui.action=run&ui.object=%2fcontent%2ffolder%5b%40name%3d%27CORPORATE%27%5d%2ffolder%5b%40name%3d%27HRA%27%5d%2ffolder%5b%40name%3d%27Reports%27%5d%2ffolder%5b%40name%3d%27Development%27%5d%2ffolder%5b%40name%3d%27Organization%20Reporting%27%5d%2freport%5b%40name%3d%272%27%5d&ui.name=2&run.outputFormat=&run.prompt=true";
src += "?b_action=cognosViewer";
//src += "&ui.action=run";
src += "&cv.toolbar=false";
src += "&cv.header=false";
//src += "ui.object=%2ffolder%5b%40name%3d%27My%20Folders%27%5d%2ffolder%5b%40name%3d%27HR%20Integration%27%5d%2ffolder%5b%40name%3d%27Org.%20Reporting%27%5d%2freport%5b%40name%3d%27DETAIL%27%5d";
src += "&run.prompt=false";
src += "&p_DEP=";
src += escape(sProductType);
//set the IFrame URL
iframe.src = src;
//Add the IFrame to the footer
cell.appendChild(iframe);

}
iframe.style.display = "";
}

}
</script>
***************************** ************** **************

Thanks,
Raj
Title: Re: ISSUE!---- Java script to pass parameter from one report to other
Post by: Lynn on 20 Apr 2012 10:52:40 AM
Why not use drill through for this?
Title: Re: ISSUE!---- Java script to pass parameter from one report to other
Post by: raj.kanag.s on 23 Apr 2012 05:14:24 AM
Lynn,
         We wanted to show like as in attachment.

Thanks,
Raj
Title: Re: ISSUE!---- Java script to pass parameter from one report to other
Post by: pricter on 23 Apr 2012 06:27:37 AM
In the document in the first src puts only the cognos location
var src = "http://rmvmsc84/cognos8/cgi-bin/cognosisapi.dll";
but you use the whole path
Did you try to put only the above
var src = "https://devbicrp.jnj.com:443/cognos10crp/cgi-bin/cognosisapi.dll"
and uncomment the path