Example 6. Automatic filtering

Top  Previous  Next

In this example we will show how to add a filter into the report which prints a product's list from the "Products" table. We will filter the data according to the "Products.Discontinued" column.

 

The report looks as follows:

 

dialogExample6_1

 

Add a new dialogue into the report by pressing the btn11 button on the toolbar, and drag the "Products.Discontinued" column from the "Data" window onto the dialogue form:

 

dialogExample6_2

 

This is all we need to do - we did it just by two clicks. FastReport automatically connects the control to the data column.

 

Run the report and enable the Discontinued flag. After that, press the "ОК" button, and you will see the report which contains only products with the Discontinued flag:

 

dialogExample6_3