Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

5.03 Entering Parameters when Running Reports

Entering Parameters when Running Reports

When a report has parameters, the user is prompted to enter values when the report is loaded, but before it is printed. After the user enters the values, the report is shown in the viewer or sent to the printer. Figure 5-5 is the Enter Parameter Values dialog box.



Figure 5-5. The Enter Parameter Values dialog box.

At the top is a description of what information can be entered. Below that is the prompt that is assigned to the parameter. The bottom of the dialog box is where the user enters the value(s) for the parameter field. Click on the Next button to go to the next field. Clicking on the Cancel button at any time cancels the report. Nor will it be displayed in the viewer. If the user refreshes the report, this dialog box gets displayed again.

Each parameter is shown separate from the others. If you select True for more than one parameter, only the most recent one will be True. The others will be reset back to False. Unfortunately, .NET doesn’t tell you that this is happening nor does it give any indication that the parameter is part of a mutually exclusive group. Once again, this is just another reason to manage default values within your .NET application and not rely upon the report.

If you run a report and get the error “Operation illegal on linked parameter” it is because a formula references a parameter, but that parameter isn’t used on the report. To fix this error, make sure that the parameter appears on the report.