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

Dynamic Prompt with default value

Started by RiRo, 11 Dec 2013 03:25:53 AM

Previous topic - Next topic

RiRo

Hi

I use a prompt to choose a reportperiode for a Report, which is in this Format 'yyyy-mm'.
I can manually select this values and the Report works fine.

So now I want to schedule this Report, so that users get the Report automatically.
So I have to assign a Default value, which is the last or better the next to last Periode.

How can I make this?

Thanks
Rob

MFGF

Change the prompt to a filter that is not prompted - that's the easy way :)

MF.
Meep!

RAHIOUI

Hi Riro,

1.  Select the value prompt and defne its sorting such that the Shipment Month Keys
are populated in descending order.
2.  Now, as we know the dimension is always populated up to the current month and
values are sorted in descending order, we will write a code that selects second value
from top by default.
3.  For that, add an HTML Item just before the Shipment Month value prompt. Defne the
HTML as: <span id = 'A1'>
4.  Add another HTML item just after the value prompt and defne it as: </span>
5.  Now add another HTML item to the prompt page footer, just after the Finish button.
6.  Defne it as:
<script>
var theSpan = document.getElementById("A1");
var a = theSpan.getElementsByTagName("select");   /* This stmt
return an array of all value prompts within span */
for( var i = a.length-1; i >= 0; i-- )  /* now loop through the
elements */
{   var prompts = a;
if( prompts.id.match(/PRMT_SV_/))
{  prompts.selectedIndex = 3;  } /* This selects the second
options from top */
canSubmitPrompt();
}
</script>
7.  Execute the report to test it.