Report filters are used to modify the content of the whole report. Multiple filters can be displayed in the sidebar or directly in the report as a special type of view. Each filter can have different functionality and appearance.
Creating Filters
Only report author or report editor can create report variables and set their default values. Every other user that has access to the report, can only change report variable values.
To create a new filter, open the Variables sidebar.
You can use 2 approaches when creating filters:
- Quick filters - Filters are created with default layout of multi-select boxes
- Creating filtering components - Layout of every filter is configured separately
Creating filter component
- Click on Edit button to enter Variables dialog.
- Select which type of component you would like to create. To create a filter component, select Filter.
- Optionally, change the identifier.
- Click on Add.
- Select which type attribute to use for filtering
- Select the condition (contains or doesn't contain)
- Optionally, select default value. See below.
- Optionally, edit the Advanced settings to change the appearance and functionality of the filter. See below.
- Save the filter
Setting default value
To set one or more default values, click on Default values and select values which should be used as default. These values will be preselected when the user opens the report for the first time or when the user resets the filters.
Defining the default values via formula
Available since BellaDati 2.9.11.
It is possible to dynamically calculate the default value. Expected return type is Array or single value, e.g.: [ 'abc', 'def' ] or 'abc'.
Example
def array = [] array << 'East' array << 'South'
Setting default value for date attribute
For date attributes, it is possible to configure the date value as day, week, month, quarter or year.
Using relative dates
By enabling the option Use relative dates, the users can set the default value dynamically by using relative dates. Following relative dates are available:
Relative date | Actual value |
---|---|
now | Current day |
actualDay | Current day |
actualWeek | Current week (first day of week) |
actualMonth | Current month (first day of month) |
actualQuarter | Current quarter (first day of quarter) |
actualYear | Current year (1st January of current year) |
Additionally, the value can be further modified by adding or subtracting certain amount of days, weeks, months etc., e.g. actualQuarter+1y-5d.
Modifier | Value |
---|---|
d | days |
w | week |
m | month |
q | quarter |
y | year |