Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

4.10 Choosing the Data Type

Choosing the Data Type

After entering the parameter’s name, you have to select its data type from the dropdown list in the top right corner of the dialog box. A parameter stores information inside the computer’s memory as one of five possible data types: Boolean (True/False), String (text entries), Number, Currency (monetary values) and Date/Time. Selecting the right data type is critical because each data type has benefits and limitations.

Determining the proper data type is usually not very difficult because the data type is defined by how the parameter is going to be used in the report. For example, if you are asking the user a Yes/No question then the data type is Boolean. If you are asking the user to enter their User ID for security purposes, then the parameter is a String data type. Another example is a parameter used in the calculation of a sales commission. It must be a Number data type. Although the user could type in the same numbers using a String data type, you wouldn’t be able to use it in any calculations.

Most reports use parameters to compare their value to a database field. This is commonly done for the purpose of filtering data. The rule of thumb to follow is that the parameter’s data type must be the same as the field it is being compared to.