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