Thursday, April 9, 2015

Static Choices


Requirment:
I have 4 countries in my database as USA, UK, INDIA, CHINA. In value prompts prompt control list, I want WESTERN_COUNTRIES, ASIAN_COUNTRIES instead of those country names. When I click on WESTERN_COUNTRIES,
1. From Query Explorer, open up the query for which the filters should be applied on.
2) Drag a Filter object from the Toolbox tab to the Detail Filters pane.
3) In the Expression Definition, enter the following including the #s
                        #prompt ('<prompt parameter>', 'token', '<default filter>')#
                       example: #prompt ('Countries', 'token', '[Country] IN ('USA', 'UK', 'INDIA', 'CHANA')#
4) Add a Value Prompt to the report .
5) Select the Value Prompt and in its Properties in the bottom right corner, go to the Static Choices property.
5) For each possible filter that needs to be applied, add a new Static Choice.  Make the Use the expression of the filter that you should be applied and the Display is what is shown to users in the prompt's drop down list.:

Use: <filter expression>
Display: <what is displayed to users>

Example :
Use: [Country] IN ('INDIA','CHINA')
Display: Eastern Countries

1 comment: