8.3.2 Adding a ProjectID Parameter Field

<< Click to Display Table of Contents >>

Navigation:  8. Introduction to Crystal Reports > 8.3 Upgrading Existing Reports to include ProjectID >

8.3.2 Adding a ProjectID Parameter Field

Introduction to Crystal Reports > Upgrading Existing Reports to Include ProjectID

In order to filter the data on the current ProjectID, we need to ask for the project name at run-time. This is done by inserting a parameter field into the report. The parameter field will cause a window to open when the report is run, asking the user to enter the required parameter values.

To insert a parameter field, click Parameter Fields in the Field Explorer with the right mouse button. From the right-click menu, select New…

image56_357

 

image56_358

In the ‘Create New parameter’ window:

Enter the name of the parameter (ProjectID). Make sure that Type is set to String (default).

Set ‘List of Values’ to Dynamic.

Click the Insert button, and select ProjectID from the dropdown list.

Click on the text Click to create parameter in the table. The text will change to ProjectID (name of the parameter).

Optionally, set Allow multiple values to True in the options list. This will enable the user to include several ProjectIDs in the selection. This could be useful when creating a report to include data from a project and its master-project.

Click OK to close the window.

IMPORTANT: You can only add a dynamic list of ProjectID-values to a parameter if you have installed Crystal Reports version XI. Users of earlier versions of Crystal Reports must skip step 2, 3 and 4 above.