Example 7. Automatic filtering by range

Top  Previous  Next

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:

 

dialogExample7_1

 

Now, in the same way, add one more "Products.UnitPrice" column and correct its header:

 

dialogExample7_2

 

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.

 

dialogExample7_3