COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Nandini.t on 19 Jun 2017 06:29:58 AM

Title: Display the Paramater Values in the report one after ther instead commas
Post by: Nandini.t on 19 Jun 2017 06:29:58 AM
Hi Everyone,

I have a requirement where when I select multiple values in a prompt, those values should be shown on report page.
Usually Cognos displays the values with comma separated. But, my requirement is to display one below the other instead of comma separated.

Ex: If values A,B,C,D,E is selected in the prompt then on my report page it should be displayed as

A
B
C
D
E
instead A,B,C,D,E

If I use list to get this I need a separate query for this which reviewer is not accepting .
Please let me know if anybody have any other alternative solution for this.

Thanks in Advance !
Title: Re: Display the Paramater Values in the report one after ther instead commas
Post by: New_Guy on 07 Jul 2017 11:55:52 AM
Hi,
How many characters are the parameters, are they fixed length? if they are fixed length then place them in a block of fixed width and then they will appear one below the other with a comma at the end.

One more option is to use the same query item that is getting the parameters, from the main query that you are creating the list or crosstab and use it in the other list for displaying the parameter. you dont have to create another query for just this purpose.
Good luck
New guy
Title: Re: Display the Paramater Values in the report one after ther instead commas
Post by: bdbits on 07 Jul 2017 01:40:49 PM
Not somewhere I can test this out right now, but something like this might work to split up the elements where your prompt is called pValues.

#csv(split(',', 'pValues'))#
Title: Re: Display the Paramater Values in the report one after ther instead commas
Post by: CognosPaul on 07 Jul 2017 02:01:34 PM
I had a similar requirement once.

Create a new query and data item with the following expression:
#
sq(
'<ol><li>'+
join('</li><li>',split(';',promptmany('param','token')))
+'</li></ol>'
)
#

OR
#
sq('<div><span>'+
join('</span></div><div><span>',split(';',promptmany('test','token')))
+'</span></div>'
)
#


Then create a singleton based on that query, pull in a rich text item, and set the data item as the value for the rich text item.
Title: Re: Display the Paramater Values in the report one after ther instead commas
Post by: bdbits on 07 Jul 2017 02:05:56 PM
I'd go with what CognosPaul writes any day of the week.   8)