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

Dynamically Change the Order of Columns in Report

Started by cygnex, 17 Sep 2008 05:23:56 AM

Previous topic - Next topic

cygnex

I have seen many postings regarding the hiding of columns but in my research I have not found a method to change the order of display.  I would like a user to not only be able to choose which columns are displayed via prompts but provide an option to change the order of columns as well.

Has anyone done this?

blom0344

The report definition is stored as an XML type. XML is typically read from top to bottom, which means that the order in which columns are presented are derived from the order in which they appear in the XML structure. From that perspective it seems pretty hard to make a dynamic order work.
However it should be possible to design report pages with alternative order of columns and then just show the one that the user prefers.
But, perhaps someone has a work-around?

cygnex

Yes, thanks for the reply.  I think having separate reports with different orders is the only way to go.  People are complaining that my reports are not flexible enough, even though every report I create is also available via Excel.

the_xxx

Hi....

I have a quick solution. But I dont know how it can help you.

1. Create value prompts based on your requirement ( ex: 5 value prompts for if you have 5 columns in the report)

2. Add static choices to the value prompts.
    Ex: value_prompt_1 will have 5 static choices with all the column names.
          value_prompt_2 will have 5 static choices with all the column names....etc

    so, there will be 5 values prompts with all the column names in them.

3. Now, in the query create five data items with same custom calc to display the required column.

   ex:   if(?value_prompt_1? = 'One')
then([Query1].[one])
else
if(value_prompt_1 = 'Two')
then([Query1].[Two])
else
if(?value_prompt_3? = 'Three')
then([Query1].[Three])
else
.
.
.
.
.
.
if(?value_prompt_5? = 'Five')
then([Query1].[Five])
else


so. you will have 5*5 = 25 drevied feilds.

drag and drop them in list.

now...when you run the report ...give the column name in the prompt...it will show the same order in the report.


----thats it!!!
:)


     


cygnex

What can I say.  This is IT!!!!!!!!!!!!!!!!!!!!!!!!!!!

You saved me, thanks forever.


rpezzulo

The proposed solution may be helpful with a limited data set such as the 5 column report mentioned. This is not truly dynamic as you need to create a scenario for each possible case. What if the report had 100 possible columns? In that case, this approach would be extremely tedious. Has anyone implemented a similar solution with a truly dynamic sorting of columns? My data is setup so that I have column names and field orders in a table. Trying to determine how to implement dynamic selection and sorting of columns in a crosstab.