How to Set and Manage Printer Group Mapping Rules to Automatically Sort Printers
Overview
In BarTender 2019 and later, you can add sorting rules called Printer Group Mapping Rules to automatically sort printers into Printer Groups without any manual management needed.
This article will provide an overview for configuring these sorting rules.
Applicable to
BarTender 2019 and later
Information
Rules and Printer Groups
Printer Groups serve to group printers, manage access to them, and set their priority in BarTender.
Using rules you can sort into printable groups or into the blocked group. There is no limit to how many rules you can have.
These rules only apply to new, unsorted printers. Any printers already sorted before the rule was applied will need to be moved manually.
See this article on printer groups for more information.
The Default Rule
By default, a fresh installation will always have a single mapping rule to sort all printers into the Default Printer Group. This rule cannot be moved, deleted, or modified and will always exist no matter how many rules you've added. This default rule will ensure that any unsorted printers that do not fit any other rule will be usable with BarTender.
How Rules are Chosen
The sorting process begins at the top of the list and the process goes down the list until a rule matches. Let's work with an example:
The Sorting Process
Here we have two rules in addition to the default one which cannot be changed. These two rules use regular expressions for their sorting. The first rule blocks all printers that are locally installed on a UserPC and the second rule sorts all Zebra printers into group P2. All other printers fall into the Default category.
When using BarTender 11.4 and later and a printer matches both rules — for example, we have a Zebra 140 printer that is installed on UserPC134 — the printer enters the ruleset and matches the first rule because the location contains UserPC like the rule states. The printer is added to the Blocked group even though it is a Zebra printer because it matched the first rule.
On the other hand, in BarTender 2022 and prior, printers are not automatically assigned to the Blocked group when they meet the mapping rules, they are simply prevented from being used.
On the other hand, if a printer enters the sorting ruleset and it does not match the first rule but does match the second, it is sorted into the group P2.
Finally, if neither of the set rules applies, the printer is sorted into the Default group.
Sorting the Rules
When you add rules, they will sort according to their printer groups. However, you can control where these rules sit by using the up and down arrows at the end of the Mapping Rules table:
You can move rules up and down until they suit your needs. You can also right click on the printer rule and select Move Up or Move Down to move the rule.
The default printer rule cannot be moved and will always remain at the bottom of the list.
Creating and Modifying Rules
You can create a new rule in one of two ways:
- click the Add a new rule button.
- Right click on any rule and select Add a new rule.
You can edit a rule by doing one of the following:
- Click on the pencil icon next to a rule.
- Right click on the rule and select edit the selected rule.
- Double click on a rule.
The Rule Dialog
Whether you're creating a new rule or editing a current one, the dialog looks the same. In this dialog you can set rules according to one or all three printer specifications and assign the rule to sort to a specified group:
You can assign printers to any printer group including Default and Blocked.
Options for matching
You have five different options for how a printer is matched with a rule:
Here are the different sorting options:
- Is / Is not - the rule is set for one specific printer model, location, or port.
- Is any of / is none of - You can create a list of printer models, locations, or ports, separated by a semicolon. The rule compares the unsorted printer to the list you've specified.
- Matches - the rule uses regular expressions (regex) for sorting.
Deleting Rules
Aside from the default rule, you can delete rules at any time by doing one of the following:
- Click on the red X next to the rule.
- Right click on the rule and select Delete the selected rule.
Additional Resources
For more information, please see the following: