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 Cloumn Sorting without JS

Started by sram007, 24 Feb 2011 07:00:59 AM

Previous topic - Next topic

sram007

Hi ,
In my list report i have 4 colums like Column1,Column2,Column3,Column4.
& In my Value prompt  i had added the 4 column names  as satic choice,
When im selecting the Colum1 in value prompt,it sould be sorted descending ,like that i should able to sort the 4 colums,
i Want to achieve this without using  JavaScript can anyone please help me with the expression code..
Cheers,
Ram

Lynn

You could try this:

  • Set the sort on your list to column1 descending
  • Copy the list and paste it on the page three times so you have four lists
  • Change the sort on the second list to column2; third list to column3; etc.
  • Create four boolean variables such as sortColumnA with expression ?promptchoice? = 'ColumnA' ; sortColumnB with expression ?promptchoice? = 'ColumnB' ; etc
  • Apply the appropriate variable as a render variable for each list
When the report runs only one of the lists will render depending on the user's selection.

CognosPaul

Another way:

Create a field in the query called SortKey. The expression should be:
#sb(prompt('promptchoice','token'))#

Sort your list by that field.

Make Column1 the default value for the prompt.

When the report runs SortKey will resolve to [Column1], and the list will sort based on that. When the user selects another field, Column2 for instance, the macro will resolve to [Column2].

Lynn

Quote from: PaulM on 24 Feb 2011 08:58:22 AM
Another way:

Create a field in the query called SortKey. The expression should be:
#sb(prompt('promptchoice','token'))#

Sort your list by that field.

Make Column1 the default value for the prompt.

When the report runs SortKey will resolve to [Column1], and the list will sort based on that. When the user selects another field, Column2 for instance, the macro will resolve to [Column2].


SOOOO much better!!

PRIT AMRIT


sram007

Thanks for your reply guys ..
Regards,
Ram