COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Sundaramoorthy on 26 Feb 2016 08:36:42 AM

Title: Reorder the selected columns during report execution
Post by: Sundaramoorthy on 26 Feb 2016 08:36:42 AM
Hi All,

I have a scenario like whatever the columns it got selected in prompt page, user should have the ability to reorder the selected columns in prompt page itself & that same order need to get rendered in report also.

I have been goggling for a while now & not able to find the exact approach for this scenario

Is it possible in report studio? Please suggest..

Title: Re: Reorder the selected columns during report execution
Post by: BigChris on 29 Feb 2016 02:19:23 AM
Well, I guess you could do it, but it would be messy and a lot of hard coding...I can't think of a wy to do it dynamically (javascript might make it possible, but that's not my area). In your prompt page you'd need a prompt for each column, into which the user would type a number for the column position. They'd need to make sure they only key in a number once. Then for each column you'd need a calculation that looks something like (for the first column):

CASE
?pItemNumber? = 1 then [Item Number]
?pDescription? = 1 then [Description]
?pRegion? = 1 then [Region]
?pSalesQty? = 1 then [Sales Quantity]
?pSalesValue? = 1 then [Sales Value]
Else Null
END


Then for your second column you'd have:
CASE
?pItemNumber? = 2 then [Item Number]
?pDescription? = 2 then [Description]
?pRegion? = 2 then [Region]
?pSalesQty? = 2 then [Sales Quantity]
?pSalesValue? = 2 then [Sales Value]
Else Null
END


And so on. You'd need to check the performance etc. and I don't know if it would complain about mixed data types...but it might be worth an experiment.
Title: Re: Reorder the selected columns during report execution
Post by: Sundaramoorthy on 29 Feb 2016 04:41:57 AM
Hi BigChris,

Thanks for your information. As of now, i have implemented dynamic column logic in the report & it should retain in the report. On top of that, i need to have this reordering of columns.Please find attached the sample xml for this.
Title: Re: Reorder the selected columns during report execution
Post by: BigChris on 29 Feb 2016 05:30:28 AM
Good luck with that - the dynamic column selection should run in parallel to the sequencing, assuming you've used render variables of course.