COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sg24 on 16 Aug 2011 04:41:05 AM

Title: Display Message below the text box prompt in the prompt page
Post by: sg24 on 16 Aug 2011 04:41:05 AM
Hello Folks,

I have to display a mesage called ('Emp does not exists') when the emp code is not present the in table
below the text box prompt in the prompt page.

The text prompt is there to enter a emp id.

eg , A008890

i tried to use the code in the report expression in the text item as

CASE WHEN (paramdisplyvalue ('emp_id') not like [MAIN_QUERY].[MATCLE])
THEN ('The employee does not exists')
END

It says invalid expression. :(
Any idea how this can be achieved? please let me know.
Title: Re: Display Message below the text box prompt in the prompt page
Post by: blom0344 on 16 Aug 2011 02:49:49 PM
You cannot reference SQL objects within a report expression like you are trying. The other way around is possible (Referencing a parameter value from SQL)

A possible solution is by using 2 prompts (using a reprompt to fill the second).
For the second prompt use a query that references the parametervalue of the first (use a filter expression) against the table

If the second prompt is populated then the value exists, a blank would indicate non-existence..
Title: Re: Display Message below the text box prompt in the prompt page
Post by: sg24 on 18 Aug 2011 03:40:13 AM
Thank you very much for the solution. I will try implementing the same.

Thanks,