A static filter, also known as a basic filter, is configured in Database Connection Setup, and will always filter using the same criteria for the condition.
Dynamic filters use criteria from a Query Prompt. To learn how to create a dynamic filter please review Using a dynamic filter.
For more information about filters please review the following resources:
Creating a basic filter
Filters are added in the Database Setup. The following exercise will walk you through filtering data using a sample Excel spreadsheet.
- Place Sample.xlsx in C:\Database Filter\
- Create a new BarTender document and create a database connection to Sample.xlsx. Please review Getting started with database connections for help creating the database connection.
- Click File > Database Connection Setup
- Select Filter
- You should now see all the data since a filter has not been added yet
- Click the icon to add a filter condition
The examples below show you various conditions that can be used to filter the data.
If you only need to print records for Seattle, you can create a static filter that shows records whose City is Seattle.
- Set the filter condition to City Equals Seattle and click Apply Filter
- You can see the result returns four records for Seattle
Multiple Conditions Using AND
We can add another condition to the filter using a conditional joiner AND so the filter returns results where the City is Seattle and the Part Number is AW1.
- Click the icon to add another filter condition
- Set the second condition to Part Number Equals AW1 and click Apply Filter
- Now only two records are returned; all records where the City is Seattle and the Part Number is AW1. Since we used the AND joiner, both of the conditions need to be satisfied for the record to be returned.
Multiple Conditions Using OR
If you want to show all results where either the City is Seattle or the Part Number is AW1, then you can change the AND joiner to OR.
- Click and select OR
- Click Apply Filter. Now seven records are returned; All records where the Part Numbers is AW1, and all records where the City is Seattle. Since we used the OR condition, only one of the conditions needs to be satisfied for the record to be returned.