Add parameters to a report

Follow this procedure to add parameters and filter your report based on their values.

Sometimes it is useful have parameters in your report. Parameters can help you filter your data.

To specify a value that will be used to calculate other values, you can use calculated fields. For more information, see Add Calculated Fields to a Report.
  1. In the Field List window, right-click in the Parameters section, and click Add Parameter. Repeat this action to create the second parameter.
  2. In the Field List, click the FromDate parameter, and in the Property Grid set its properties as follows:
    Property Setting
    (Name) FromDate
    Description From:
    Parameter Type Date Time
  3. In the Field List, click the ToDate parameter, and in the Property Grid set its properties as follows:
    Property Setting
    (Name) ToDate
    Description To:
    Parameter Type Date Time
    Add Parameters
  4. You have now created two report parameters. Every time you preview your report, you will be asked to enter their values. The following instructions explain how to use these values to filter your report's data.

  5. In the Report Designer, click anywhere over the blank space to select the report.
  6. In the Property Grid, click the browse button (...) in the Filter String box.
  7. In the The FilterString Editor, define expressions using the parameters that you just created.
    Add Parameter
    The parameterized report is now ready.
  8. Make sure that the report's Request Parameters property is set to Yes.
    This is the default setting for the Request Parameters property. If this property is not set to Yes, the parameters will not be requested during the preview, and you will get a blank report.
  9. Switch to the Preview tab, and in the Parameters section, define the required values and click Submit.