Creating report parameters for OLE DB data sources

Use to create report parameters that will be used with OLE DB data sources.

You must perform this procedure for certain numeric and date fields, and if you do not perform this procedure, you will be prompted for parameters by Reporting Services and Crystal Reports. You do not have to perform this procedure for parameters that are passed within OLE DB, those parameters contain a ? or ?paramname as a filter value within the OLE DB query.

Note the following:

  • For numeric fields, if you use integers other than monetary value, count, or an integer that will not be used in an equation in fields as parameters, you need to use the Type Conversion function CDbl, number, currency, string, or boolean, in the record selection formula.
  • For date fields, if you use date fields for report parameters, you need to use the Date/Time function CDateTime(date) in the selection formula.
  1. Access the Crystal Report Designer. This procedure will use a report field called COMPANY.
  2. Create or open a report that will use the OLE DB data source.
  3. Select Expert.
  4. From the report field listing, select the COMPANY report field. Click OK. The Select Expert screen is displayed.
  5. Click Show Formula. The screen expands and the formula is displayed in the Formula text box.
  6. Add the CDbl() function to the formula. For example, CDbl ({Command.COMPANY})={?Company}).
    Note: If you are modifying a date formula, use the CDateTime. For example, CDateTime({EMPLOYEE.ADJ_HIRE_DATE)}={?Adj_Hire_param}.
  7. Click OK.