COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: seballen on 20 Mar 2012 10:19:47 PM

Title: Is it possible to display an expression in a report?
Post by: seballen on 20 Mar 2012 10:19:47 PM
Similar to showing a parameter on the page, I'd like to print out an expression. Any way to do this?

Thanks,
Sasha
Title: Re: Is it possible to display an expression in a report?
Post by: blom0344 on 22 Mar 2012 02:55:43 AM
Expression?  Do you mean the definition of a calculated data-item?  Can you be more specific where you are after.
Title: Re: Is it possible to display an expression in a report?
Post by: seballen on 23 Mar 2012 03:48:16 PM
The report has certain diagnosis numbers hard-coded in a filter. I was wondering if I could display that filter on the report somewhere. I had just copied the codes in the filter into a text item at the top of the report, but every time I change the filter, I need to remember to update the text item.

Thanks,
Sasha
Title: Re: Is it possible to display an expression in a report?
Post by: blom0344 on 23 Mar 2012 04:46:39 PM
This is fairly simple when the filter is applied from a promptquery and the paramdisplayvalue is used to print the filter values in a report expression. I doubt you can do it the way you want even by Java code (as the filter can not be identified by name) , but sure like to be proven wrong
Title: Re: Is it possible to display an expression in a report?
Post by: seballen on 23 Mar 2012 08:10:14 PM
I'd love it if someone could prove you wrong too  :)

I display the paramdisplayvalue and even considered defaulting  the diagnoses codes in a parameter so I could display them, but it seems like a lot of overhead to worry about. The diagnosis codes are unlikely to change by user request...
Title: Re: Is it possible to display an expression in a report?
Post by: Lynn on 26 Mar 2012 07:39:15 AM
You can try to create a prompt control for your diagnosis codes and then specify default values as the ones you want....then just hide the prompt control since users don't need to see it or control the values. Then you can use the paramvalue or paramdisplayvalue function.

I'm reasonably certain this would work, but I didn't try it.
Title: Re: Is it possible to display an expression in a report?
Post by: S2000 on 28 Mar 2012 10:42:43 AM
I'd make a filter based on a paremeter.
Then on the prompt page create a hidden text prompt set to auto submit that contained the values I wanted to filter.
Then use the normal Paramdisplay to show the values of the parameter.

When you needed to change the filters you'd just change the defaults in the prompt rather than the text in the filter.

If there is no prompt page you can just put the prompt on the report page.