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

JavaScript to select report output from prompt page

Started by ck1, 01 Mar 2010 04:10:04 PM

Previous topic - Next topic

ck1

We are trying to give the users the ability to select their output format (PDF, XLS, CSV, HTML) at run time on their prompt page.  The code exists to generate the selection prompt, and put the appropriate value into a variable for use by a custom button.

This is a piece of code from the custom button, for your reference.  Then the button is clicked it calls go_Prompt().  It works partially, in that it calls up the report in the correct format.  The problem is that it clears any other selected prompts on the page.  It would appear that it's reloading the prompt page right before calling Cognos Viewer. 

function go_Prompt()
{
                     javascript:gotoUrl();
}

function gotoUrl()
{
var obj=document.all['OutputFormat'];
window.onload(gCognosViewer.getRV().viewReport(obj.options[obj.selectedIndex].value));
}


Does anyone know why it reloads all of the other prompts before opening Viewer?
Has anyone made this work in their environment?

Thank you!

paddhu

I have not faced such a requirement and so not faced your scenario. Anyways now that it is behaving in the way you have told, let's see how we can maintain the prompts. What you can do on the onclick code is get the value of all the prompt parameters selected and pass it to the report.