If you are unable to create a new account, please email support@bspsoftware.com

 

Dynamic selection of Report Output (PDF,EXCEL,HTML) at runtime in Report Studio

Started by Abhishek_Gaur, 24 Nov 2011 09:47:08 PM

Previous topic - Next topic

Abhishek_Gaur

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>

Lynn

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.

MFGF

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
Meep!


MFGF

Meep!

Abhishek_Gaur

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 ??

Lynn

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.

barrysaab

Boy! Cognos getting on to me!!!