Example on conditional "form control" behaviour. Follow


BarTender Content Team


 Customer needs to print labels for a pallet type production, where for each packing number they have different packing lines, each of the latter include a variable number of boxes, and each box contain a variable number of parts.

The packing number is a value in a database, and each packing line is a record with that value. The rest of the information needs to be entered manually by the operator.


 It's important to clarify concepts, and relate them to "events" or occurrences in BarTender. This will greatly help in designing the form so it follows the required behaviour:

-. Packing Number refers to the database value you'll query when printing.

-. Packing Line refers to each of the individual records produced by the above query.

-. Number of boxes will be the total amount of serialized labels per record.

-. Each individual box will be equivalent to the current serial number.

-. The number of parts is a fixed value entered for each box (for each serial number).

As mentioned above I've created a sample document with the required behaviour that you'll be able to download from <here>*, and the database in use by this sample <here>*. This design contains several single line text objects with at least two data sources each. It looks as follows:

If you place the BarTender document and the CSV file (named View_ShipLabel.csv) in the folder "C:\Seagull" it should work straight away.

1. Label Design:

1.1. The first and second text objects contain two data sources: a first with embedded data containing "Pack Num: " and "Pack Line: ", and a second one linked to the appropriate database field. This way they'll be automatically updated for each database record at print time.

1.2. The third text object is somewhat more complex, as it contains five data sources, all of the type "Embedded Data":
 a. The first data source will contain the number of parts, and will be linked to a data entry control that will prompt for each serial number being printed (see below on the "Data Entry Form" section).

 b. The second and fourth data sources contain fixed information with only "formatting" purposes: " parts on Box " and " of ".

 c. The third data sources will contain the value of the "current box" (I've named that data source "currentBox"). This data source will need to be serialized with the following settings:

 -. Standard serialization.
 -. Reset for every record.
 -. Initial value equals 1.

 d. The last data source is linked to the "total amount of serialized labels"  (total number of boxes). The number of serialized labels is controlled by a name data source I've called "boxesSerial".

1.3. The document is linked with a CSV database, and has a query prompt configured. The query's name is "PackNumQuery".

2. Data Entry Form Design.

This design only uses a single form that contains three controls and an image preview of the design:

2.1. The first control labeled "Part Number" is linked with the query prompt created in the database connection setup called "PackNumQuery".

2.2. The second control labelled "Boxes" is linked to the number of serialized labels/total number of boxes (named data source called "boxesSerial"). It must prompt for every new database record (or every new Pack line). This can be configured from the control's properties, accessing the "Data Entry" node and modifying the "Frequency" value:

2.3. The third control called "Parts" will be linked to the number of parts data source (see 1.2.a). This control needs to prompt for "Every Serial Number" (or for every individual box).

2.4. Finally I've added a preview type image to keep track of which box are you entering data for.

You'll notice that the different controls of the Data Entry Form become available or locked depending on what information are you meant to enter. For example:

-. When entering the query value, all other controls are greyed out:

-. When it's time to enter the number of parts on an individual box the other fields are greyed out:

-. When entering a "new" number of Boxes you'll also need to enter the number of parts for the first box:

I hope this is the functionality you seek, but please let me know how you get on and if you have any further questions.

More Information

Example files:

Do you have feedback or questions on this article? We encourage you to post them on our Community Forums