COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: JennyO on 02 Nov 2012 12:11:06 PM

Title: Parameters displayed on Report
Post by: JennyO on 02 Nov 2012 12:11:06 PM
I am trying to get the selected paraments from our prompt page to show on the report when it runs. I have the following espressiong string on the report that I thought would make it so that the paraments would be printed on the report, but it is coming up blank.

ParamDisplayValue("Starting Check Date") + ' - ' + ParamDisplayValue("Ending Check Date")

What am I missing?
Title: Re: Parameters displayed on Report
Post by: Lynn on 02 Nov 2012 01:26:13 PM
The parameter name should be in single quotes rather than double quotes. Make sure you are using a layout calculation and then drag in the parameter from the parameters tab to ensure you are not typing the parameter name incorrectly. You could also try ParamValue instead of ParamDisplayValue, but I wouldn't think that is the problem.
Title: Re: Parameters displayed on Report
Post by: JennyO on 02 Nov 2012 02:47:43 PM
Thanks for the help. It wasn't the quotes, as when I did it from selecting instead of typing, it came up with double quotes. But by selecting it the right way, I got what I needed. :)
Title: Re: Parameters displayed on Report
Post by: Bark on 13 Nov 2012 09:05:15 AM
The issue is that with your expression, if any of the parameters is null (not selected), the whole expression is null as "null + anything = null".

If you want to avoid this try:

IF(ParamValue('X') is missing) THEN ('') ELSE (ParamDisplayValue('X')) +
IF(ParamValue('Y') is missing) THEN ('') ELSE(ParamDisplayValue('Y'))

Regards,

Bark