1 <?xml version="1.0" encoding="utf-8"?>
2 <page xmlns="http://projectmallard.org/1.0/" xmlns:e="http://projectmallard.org/experimental/" type="guide" id="merge-ex1" xml:lang="sl">
5 <link type="guide" xref="merge#merge-ex"/>
6 <revision pkgversion="3.0" version="0.1" date="2010-05-04" status="incomplete"/>
8 Create name tags from a CSV file.
10 <credit type="author">
11 <name>Jim Evins</name>
12 <email>evins@snaught.com</email>
14 <credit type="author">
15 <name>Mario Blättermann</name>
16 <email>mariobl@gnome.org</email>
19 <p>Creative Commons Share Alike 3.0</p>
23 <title>Example 1: Name Tags</title>
25 <p>In this example we are organizing an orientation party for the new
26 crew members of our ship. We have a list of freshman crew members that we
27 created in <app>gnumeric</app> and exported as the following
28 CSV file. We could have created this file by using a text editor, but heck it
29 is the 23rd century.</p>
33 "Jim Kirk",Management,"SC937-0176 CEC"
34 "Mr. Spock",Sciences,S179-276SP
35 "Leonard McCoy",Medicine,unknown
36 "Montgomery Scott",Engineering,SE-197-54T
39 <p>In <app>gLabels</app> we have created a new <app>glabels</app>
40 document using the Avery 5395 "Name Badge Labels" template. Next we use the
41 <guiseq> <gui>Objects</gui>
42 <gui>Merge Properties</gui> </guiseq> menu item to display
43 the <gui>merge properties</gui> dialog. We use this dialog to
44 select the source type (in our case CSV with keys on line 1) and the merge
45 source (filename) as shown.</p>
47 <!-- ==== Figure ==== -->
48 <media type="image" src="figures/merge-ex1-1.png" mime="image/png" style="right">
49 <p>Merge properties dialog</p>
51 <!-- ==== End of Figure ==== -->
53 <p>We can also view each record in more detail by clicking on the appropriate
54 expander (the little triangles) as shown. Once we are satisfied with the
55 selections in this dialog we click <gui>OK</gui> to accept the
58 <p>Now we start adding objects to our <app>glabels</app> document as shown.</p>
60 <!-- ==== Figure ==== -->
61 <media type="image" src="figures/merge-ex1-2.png" mime="image/png" style="right">
64 <!-- ==== End of Figure ==== -->
66 <p>In this example we have added three text objects and a barcode object. The
67 first text object contains only simple literal text ("Hello, my name is"). The
68 second text object contains a single merge field ("${Name}") corresponding to the
69 first field of a record (first column of a line) which contains the new crew
70 member's full name. The third text field contains both literal text
71 ("Department: ") followed by a single merge field ("${Department}") corresponding to
72 the second field or the crew member's department. The barcode object is
73 configured to use field (or key) "SN" which contains our crew member's
74 starfleet serial number.</p>
76 <p>Now we can print our name tags by selecting the
77 <guiseq> <gui>File</gui>
78 <gui>Print</gui> </guiseq> menu item. This will display
79 print dialog as shown below.</p>
81 <!-- ==== Figure ==== -->
82 <media type="image" src="figures/merge-ex1-3.png" mime="image/png" style="right">
83 <p>Printing name tags</p>
85 <!-- ==== End of Figure ==== -->
87 <p>Just to make sure our labels are going to look okay, we select the
88 <gui>Print outlines</gui> option and click
89 <gui>Print Preview</gui>. This will display a print preview dialog
92 <!-- ==== Figure ==== -->
93 <media type="image" src="figures/merge-ex1-4.png" mime="image/png" style="right">
94 <p>Name tags preview</p>
96 <!-- ==== End of Figure ==== -->
98 <p>Everything looks good, so we can now load up our printer with
99 the appropriate label stock, print our name tags and start beaming our guests