Records Per Item Example

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 template.

ClosedTo create the products.txt database connection

  1. From the File menu, click Database Connection Setup.

  2. In the Database Setup wizard, click Text File, and then click Next.

  3. Click Select File to browse to the products.txt file.

  4. Click products.txt, and then click Open. A file preview is displayed in the wizard.

  5. Click Next.

  6. On the wizard's File Format page, you can click the Fields tab to see the data in a table format.

  7. Click Next.

  8. On the wizard's Field Names page, you can verify that the first row is identified as field names for the data.

  9. 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.

ClosedTo enable the printing of multiple records per printed item

  1. On the Database Setup dialog, click Records Per Item.

  2. 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.

  3. Click to select Break when field changes.

  4. 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.

  5. Click to select Combine multiple records into single field.

  6. 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.

  7. 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.

  8. In the left navigation pane, click Sort Order.

  9. 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.

  10. 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.

ClosedTo add the records to your template

  1. 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 data source.

  2. 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.

  3. Use the control arrows on the record navigation bar (at the bottom of the Template Design area) to view the items that will print for this document. 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.

    ClosedTo wrap the products within the text object

    1. 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.

    2. On the Text Properties dialog, click Text Format to open the Text Format property page.

    3. On the Wrap tab, click to select the Wrap to fit width check box.

    4. Click Close.

    5. 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.