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 Month Prompt

Started by srinu_anu2007, 28 Feb 2014 11:29:01 AM

Previous topic - Next topic

srinu_anu2007

Hello Experts,

I found the below code in http://cognoswiki.wikispaces.com/Dynamic+Month+Prompt and can anyone explain how to paste in conditional explr. and the below code of that, where i have to keep

To start your prompt will need to default to the current month. This method will only affect the prompt on the page, it will not set the value before the prompt runs.

Your query should have a filter similar to:
[NS].[MonthCode] = #prompt('Month','token',timeStampMask($current_timestamp,'mm'))#

Paste this into your Condition Explorer:
<RSClipboardFragment version="2.0"><reportVariable type="boolean" name="renderMonth">
<reportExpression>ParamValue('Month') is null</reportExpression>
<variableValues>
<variableValue value="1"/>
</variableValues>
</reportVariable></RSClipboardFragment>

This is the prompt itself, paste it whereever you want the prompt to appear. It's worth mentioning that the months below are in Hebrew, if you use this you should make sure your report users learn the language:
<RSClipboardFragment version="2.0">
<selectValue parameter="Month" name="Month" autoSubmit="true">
<selectOptions>
<selectOption useValue="1">
<displayValue>ינואר</displayValue>
</selectOption>
<selectOption useValue="2">
<displayValue>פברואר</displayValue>
</selectOption>
<selectOption useValue="3">
<displayValue>מרץ</displayValue>
</selectOption>
<selectOption useValue="4">
<displayValue>אפריל</displayValue>
</selectOption>
<selectOption useValue="5">
<displayValue>מאי</displayValue>
</selectOption>
<selectOption useValue="6">
<displayValue>יוני</displayValue>
</selectOption>
<selectOption useValue="7">
<displayValue>יולי</displayValue>
</selectOption>
<selectOption useValue="8">
<displayValue>אוגוסט</displayValue>
</selectOption>
<selectOption useValue="9">
<displayValue>ספטמבר</displayValue>
</selectOption>
<selectOption useValue="10">
<displayValue>אוקטובר</displayValue>
</selectOption>
<selectOption useValue="11">
<displayValue>נובמבר</displayValue>
</selectOption>
<selectOption useValue="12">
<displayValue>דצמבר</displayValue>
</selectOption>
</selectOptions>
<style>
<CSS value="width:75px"/>
</style>
</selectValue>
<HTMLItem description="Dynamic Month">
<dataSource>
<staticValue>&lt;script&gt;
var form = getFormWarpRequest();
var MonthList = form._oLstChoicesMonth;
MonthList.remove(0);
MonthList.remove(0);
MonthList.removeAttribute("hasLabel");
&lt;/script&gt;
</staticValue>
</dataSource>
<conditionalDataSources refVariable="renderMonth">
<conditionalDataSource refVariableValue="1">
<reportExpression>'&lt;script&gt;
var form = getFormWarpRequest();
var MonthList = form._oLstChoicesMonth;
MonthList.remove(0);
MonthList.remove(0);
MonthList.removeAttribute("hasLabel");
MonthList.options[' + number2string(extract("month",date2timestamp (Today())) - 1) + '].selected = true;
&lt;/script&gt; '
</reportExpression>
</conditionalDataSource>
</conditionalDataSources>
</HTMLItem>
</RSClipboardFragment>

Lynn

You can find the condition explorer just beneath the page explorer and query explorer in the center vertical section.

The user interface section in chapter 2 of the Report Studio user guide explains this.

http://pic.dhe.ibm.com/infocenter/cbi/v10r1m0/index.jsp?topic=%2Fcom.ibm.swg.im.cognos.ug_cr_rptstd.10.1.0.doc%2Fug_cr_rptstd_id1270cr_rptstd_intrd_user_interface.html