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 USPS POSTNET 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"
To create the named data sources
In the Toolbox, select the Data Sources tab to display the Data Sources pane.
Over Named Data Sources, use the secondary mouse button to open the context menu.
Select Manage Named Data Sources from the context menu to open the Named Data Sources dialog.
Click to open the Create Named Data Sources dialog.
Specify the desired name. In this example, we will call the first data source CustomerName. Once the name has been entered, click Next.
Select Database Field from the dropdown list and click Next.
From the list of available field names, select the desired database field. For the first data source, this will be "CustomerName".
In the Sample Data field, enter some sample text to help you identify the data source. For example CustomerName might be "Jane Doe",
Click Finish to close the Create Named Data Source Wizard.
Repeat steps 4-9 to create named data sources StreetAddress1, StreetAddress2, City, State, and ZIP.
To attach the named data sources to the address
From the main toolbar, click and select Multi-line.
Click on the template to add the text object.
Double-click on the text object to open the Object Properties dialog. Alternatively, select Properties from the object's context menu.
From the Navigation Pane, select the first data source.
Click to delete the existing data source.
To add new data sources, click from the toolbar on the bottom of the Navigation pane to open the New Data Source wizard.
In the New Data Source Wizard, select Link to an Existing Named Data Source as the Type.
Click Next.
For Data source, select the desired named data source (i.e. CustomerName).
Click Finish to close the New Data Source Wizard.
Repeat steps 6-10 for StreetAddress1, StreetAddress2, City, State, and ZIP, separating them with commas and carriage returns as needed.
Click Close to close the Text Properties dialog.
Attaching ZIP to the POSTNET barcode
From the main toolbar, click to add a barcode to the template. Alternatively, select Barcode from the Create menu.
If this is the first time you have added a barcode, the Select Barcode dialog will automatically open. Otherwise, select More Barcodes to open the Select Barcode dialog.
In the left pane, select Postal/Shipping to view the available postal barcodes.
In the right pane, select USPS POSTNET.
Click Select to close the Select Barcode dialog.
Click at the desired location to add the barcode to your template.
Double-click on the barcode to open the Barcode Properties dialog. Alternatively, select Properties from the object's context menu.
In the Navigation Pane, select the available data source to display the Data Source property page.
On the Data Source tab, select next to Type to open the Change Data Source Type wizard.
For Type, select Link to an Existing Named Data Source.
For Data Source, select ZIP.
Click Finish to close the Change Data Source Type wizard.
Click Close to close the Barcode Properties dialog.
Now the zip code will update dynamically in both the address and the barcode whenever a new value appears in the database.
Related Topics