In my report I have an optional prompt and filter on Sales Rep. I need to create a conditional block where if a sales rep is selected it will just show the sales rep name and if none is selected then it will show a drop down list of sales reps. In order to do this I need a report variable that indicates whether a sales rep was selected. So it seems that I need a query with a data item for the sales rep parameter, but if I define it like #prompt( 'pSalesRep', 'string', '' )# with an empty default value then the sales rep prompt becomes mandatory. So how can I create a variable that will indicate whether a sales rep was selected for this optional prompt? Thanks.
Try using this instead:
#prompt( 'pSalesRep', 'string', 'NONE' )#
and check for 'NONE' instead of an empty string.
But if I put 'NONE' as the default value then won't my filters by defalt filter for the value 'NONE'?
I just tried your suggestion and it works great. Thanks!
had to go check a few things...
I might be over complicating it.
If you set up a boolean condition on whether your prompt is null or not - ParamValue('sales_rep') is null
and then set your conditional block to show your drop down when it is null (Yes) and hide it when it is not null (No).
No SQL involved.