Prepare a data source file


The first step in the print merge process is to prepare the data source file. Information in a data source file is organized into columns, fields, and records. A field refers to a single unit of data within a record, while a column refers to a set of related fields that share the same data type and format. A record can have one or more columns.

 

In this example of an Excel Workbook (XLSX) data source file, every record includes a first name, last name, photograph, address, and phone number. Each item within a column, such as ‘4512 Lorem Str.’ and ‘2812 Ipsum Str.’, is recognized as a field.

You can create a data source or import an existing one. CorelDRAW supports the following data source files: Text (TXT) files, comma-separated values (CSV) files, Rich Text Format (RTF) files, Excel Workbook (XLSX) files, and files that can be opened by means of an ODBC data source.

Create data source files in CorelDRAW

Columns can contain several types of data, including text, numeric values, or file paths.

Text data consists of both alphabetic or numeric characters, such as names, addresses, phone numbers, or email addresses.

Numeric data includes any type of numerical values, such as integers or decimal numbers. You can choose formatting options for numeric fields and set them to increment automatically when values are added.

In path columns, you can specify file paths for image assets, such as logos, icons, or photographs. You can enter a path manually or browse for a file. If you enter paths manually, make sure you follow the file system location conventions and rules of your operating system. The application supports only valid file paths on local and network drives, and not URLs.

When you access the Configure Data Source dialog box or sync with the data source, the application validates the paths. An "X" before a filename indicates that a file path is invalid, or the file cannot be found in the specified location.

CorelDRAW lets you add, delete, and rename columns. When you add a column manually, there are no records by default. If you want to automatically populate a column with data, you can import the column from a data source file. For more information about importing columns, see To import a column from a data source file.

You can add and delete records, and edit fields in records. All records are selected by default; however, if you want to use only the data from specific records, you can quickly deselect all records, and then select only the ones you need. In addition, you can add a record to the list of selected records when browsing records in single-record view (View Single Record).

Depending on your preferences and requirements, you can view one record or multiple records at a time. If you need to scan through the entire dataset or compare information across different records, you can use the viewing mode that displays all records (View All Records). When you need to focus on a specific record in detail, the single record viewing mode (View Single Record) provides a clean and uncluttered interface, minimizing distractions from other records.

CorelDRAW offers several methods for navigating and locating records. To quickly find the information you need, you can scroll through records, browse through a list, or directly go to a specific record.

You can quickly remove all merge data if needed. This can be helpful when you want to reset the document to its original state and start from scratch. It offers convenience and efficiency by providing a quick and easy way to clear the merge data without manually deleting each individual record and column.

Create data source files in a text editor

You can create a data source in a text editor. If you plan to export to Rich Text Format (RTF), ensure that the text editor supports saving files in RTF format. Open a new file and indicate the number of columns you want to include on the first line. For example:

4

On the second line, specify the names of the columns by separating them with a backslash. Each column must begin and end with a backslash. To indicate that a column contains file paths, pre-pend the "at" (@) symbol before the column name. For example:

\Name\\Date\\Instructor\\@Photo\

On the next lines, enter the data that you want to appear in the merged document. Each line constitutes a record. For example:

\Pixie Parsons\\6 September 2023\\Mr. Randy Harris\\"C:\Users\admin\Documents\UserProfilePictures\RandyHarrisPicture.jpg"\

Once you add the information you need, save the file as an ANSI text file (.TXT extension) or as an RTF file. Below is an example of a TXT or RTF data source:

4

\Name\\Date\\Instructor\\@Photo\

\Pixie Parsons\\6 September 2023\\Mr. Randy Harris\\"C:\Users\admin\Documents\UserProfilePictures\RandyHarrisPicture.jpg"\

\Shirley Wilkinson\\13 January 2023\\Ms. Corinne Pitts\\"C:\Users\admin\Documents\UserProfilePictures\CorinnePittsPicture.jpg"\

In comma-delimited (CSV) files, fields are separated by commas or tabs, records are separated by paragraph breaks. For example:

Name,Date,Instructor,@Photo

Pixie Parsons,6 September 2023,Mr. Randy Harris,"C:\Users\admin\Documents\UserProfilePictures \RandyHarrisPicture.jpg"

Shirley Wilkinson,13 January 2023,Ms. Corinne Pitts,"C:\Users\admin\Documents\UserProfilePictures\CorinnePittsPicture.jpg"

You can also create a data source in a spreadsheet application, such as Microsoft Excel. To indicate that a column contains file paths, pre-pend the "at" (@) symbol before the column name preceded by the single quote (or apostrophe) symbol "" as an escape character. For example:

’@Photo

Import and sync with data source files

If you prefer to create and modify the data source in a text editor or spreadsheet application, you can import it into CorelDRAW and synchronize it as needed. The application maintains a link to the data source file and lets you update the data in your project with the latest changes from the source. If a data source file is missing, you have the option to link to a new location or use the embedded data instead. When you synchronize, any manual modifications to the data, including adding, deleting, or editing columns, are not retained. To keep the changes, you can either save the data to a new file or overwrite the linked data source file.

Apart from importing a data source file, you can selectively bring in data from specific columns. This allows you to choose and merge data from diverse sources, expanding your possibilities. When deciding between importing a data source or single columns, consider your specific needs. Importing the entire data source is an ideal choice when all the required information is contained within a single source. The ability to sync the data in your document with any subsequent changes made to the source is particularly beneficial if you anticipate future modifications to the data source, as it enables you to maintain up-to-date information in your project. By choosing to import individual columns, on the other hand, you attain the benefits of focused selection and increased versatility in merging data from various sources. It is important to note that while the syncing functionality is not available in this scenario, the ability to combine data elements according to your preferences and requirements adds valuable flexibility to your workflow. Moreover, you have the option to export the data to a new file and conveniently link to it if needed.

Export data source files

When you create a data source in CorelDRAW, you can save it to a new file which can be helpful for accessing and managing the data in a text editor or spreadsheet application. If you want to overwrite an existing file, make sure the file is not read-only. You can save all records or only selected records.

Save merge data in files

Whether you create a data file in CorelDRAW or import an existing data file into CorelDRAW, by default, the data is saved in your document and is retained until you perform the data merge. You can choose not to store the data with documents.

To create a data source file by using CorelDRAW

Back to Top
1 Click File Print Merge Create/load Print Merge.
2 In the Configure Data Source dialog box, click Add Column.
3 In the Add Column dialog box, type a column name in the Name box.
4 Perform a task from the following table.

 

To create
Do the following
A text column
Enable the Text option in the Type area.
A numeric column
Enable the Numeric option in the Type area. In the Numeric field options area, you can apply formatting to the data in a numeric field by choosing a format from the Format list box, and automatically increment the value in a numeric field by enabling the Continually increment value check box and specifying starting and ending values in the corresponding boxes.
Note: Different numeric formats are available in CorelDRAW. For example, the X.0 format represents the value 1 as 1.0; the 00X format represents the value 1 as 001.
A column that contains paths
Enable the Path option in the Type area.
5 Click Add.
Repeat steps 2 to 5 until you add the columns you want.
6 Click the Add a record button , and enter data in the fields corresponding to that record.
Repeat this step for each record.
7 Click Continue to go to the next step in the data merge process and create the form document. For more information, see To create a form document.
Note: Clicking Cancel closes the Configure Data Source dialog box without saving any changes. If you want to retain the data but postpone the creation of the form document and data merge, click Continue, and close the Configure Data Source dialog box.

 

You can also
Rename a column
Click a field in the list, and click Configure Columns. In the Configure Columns dialog box, choose a column from the Select column list box, and click Edit Column. Enter a new column name in the Name box.
Delete a column
Click a field in the list, and click Configure Columns. In the Configure Columns dialog box, choose a column from the Select column list box, and click Delete Column.
Edit a field in a record
Click a field in a record to select it, and then click in the field again to edit the data.
Tip: To edit a file path, click inside a field that contains a path, and do one of the following:
Enter a new path or modify the existing path.
Click the Select file button . Navigate to the folder where you store the file you want, click a file, and click Open.
Delete a record
Click a record, and click the Delete a record button .
View records
Click one of the following:
View All Records — lets you display all records in a source data file
View Single Record — lets you display the selected record
Browse records
Click any of the following buttons:
First record
Next record
Previous record
Last record
Tip: You can also use the Up or Down arrow keys to navigate between records.
Go to a specific record
Type the record number in the Go to Record box, and click Go to Record.
Select or deselect a record
Do one of the following:
In multi-record view (View All Records), enable or disable the check box for a record.
In single-record view (View Single Record), click the Select record or Deselect record button , respectively.
Tip: To select or deselect all records in multi-record view (View All Records), click the Select all or Deselect all button, respectively.
Delete all print merge data in a document
Click the Clear print merge data button .
Note: Any print merge fields that may have been added in the form document are retained. If you no longer need them, you can delete them.

To export a data source

Back to Top
1 Do one of the following.
Create a data source in CorelDRAW. For information, see To create a data source file by using CorelDRAW.
Open a CorelDRAW document with print merge data.
2 In the Configure Data Source dialog box (File Print Merge Edit Print Merge), perform a task from the following table.

 

To
Do the following
Save all records
Click Save Data Source.
Save selected records only
Ensure that only the check boxes corresponding to the records you want to include in the data source file are enabled. Click Save Data Source. In the Save As dialog box, enable the Selected records only check box.
3 Type a filename, choose the drive and folder where you want to save the file, choose a file format, and click Save.

To create a data source by using a text editor

Back to Top
1 Open a text editor, and create a new file.
2 Perform a task from the following table.

 

To create a data source in this format
Do the following
TXT or RTF
On the first line, type the number of merge fields that you want to insert in the drawing. On the second line, type the names of the merge fields by separating them with a backslash. To indicate that a column contains file paths, pre-pend the "at" (@) symbol before the column name. Begin and end each merge field with a backslash. On the next lines, type the data that you want to appear in the merged document. Each line constitutes a record. Save the file as an ANSI text file (.txt extension) or as an RTF file.
Notes:
Backslashes function as markers to indicate the beginning and end of merge fields; therefore, you cannot use them as data in fields.
Data in fields must end with a character. Blank spaces or lines before backslashes prevent the merge from being completed successfully.
CSV
On the first line, type the names of the merge fields by separating them with a comma or tab. To indicate that a column contains file paths, pre-pend the "at" (@) symbol before the column name. On the next lines, type the data that you want to appear in the merged document. Each line constitutes a record. Save the file as a comma-delimited (.CSV) file.

To import a data source file

Back to Top
1 Click File Print Merge Create/load Print Merge.
2 In the Configure Data Source dialog box, click the Import Data Source.
If you are importing data from an Excel workbook with multiple sheets, choose a sheet.
3 In the Open dialog box, navigate to the drive and folder where the data file is stored.
4 Choose a file.
5 Click Open.

*

To ensure the correct rendering of characters in print merge data when importing TXT or CSV files, it is recommended to include a BOM (Byte Order Mark).

Empty columns are ignored on import.

When you import a data source file that contains paths, the application validates the paths. If a file cannot be found in a specified location, an "X" appears before the filename.

To import a column from a data source file

Back to Top
1 Click File Print Merge Create/load Print Merge.
2 In the Configure Data Source dialog box, click Add Column.
3 In the Add Column dialog box, click the Import column button .
4 In the Open dialog box, navigate to the drive and folder where the data file is stored.
5 Choose a file.
6 Click Open.
7 Perform a task from the following table.

 

To import a column from
Do the following
A data source in a TXT, RTF, or CSV format or an Excel workbook with one sheet
In the Choose column dialog box, click a column name, and click Add.
An Excel workbook with multiple sheets
In the Select Tab dialog box, click a worksheet in the list of available worksheet tabs, and then click a column in the list of available columns. Click OK.
8 In the Type area, enable one of the following options:
Text — to denote that the column contains text
Numeric — to denote that the column contains numeric data
Path — to denote that the column contains file paths
9 Click Add.
A check mark appears beside the button to indicate that the data from the column has been imported successfully and the tooltip shows the filename and location of the data source.

*

Columns must have unique names.

*

After importing the columns you need, you can save the data to a new file and link to it if needed. For information about saving data source files, see To export a data source.

To import an ODBC data source file

Back to Top
1 Click File Print Merge Create/load Print Merge.
2 In the Print Merge dialog box, click Open ODBC Data Source.
3 In the Select Data Source dialog box, do one of the following:
Click the File Data Source tab, and select the file data source that describes the drive that you wish to connect to. You can use any file data source that refers to an ODBC driver that is installed on your machine.
Click the Machine Data Source tab, under Data Source Name, select a data source type, and click OK.
4 Choose the database that you want to import, and click OK.
5 Choose a table, and click OK.

To sync linked data with the latest version of the data source

Back to Top
Click the Sync with data source button .

*

The Sync with data source button appears grayed out when there is no data source linked to a drawing. After you import a data source, the tooltip of the Sync with data source button shows the location of the data source.

When changes are made to the data source, such as updating its contents or renaming or moving the file to a new location, the Sync with data source button indicates the availability of a more recent version or denotes that the application is unable to access the data source.

To save merge data in or remove merge data from a document

Back to Top
1 Click Tools Options CorelDRAW.
2 Click the Document button .
3 In the list of settings, click Save.
4 Enable or disable the Save print merge data in document option to retain print merge data or clear print merge data when saving a document, respectively.

*

If you choose not to save print data in a drawing, any data fields that you may have added in the form document are retained.

Was this page helpful? Send feedback.


Some features documented in the Help are available exclusively to subscribers. For more information about CorelDRAW subscription, visit coreldraw.com.