Changing Data on a Template |
BarTender documents may contain named data sources, denoting fields on a template that may be changed. Typically, each data source represents a complete text object, barcode, or RFID tag on a template, although some objects may contain more than one data source. By changing the values of these data sources, you can change the information printed on an item.
The NamedSubstrings collection object stores a list of all named data sources that are part of a BarTender document. This collection object allows you to read all of the data source values using the GetAll method , as well as modify the values using the SetAll method. The following example demonstrates how to read the value of a named data source using the NamedSubStrings collection object:
Named data sources not only can be read, but they can be modified programmatically. The following code demonstrates how to modify a specific named data source using the Format.SetNamedSubStringValue method. This method has two parameters: the first specifies the name of the data source that you want to modify; the second specifies the data source's new value.
Similarly, you can get the value of a specific data source using the Format.GetNamedSubStringValue method.
Related Topics