Dynamic Cascading Prompts


Probably the most requested feature in years has been the desire to create Dynamic Cascading Promptsa report prompt that adjusts scope as it's being used, such as selecting Country, Region, and City and having only relevant Regions show for a selected Country and so on. This is now a powerful new feature in Crystal Reports XI. The following steps create a Dynamic Cascading Prompt that will allow the user to filter by Country, Region, and City.

1.

Start by opening the sample World Sales Report (the default location is C:\Program Files\Business Objects\Crystal Reports 11\Samples\en\Reports\General Business).

2.

From the Field Explorer, select Parameter Fields, and click the New button. Figure 11.6 shows the new parameter window.

Figure 11.6. The new parameter window with default properties.


3.

Start by giving the Prompt a name such as Dynamic Territory. From the List of Values radio buttons, choose Dynamic, and for the Prompt Group Text enter some helpful text for the report consumer (in this case type in Select the territory from the list).

4.

When you click the box immediately below the Value header, you are able to select a report field. Choose Country. Click the box below Country and select Region. Click the box below Region and select City. In the three boxes below Parameter (where the text reads Click to Create Parameter), click each box one time to generate the default parameter. When complete, the window should look like Figure 11.7.



Figure 11.7. The new parameter window with the properties described in step 4.


5.

Now with the prompt created, click OK to save it. Notice in Figure 11.8 that with this one step, three distinct prompts have been created. This will be used in the last step to filter the report.

Figure 11.8. The parameter list with the three new parameters.


6.

In order to use these new parameters to filter this report, open the Record Selection Formula window (Report, Selection Formulas, Record). Enter the formula you see in Figure 11.9. In order to limit the risk of typing errors, you can simply double-click the fields and prompts from the list of report fields.



Figure 11.9. Using the new prompt to filter the report.


7.

After clicking the Save and Close button, you should be prompted immediately to select a Country, Region, and City.

Note

Exploring the prompt window, you'll notice several useful features:

  • Only the top-level item is enabled. A user cannot select a Region or City until after they've selected a Country. The user is guided to the correct starting point.

  • As the user selects a Country (such as USA), only those Regions appropriate to that Country are listed (in this case, States). Also, only Region becomes enabled, and City will not become enabled until after a Region is selected.

  • If the user selects a Country, Region, and City but has not yet clicked OK and then goes back and changes the Country, both Region and City will be blanked out and City will again become disabled until the user picks a valid Region from the newly selected Country.

At all points during the process, the user is guided to where they need to go next.

8.

Select USA for Country, CA for Region, and San Diego for City. See Figure 11.10 to confirm your selection. Clicking OK runs the report and the report is filtered according to your selection.

Figure 11.10. Set values for the Dynamic Cascading Parameters.





Crystal Reports XI(c) Official Guide
Crystal Reports XI Official Guide
ISBN: 0672329174
EAN: 2147483647
Year: N/A
Pages: 365

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net