COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: jampani on 20 Jun 2012 01:52:03 PM

Title: By a mouse click on the Column value, Flipping column values dynamically!!!!!!!
Post by: jampani on 20 Jun 2012 01:52:03 PM
I have a report query with three columns employee id(1,2,3) , employee name(A,B,C), employee salary($100.00,$200.00,$300.00). But in my report I pulled two columns employee id and salary. 

Now the question is when I click on the value "1" it should show me the name of the employee [i.e., the cell value needs to be dynamicall flipped to employee name "A".
I did some thing with tool tips. 

But the objective  is when we click on a particular value it should be flipped to employee name dynamicall.

Is it possible?  If yes, how.  Can somebody focus some light and give me some explanation that we have any work arounds to do so.

Thanks
J
Title: Re: By a mouse click on the Column value, Flipping column values dynamically!!!!!!!
Post by: pricter on 20 Jun 2012 02:33:04 PM
From your post it is not clear to me if you want to filter your list or just change the text

If it is the second,
you can achieve that with the use of javascript and take advantage of html items.

If you google it you will find numerous examples of how to change the text using javascript.

Title: Re: By a mouse click on the Column value, Flipping column values dynamically!!!!!!!
Post by: jampani on 20 Jun 2012 03:52:55 PM
First of all thanks for your quick response.  Yes I am looking for the second Scenario. I don't have much luck to find the Java Script files to change the text.  Would you mind to share me the Java Scripts for to get rid of my issue?

Thanks
Jampani


Title: Re: By a mouse click on the Column value, Flipping column values dynamically!!!!!!!
Post by: kado on 20 Jun 2012 06:37:51 PM
A couple other options:

1) Use a Value Prompt to swap between 2 conditions (1: the ID with salary 2: the name with salary)

(a) create a String Variable with the Expression ParamDisplayValue('Swap') --> Add Values 1 and 2
(b) create a list report for each condition
(c) add a value prompt to your report and Create a new parameter named 'Swap' (no parametized or query necessary)
(d) add static choices 1 and 2 (with an auto-submit and default to 1)
(e) associate each list report to a Render Variable for the Expression Swap and the correct display

2) Build 2 reports and use a drill thru from one to the other

Cheers
Title: Re: By a mouse click on the Column value, Flipping column values dynamically!!!!!!!
Post by: pricter on 21 Jun 2012 04:07:12 AM
I found a javascript at the following location

http://brockangelo.com/2009/06/19/replace-text-on-click-using-javascript/ (http://brockangelo.com/2009/06/19/replace-text-on-click-using-javascript/)

If you play a lit bit with this I suppose you will have the desirable outcome