COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Abhishek_Gaur on 24 Nov 2011 09:47:08 PM

Title: Dynamic selection of Report Output (PDF,EXCEL,HTML) at runtime in Report Studio
Post by: Abhishek_Gaur on 24 Nov 2011 09:47:08 PM
Hi,
I have been able to use a java script code to handle the runtime selection of report output. But the problem that I am now facing is, that if there are any filter prompts in this new prompt page, then the selection of the prompts is ignored and the PDF/Excel/HTML report that opens, has all the records. Any ideas anyone how to tackle that? I guess the problem is because of the function  <<< window.onload(gCognosViewer.getRV().viewReport( >>> which is ignoring the filters ....

<html>
<head>
<script language="javascript">
function gotoUrl(value)
{
Var1 = ""
if (value=='Excel2002') {
window.onload(gCognosViewer.getRV().viewReport('XLWA'));
} else if(value=='PDF'){
window.onload(gCognosViewer.getRV().viewReport('PDF'));
}
else if(value=='Web'){
window.onload(gCognosViewer.getRV().viewReport(''));
}
}
</script>
</head>
<body>

<!-- <select name="singleXLS
OnChange="javascript:gotoUrl(this.options[this .selectedIndex].value)"> -->





 
Select display format
<input type="radio" value="Excel2002" name="ExcelOptions" onClick = "Var1='Excel2002'">View in Excel 2002</input>
<input type="radio" value="PDF" name="ExcelOptions" onClick="Var1 = 'PDF' ">PDF</input>
<input type="radio" value="Web" name="ExcelOptions" onClick="Var1 = 'Web' ">Web</input>

 
 
 
 
<button value="Finish" name="Finish" Onclick="javascript:gotoUrl(Var1);">Finish</button>
</select>
</body>
</html>
Title: Re: Dynamic selection of Report Output (PDF,EXCEL,HTML) at runtime in Report Studio
Post by: Lynn on 28 Nov 2011 08:21:19 AM
I was trying to attach a document that shows a drill through method to achieve this, but get an error:

"The attachments upload directory is not writable. Your attachment or avatar cannot be saved"

I'll see if I can find it posted elsewhere.
Title: Re: Dynamic selection of Report Output (PDF,EXCEL,HTML) at runtime in Report Studio
Post by: MFGF on 28 Nov 2011 08:53:01 AM
Hi Lynn,

You could perhaps upload it to a public site such as Skydrive and add a link to it? If you don't have that facility I can put it up for you?

Cheers!

M
Title: Re: Dynamic selection of Report Output (PDF,EXCEL,HTML) at runtime in Report Studio
Post by: Lynn on 29 Nov 2011 03:15:33 PM
This might work (thanks to the muppet):

https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B6m-USVf1p1nNzdiMTZkMzUtYjY4Ni00OTlhLWIwNWUtOTliY2YxOTVmYTJi&hl=en_US
Title: Re: Dynamic selection of Report Output (PDF,EXCEL,HTML) at runtime in Report Studio
Post by: MFGF on 01 Dec 2011 04:49:08 AM
Quote from: Lynn on 29 Nov 2011 03:15:33 PM
This might work (thanks to the muppet):

https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B6m-USVf1p1nNzdiMTZkMzUtYjY4Ni00OTlhLWIwNWUtOTliY2YxOTVmYTJi&hl=en_US

Mwahahahaha! You are now eternally in my debt! Oh, no, wait! You bought me a beer once so maybe not! :)
Title: Re: Dynamic selection of Report Output (PDF,EXCEL,HTML) at runtime in Report Studio
Post by: Abhishek_Gaur on 01 Dec 2011 10:34:52 AM
Thanks Lynn. This works fine. Its just that I wanted to make this work on a single prompt page. Not sure if that is possible or not ??
Title: Re: Dynamic selection of Report Output (PDF,EXCEL,HTML) at runtime in Report Studio
Post by: Lynn on 02 Dec 2011 09:23:17 AM
I think I had to have the second prompt page because it is doing a drill through back to itself, so all the prompt selections have to be made prior. A user can't click the link without responding to the prompts.

Maybe if all your prompts are optional it might work?

Also, I did this quite a while ago and haven't looked to see if newer versions offer other techniques to achieve this requirement.
Title: Re: Dynamic selection of Report Output (PDF,EXCEL,HTML) at runtime in Report Studio
Post by: barrysaab on 02 Dec 2011 12:30:22 PM
Thanks,Lynn.Appreciate it.