Skip to main content
A newer version of this page is available. .

Conditionally Filter Report Data

This document describes how to filter a report’s data based on a specific condition.

  • Switch to the Field List, right-click the Parameters section and add a new report parameter.

    field-list-add-parameter

  • Specify the parameter’s description in Print Preview and set its type to Number (32 bit integer).

    parameter-min-unit-price

  • Select the report’s detail band and switch it to the Visual Studio Properties window. Navigate to its Expressions section and click the Visible property’s ellipsis button (you can find it under the BeforePrint event’s category if you are using the ExpressionsAdvanced binding mode).

    detail-band-expression-visible

  • This invokes the Expression Editor where you can specify the required filter expression. For example:

    detail-band-expression

    The expression above makes the Visible property return True or False depending on whether the unit price is below the specified parameter value.

When switching to Print Preview, you can make the report display only products with the unit price above the specified parameter value:

conditional-filtering-preview-result