]> git.sur5r.net Git - glabels/blob - help/sl/merge-ex2.page
Imported Upstream version 3.0.0
[glabels] / help / sl / merge-ex2.page
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-ex2" xml:lang="sl">
3
4   <info>
5     <link type="guide" xref="merge#merge-ex"/>
6     <revision pkgversion="3.0" version="0.1" date="2010-05-04" status="incomplete"/>
7     <desc>
8        Create address labels from a CSV file.
9     </desc>
10     <credit type="author">
11       <name>Jim Evins</name>
12       <email>evins@snaught.com</email>
13     </credit>
14     <credit type="author">
15       <name>Mario Blättermann</name>
16       <email>mariobl@gnome.org</email>
17     </credit>
18     <license>
19       <p>Creative Commons Share Alike 3.0</p>
20     </license>    
21   </info>
22
23     <title>Example 2: Address labels</title>
24
25       <p>In this example we are going to throw a party and need to print mailing
26         address labels for our invitations.  We have a list of our closest friends
27         that we created in <app>gnumeric</app> and exported as the
28         following CSV file.  It should be noted that not everyone has a middle initial or
29         a two line address.</p>
30
31       <code>
32 LAST,FIRST,MI,ADDR1,ADDR2,CITY,STATE,ZIP
33 ,,,,,,,
34 Critter,Ess,S,"123 Faux St.",,Alexandria,VA,22310
35 Doe,John,,"Apt 1X","451 Mystery St.",Trenton,NJ,08601
36 Summers,Joyce,,"1630 Revello Dr",,Sunnydale,CA,95037
37 McGarret,Steve,O,"404 Piikoi Street",,Honolulu,HI,96813
38 Kramer,Cosmo,,"Apt 5B","129 W. 81 St.","New York",NY,10024-7207
39       </code>
40
41       <p>In <app>glabels</app> we have created a new <app>glabels</app>
42         document using the Avery 5512 "Address 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-ex2-1.png" mime="image/png" style="right">
51                 <p>Merge properties dialog</p>
52                 </media>
53       <!-- ==== End of Figure ==== -->
54
55       <p>Before applying the merge source, we uncheck the first record since it only
56         contains empty fields.  It is an artifact of our original <app>gnumeric</app> spreadsheet
57         and would simply waste our first label.  We could also unselect
58         any other records that we didn't want to print a label for.</p>
59
60       <p>We can also view each record in more detail by clicking on the appropriate
61         expander (the little triangles) as shown.  Once we are satisfied with the
62         selections in this dialog we click <gui>OK</gui> to accept the
63         changes.</p>
64
65       <p>Now we start adding objects to our <app>glabels</app> document as shown.</p>
66
67       <!-- ==== Figure ==== -->
68                 <media type="image" src="figures/merge-ex2-2.png" mime="image/png" style="right">
69                 <p>Adding objects</p>
70                 </media>
71       <!-- ==== End of Figure ==== -->
72
73       <p>In this example we have a single text object.  This text object contains
74         all of our merge fields organized on multiple lines as a mailing address.
75         Notice that fields ${ADDR1} and ${ADDR2} are each
76         located with no other text on their own lines.  When
77         <app>glabels</app> encounters a field as the only text on
78         a line, it will not expand the line if the field is empty.</p>
79
80       <p>Now we can print our address labels by selecting the
81         <guiseq> <gui>File</gui>
82         <gui>Print</gui> </guiseq> menu item.  This will display
83         print dialog as shown below.</p>
84
85       <!-- ==== Figure ==== -->
86                 <media type="image" src="figures/merge-ex2-3.png" mime="image/png" style="right">
87                 <p>Printing address labels</p>
88                 </media>
89       <!-- ==== End of Figure ==== -->
90
91       <p>Just to make sure our labels are going to look okay, we select the
92         <gui>Print outlines</gui> option and click
93         <gui>Print Preview</gui>.  This will display a print preview dialog
94         as shown below.</p>
95
96       <!-- ==== Figure ==== -->
97                 <media type="image" src="figures/merge-ex2-4.png" mime="image/png" style="right">
98                 <p>Address labels preview</p>
99                 </media>
100       <!-- ==== End of Figure ==== -->
101
102       <p>Everything looks good, so we can now load up our printer with
103         the appropriate label stock, print our address labels and start mailing
104         our party invitations.</p>
105
106 </page>