Profile

Monday, 20 June 2011

Crystal Report: Build a User prompt for filtering report data

As a report builder, quite often I built predefined filters for the reports.  Sometimes report users like to filter the report data as they saw fit. In that case a dynamic prompt is needed so user can click and select  data to be displayed on the report.
in this example, a dynamic prompt is needed to allow report viewers select data by State 
1. From the Crystal Report Design View, click on Parameter to create new parameter.

2. From Parameter window, select "Dynamic" as the List of Values (or, you can specify a static list for user to select.) on Choose a Data Source, select "State" (you can select any column field of a table where Crystal Report is connected to.)

3. After you specify the value, the parameter is named as "?by State"


4. After click OK a new parameter "By State" is created, drag to the Report area.

5. On Crystal Report Design View, click on the icon "Selection Expert" to create a filter. Click on the drop down menu to select the parameter {?By State} as a filter, then OK.


6. That's it. a user prompt is created on the report, when users open this report, they will first see this window prompt for State selection.

7. After a state been selected, the report will open with specific data displayed.