Example 7. Automatic filtering by range
We will show with a report from the previous example, how to print products having the cost in the indicated range. For that we will add a dialogue into the report and drag Products.UnitPrice
data column into it. After that we will correct the label text:
Now, in the same way, add one more Products.UnitPrice
column and correct its header:
That is all we need to do, the rest of the work FastReport has done: connected the controls to the data column and set up their FilterOperation
properties. The first control has got FilterOperation = GreaterThanOrEqual
, the second - LessThanOrEqual
.
Run the report and indicate the values, for example from 20 up to 30. When pressing the "ОК" button, a report will be built. It contains products having values in the indicated range.