Named Data Sources Example

Named data sources enable you to use the same information across multiple objects, making it easier to use a piece of data in a document.

Consider the following example: a retail company prints a number of shipping labels where the address information is stored in a centralized database. In addition to printing the address on the label, the zip code will be encoded into a barcode. Rather than connecting to the database field multiple times, we can create a single named data source that will be linked to each of the separate objects. By using a single data source, we reduce the chance of human error in the final product.

In this example, we will produce a label that draws information from the database, as in the sample data below:

"Customer Name", "Street Address 1", "Street Address 2", "City", "State", "Zip Code"

"Amy Jacobs", "PO Box 60", " ", "Gem Town", "NV", "50897"

"Will Wilson", "148 Circle Drive", "Apt. B302", "Maple", "WA", "98005"

"Katie Smith", "6582 Highland Road", " ", "Kansas City", "MO", "64052"

ClosedTo create the named data sources

  1. In the Toolbox, select the Data Sources tab.

  2. Open the context menu for the Named Data Sources node.

  3. Select Manage Named Data Sources from the context menu to open the Named Data Sources dialog.

  4. Click to open the Create Named Data Sources dialog.

  5. Specify the name as ZIP. In this example, we will create only one named data source, for the zip code. This is the data that will be shared between multiple objects.

  6. Select Database Field from the dropdown list and click Next.

  7. From the list of available field names, select the database field that you want. Using the sample file above, the database field to use is "Zip Code".

  8. In the Sample Data field, enter some sample text to help you identify the data source. For example ZIP might be "58631".

  9. Click Finish to close the Create Named Data Source Wizard.

ClosedTo create the address text object

  1. From the main toolbar, click and select Multi-line.

  2. Click on the template to add the text object.

  3. Double-click on the text object to open the Object Properties dialog. Alternatively, select Properties from the object's context menu.

  4. From the Navigation Pane, select the first data source.

  5. Click to delete the existing data source.

  6. Add a new data source for each database field in the data file, separated by spaces. To add new data sources, click from the toolbar on the bottom of the Navigation pane to open the New Data Source wizard. For more information, refer to Working with Data Sources.

  7. When you get to the Zip Code data source, select Link to Existing Named Data Source as the data source type. Click Next.

  8. Select ZIP from the list of named data sources.

  9. Click Finish to close the New Data Source Wizard.

  10. Click Close to close the Text Properties dialog.

ClosedTo link the zip code to the barcode

  1. Add a barcode object to your template.

  2. Double-click on the barcode to open the Barcode Properties dialog. Alternatively, select Properties from the object's context menu.

  3. In the Navigation Pane, select the available data source to display the Data Sources property page.

  4. On the Data Source tab, select next to Type to open the Change Data Source Type wizard.

  5. For Type, select Link to an Existing Named Data Source. Click Next.

  6. Select ZIP from the list of named data sources.

  7. Click Finish to close the Change Data Source Type wizard.

  8. Click Close to close the Barcode Properties dialog.

Now the zip code will update both the address and the barcode whenever a new value appears in the database.

Related Topics