Dotnet Report Builder provides the users the ability to create custom filters in any report. This article will focus on the option to force users to apply a filter when building reports.
When setting up a database column, the system lets you pick the following options:
- Require Filter if Column is selected
- Require Filter if Table is selected
- Restrict Filter Date Range
1. Require Filter if Column is selected
This option implies that when a user selects this column when designing a report, the system will force them to select a value for this filter.
This can be very useful in scenarios where you don’t want the user to select too much data, or in cases where the business requirement is to select a specific type or range.
As demonstrated in the screenshot, the label shows that the filter is required, and the user is not able to remove it, and they must select a value for the filter in order to run the report.
2. Require Filter if Table is selected
“Require Filter if Table is selected” is very similar to the field option, the difference is that the filter is required if the user picks any field inside the table.
3. Restrict Filter Date Range
This option applies to date fields only, and ensures that when the user choses to use this field as a filter, they are only able to select the dates within the specific range. For example, if you set the restriction to 1 Month, and the user tries to pick “This Year” in the filter range, the system will not let them continue.
This option is very useful when you want to restrict users from querying too much data when running the report, and you can combine it with the first 2 options as well, to really force the user to select a date range when querying data.
Below are the two examples shows that range can only be this month, or in selection of date range it also should be with in one month, in order to run the report.