Note You can download an example data source and form that connects to it at www.getopenoffice.org/templates.html This isn't so much a quick start as an orientation session; if you're a little wobbly on databases, take a few minutes to read this and you'll be ready to go. If you're a little leary of databases but feel like you should get to know them, don't worry. You can get a whole lot of cool features out of very little work. It can be extremely simple to get the information in your data source (generic term for database or other source of stored data) into documents. So just repeat to yourself, Who's Afraid of the Data Source? and use the explanations and tutorial in this section to get comfortable; soon you'll be a data source power user . What's a Database? Or a Data Source? A data source is anything you've got stored data in, more or less. See Figure 35-1. Figure 35-1. What a data source is Note From now on, we'll just use the term "data source" generically to refer to your data, whether it's a spreadsheet, a database, or whatever. Tutorial: Creating a Data Source Note You can download an example data source and form that connects to it at www.getopenoffice.org/templates.html Walk through this tutorial to get comfortable with data sources. You'll complete steps for the three items referenced in Figure 35-1: creating the data itself, setting up the data source so the program can get at the data, and pulling the data into a standard document. -
Create a new plain text file using Notepad. -
Type the following exactly. Where you see TAB , press the TAB key; where you see RETURN , press the RETURN or ENTER key. Firstname TAB Lastname TAB Phone RETURN Ellen TAB Martin TAB (303) 926-0998 RETURN Michael TAB Flanders TAB (907) 296-4499 RETURN Donald TAB Swann TAB( 908) 555-2121 RETURN -
Save the file and call it names1.txt . Save it in your office/user directory. -
Go to that directory and make a copy of the file; call it names2.txt . -
Open names2.txt and change the name Ellen to Mary ; change the name Michael to Simon ; and change the name Donald to Victor . This is just to make the data different enough so you can tell instantly which table you're using. Be sure not to delete any of the tabs or carriage returns. -
Save the file and close it and make sure that names1.txt and names2.txt are both still in your office/user directory. -
Start OpenOffice.org if it's not started already. -
Choose Tools > Data Sources. Click New Data Source and enter data; see Figure 35-2. Figure 35-2. Creating a text file data source -
Click the Text tab and enter the information shown in Figure 35-3. Figure 35-3. Specifying what your text files are like -
Click the Tables tab and you'll see the window shown in Figure 35-4. Figure 35-4. Specifying what your text files are like -
Click OK to save changes and close the window. -
Open a new spreadsheet (File > New > Spreadsheet). -
Choose View > Data Sources. The window should now look like Figure 35-5. If you can't see the top of the spreadsheet, click the circled stickpin icon in Figure 35-5. Figure 35-5. Specifying what your text files are like -
Click the plus sign to expand your Names data source, the Tables category, and the names1.txt table. Select that table and wait a few seconds; the information in the data source table will be displayed as shown in Figure 35-6. (If it isn't displayed, double-click names1.txt .) Figure 35-6. Specifying what your text files are like -
Click the upper left corner of the displayed data, and drag the data into the spreadsheet below, as shown in Figure 35-7. Figure 35-7. Specifying what your text files are like You're doneyou've created data in a text file form, created a data source to access that data, and brought the data into a spreadsheet. While creating a data source from a database, and creating mail merges rather than just bringing in the data, are slightly more challenging, the same principles apply. You should have a sense of how the process works now, as well as understanding that data source setup is pretty slick. |