Home > DeveloperSection > Beginner > Parameter Field in Crystal Report

Parameter Field in Crystal Report


Crystal Report Crystal Report 
Ratings:
0 Comment(s)
 22164  View(s)
Rate this:

Parameter Field in Crystal Report

There are multiple ways of passing parameters to the crystal report. This article focuses on the design time approach to attach parameters.
If you have a Crystal Reports with various product details and you need to display the product details according to Product Id, passing the parameter at runtime, then in these types of situations you can use the Parameter Field in Crystal Reports.

Parameter Field in Crystal Report

The above report simply displayed all the records from the Products table. This is because we have not yet configured the Select Expression and the Report Parameters. Let us add a parameter to the report. Go to the report, right click and select Field Explorer. This will load the field explorer tab where you can add a parameter to the report. Now, right click on the Parameter Fields and add a new parameter as shown in the screenshot below.

Parameter Field in Crystal Report

After creating you have to drag the parameter field from the field explorer and drop it into the section details of the crystal report as shown in the screenshot below.

Parameter Field in Crystal Report

The next step is to add a Record Selection Formula. The record selection formula option is found under the Special Fields option. Right click on the record selection formula and add it to the report. Next, right click on the record selection formula you just added to the report and click on Select Expert.

Parameter Field in Crystal Report

The next screen shows the filter criteria. We are matching the productID parameter field with the product_id in the Product table.

Parameter Field in Crystal Report

Select the OK button to close the Select Expert window.

Now, run the application again and you will notice that the page prompts you to enter the parameter field, which in this case is the Product ID.

Parameter Field in Crystal Report

When the OK button is clicked you will see the results of Product ID.

Parameter Field in Crystal Report


Don't want to miss updates? Please click the below button!

Follow MindStick