How to Display Multiple Records in a Single Label
Question
How can I display multiple records in a single template?
Applicable to
BarTender 2019 and later
Solution
The Records Per Item feature allows you to print multiple database records on a single printed label template.
You will see the following options in the Database Connection Setup > Records Per Item section.
- Maximum number of records per printed item - Specifies the maximum number of records that are returned per item. The maximum value for this option is 99.
- Break when field changes - Specifies one or more database fields as break points, so that when the value changes for the field, that record and subsequent records continue to be printed on the next printed item.
- Combine multiple records into a single field - Specifies database fields that can display the values of multiple records in a single object on the template.
- Separator - Specifies the type of separator that you want to use for the data that is being combined.
- Line Break - Specifies that the returned values are separated by a line break.
- Tab - Specifies that the returned values are separated by a tab.
- Custom - Specifies that the returned records are separated by a custom separator.
Example
This example illustrates how you can populate multiple records of a single database field on a printed item.
- Create a new BarTender document and setup a new database connection.
- Go into the Database Connection Setup > Records Per Item section.
- Set the maximum number of records you want per printed item.
- Enable the checkbox option combine multiple records into a single field.
Select the field drop down > enable the checkbox to (Select All) and click OK. Set the separator to Line Break.
- Click OK to the database connection setup.
- Now on the template design, create a Normal Wrapped text object and place it on the template.
- Right click the object and select Properties.
- Select the Sample Text data source on the left and change the Type to a database field using the data source wizard.
- When prompted for the field to use, notice that some database field names have a + symbol or number value next to them. The + symbol indicates that it will display all the records for that particular database field. The number value indicates it will display a particular number record.
- For this example choose CompanyName + for the database field to use.
- Click Finish to the data source wizard.
- You can see it displays the 3 records for the CompanyName database field for a single printed item.