Open topic with navigation
You can use the Records Per Item property page of the Database Setup dialog to print multiple database records on a single printed item and to specify how you want those records to be grouped on your printed items. Consider the following example:
Suppose you have a text database called products.txt. It contains thirteen records that consist of a list of products and the region from which the product originated, as follows:
Product,Region
Knife,Western Region
Dish Towel,Eastern Region
Coffee Mug,Southern Region
Fork,Western Region
Spoon,Western Region
Tongs,Western Region
Hot Pad,Eastern Region
Dinner Glass,Southern Region
Wine Glass,Southern Region
Spatula,Eastern Region
Tea Cup,Southern Region
Juice Glass,Southern Region
Tumbler,Southern Region
You want BarTender to print a single item for each region that has all products from that region printed on the item. The following procedures describe how to create the database connection, enable the printing of multiple records per printed item, and add the records to your .
To create the products.txt database connection
-
From the File menu, click Database Connection Setup.
-
In the Database Setup wizard, click Text File, and then click Next.
-
Click Select File to browse to the products.txt file.
-
Click products.txt, and then click Open. A file preview is displayed in the wizard.
-
Click Next.
-
On the wizard's File Format page, you can click the Fields tab to see the data in a table format.
-
Click Next.
-
On the wizard's Field Names page, you can verify that the first row is identified as field names for the data.
-
Click Finish to complete the wizard. The Database Setup dialog opens.
Next, set the maximum number of records per item, and then specify the Break when field changes and Combine multiple records into a single field options.
To enable the printing of multiple records per printed item
-
On the Database Setup dialog, click Records Per Item.
-
On the Records Per Item property page, for Maximum number of records per printed item, use the arrows to select 6. In this example, 6 is an arbitrary number. In most cases you would set the maximum record limit to a number that would actually fit on the label or in the text object.
-
Click to select Break when field changes.
-
From the Fields list, click to select Region, and then click OK. This causes the returned records to break each time the value of the Region field changes.
-
Click to select Combine multiple records into single field.
-
From the Fields list, click to select Product, and then click OK. This enables the returned Product field values to appear in a single text object on the template.
-
For the Separator option, click to select Custom, and then enter a comma followed by a space (, ). This specifies that the products that are listed in the single object will be separated by a comma followed by a space.
-
In the left navigation pane, click Sort Order.
-
On the Sort Order property page, double-click Region to add it to the Fields to Sort By list. Alternatively, drag Region from the Available Fields list to the Fields to Sort By list. This causes the returned records to be sorted by the values of the Region field.
-
Click OK to close the Database Setup dialog.
Next, add the records to your template, and then format them the way that you want them to appear.
To add the records to your template
-
From the Data Sources pane of the Toolbox, click and drag Region to the template. A text object is created that uses the Region database field .
-
From the Data Sources pane of the Toolbox, click and drag Product [+] to the template, and then position it below the first object. A text object is created that uses the Product [+] database field data source.
-
Use the arrows on the record navigation bar (at the bottom of the Template Design area) to view the items that will print for this . Note that the list of products on one or more items may be too wide to fit on the template. When this happens, you can modify the text object so that the list of products will wrap to multiple lines within the object.
To wrap the products within the text object
-
Open the Text Properties dialog for the Products [+] text object. To do this, double-click the object. Alternatively, use the secondary mouse button to click the object, and then click Properties.
-
On the Text Properties dialog, click Text Format to open the Text Format property page.
-
On the Wrap tab, click to select the Wrap to fit width check box.
-
Click Close.
-
Adjust the object width by dragging the object's horizontal sizing handle until the object is the width that you want.
When you print your document, the three printed items appear similar to the following:
Southern Region
Coffee Mug, Dinner Glass, Wine Glass, Tea Cup, Juice Glass, Tumbler
|
Eastern Region
Dish Towel, Hot Pad, Spatula
|
Western Region
Knife, Fork, Spoon, Tongs
|
In this example, three items are printed because there are three regions in the database and all the products for each region fit on the printed item. The maximum number of products per printed item is set to six, so when a region exceeds six products, the additional products for that region will be printed on a separate item, increasing the number of printed items. Similarly, if another region is added, an additional item will be printed.