COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Sonam S on 24 Jan 2017 07:25:31 AM

Title: macro prompt
Post by: Sonam S on 24 Jan 2017 07:25:31 AM
I have around 20 fields which user select on an application then those parameters are passed to cognos report. These fields can be of date type, string values. So i need to write case statement or ?? depending upon the type selected in prompt values will be displayed.
Any idea how I can do this?

Do let me know if more details are required.

TIA
Title: Re: macro prompt
Post by: CognosPaul on 24 Jan 2017 01:30:07 PM
Can you be more specific? What is expected when they select those fields? Are they expecting to see them in a list?

Take a look at this solution, you should be able to adapt it to your needs:
http://cognospaul.com/2014/09/14/prompting-fields-list/
Title: Re: macro prompt
Post by: Sonam S on 25 Jan 2017 02:49:28 AM
Thanks for link, i am going to see that as well.
here is how user sees on UI : see attached


Title: Re: macro prompt
Post by: CognosPaul on 25 Jan 2017 07:09:55 AM
It looks like a user can select one to twenty fields. The filter functionality in the screenshot is just to narrow down the fields?

If this is an external application, how is the Cognos report being called? iFrame? Direct link? RESTful CMS? Ultimately the link I provided before should do what you want. You simply pass p_field_1=[Namespace].[Dimension].[Field]&p_field_2=[Namespace].[Dimension].[Field2] and it will generate a list with the two columns.
Title: Re: macro prompt
Post by: Sonam S on 25 Jan 2017 07:16:52 AM
I am passing the values of fields using #prompts challenge is report is passthrough sql. I am not sure how to write "[Namespace].[Dimension].[Field2]" in #prompt#.