COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: inu on 28 Dec 2016 11:59:33 PM

Title: How to develop date prompt display only month and year
Post by: inu on 28 Dec 2016 11:59:33 PM
Hi Team,

Is it possible to create date prompt which shows only year and month.
See the attached file.

Please suggest..


Regards,
Inam
Title: Re: How to develop date prompt display only month and year
Post by: dougp on 29 Dec 2016 12:15:52 PM
I don't see why it wouldn't be possible.  You'll probably need to have JavaScript use the PromptAPI (see the Report Studio User Guide) to write the chosen value to a Text Box Prompt.

I think this is the document I used when I created a custom control:  http://public.dhe.ibm.com/software/dw/dm/cognos/reporting/prompts_and_filters/advanced_prompting_ibm_cognosbi83_84.pdf (http://public.dhe.ibm.com/software/dw/dm/cognos/reporting/prompts_and_filters/advanced_prompting_ibm_cognosbi83_84.pdf)

You'd do well to use RequireJS (http://requirejs.org/ (http://requirejs.org/)) and AMD (https://github.com/amdjs/amdjs-api/wiki/AMD (https://github.com/amdjs/amdjs-api/wiki/AMD)) to implement your custom prompt control.  Take a look at the way JavaScript is used in Cognos Analytics 11.0.4 and later (https://www.ibm.com/communities/analytics/cognos-analytics-blog/javascript-support-in-interactive-viewer/ (https://www.ibm.com/communities/analytics/cognos-analytics-blog/javascript-support-in-interactive-viewer/)) so it won't be a complete do-over when you upgrade.

Be sure to post about your success with lessons learned.
Title: Re: How to develop date prompt display only month and year
Post by: Invisi on 06 Jan 2017 04:08:44 AM
What about using a dropdown list with the year/month attribute from your date dimension?