Can anyone exactly tell how to create a dynamic where clause in reports and how to use it in reports using lexical parameters?

I created the dynamic where clause in after parameter trigger and then created a _where_clause parameter and in main query I used &p_where_clause.
When I am trying to print the value of _where_clause in before_report or after_parameter trigger then it throughs exception.
I don't if my dunamic where clause is working or not.

Thanks
Saritha