COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: DNA on 28 Mar 2016 03:04:16 PM

Title: Dynamic Sorting on Column Headings in Two (2) Lists on 1 Report
Post by: DNA on 28 Mar 2016 03:04:16 PM
Hey Everyone,
I'm in a pickle & out of options so Hopefully there is a Cognos Java Guru out there and you are able to help a fellow CogNerd out! (New to Cognos...)
Using Cognos 10.2.2

Client wants:

I found this article that works perfect for one list on one report (not 2 lists on 1 report): http://www.cognosonsteroids.com/2012/04/sort-list-report-dynamically-using.html

However when I start inserting the HTML code on the headers of the (Completed List), it only sorts the (Completed List) when I start clicking the (In Process List) header hyperlinks.
I need for both lists to sort dynamically on their own.

This is what I have tried:
- nothing works. :-\

Can someone please help?
Thanks a ton!
Title: Re: Dynamic Sorting on Column Headings in Two (2) Lists on 1 Report
Post by: bdbits on 29 Mar 2016 02:07:31 PM
Repeat after me: Java is not javascript.

Now that we have that out of the way... the script as provided is using getElementById() and getElementByTagName() so as is, it will only work with one list. It could be modified/expanded to support multiple lists, but you will need javascript skills you do not appear to have yourself. There are lots of generic table-sorting scripts around (often part of frameworks like jquery), but you will still need to understand javascript and the HTML DOM as implemented by Cognos.

Sorry but there is no simple answer here. You really need to find someone who can write/modify javascript, or if you have it the time to learn to do so yourself.