Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

4.27 Creating Dyanamic and Cascading Prompts

Creating Dynamic and Cascading Prompts

Creating a parameter that uses DCPs involves entering options in the same Create New Parameters dialog box that you learned about when we were discussing static parameters. The difference being that instead of choosing the Static option you will now choose the Dynamic option. When you do so, the dialog box changes to reflect new options.

Creating a parameter that uses DCPs has the same steps that you’ve already practiced earlier in the chapter. Create a new parameter by right-clicking on the Parameter Fields node in the Field Explorer and select New Parameter. Enter the parameter name and for the List of Values option select Dynamic. With DCPs you don’t specify the parameter’s data type. This is because the data type is determined by the field you choose from the database.

By selecting the Dynamic option, the dialog box immediately changes to reflect the new requirements for inputting DCPs. The data type option is disabled, a new Prompt Group Text input box is displayed, and the area for entering default values changes so that you can select a data source and pick the fields to display.



Figure 4-17. Creating a new parameter using DCPs.

The Prompt Group Text input box displays the overall question that the user is presented with when he is going to enter the parameter data. If this is a cascading prompt, it’s important to enter a question that clearly conveys to the user that he will be selecting from multiple lists before getting to the final one.

The option Choose a Data Source specifies which fields are the data source for the list of values. They display the data for the user to choose from. Keep the default option of New selected and click on the Insert button. It displays a list of the fields in the report’s data source. You have to select a field that is in a table already referenced by the report.

If the table you need isn’t being used by the report, you can go back and add it to the report. Click on the Cancel button, modify the report’s data source to include the necessary table, and then create the DCP again. The new table appears in the list of available data sources.