Understanding Data Sources and Completing a Tutorial

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

graphics/35fig01.jpg

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.

  1. Create a new plain text file using Notepad.

  2. 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  
  3. Save the file and call it names1.txt . Save it in your office/user directory.

  4. Go to that directory and make a copy of the file; call it names2.txt .

  5. 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.

  6. Save the file and close it and make sure that names1.txt and names2.txt are both still in your office/user directory.

  7. Start OpenOffice.org if it's not started already.

  8. Choose Tools > Data Sources. Click New Data Source and enter data; see Figure 35-2.

    Figure 35-2. Creating a text file data source

    graphics/35fig02.jpg

  9. Click the Text tab and enter the information shown in Figure 35-3.

    Figure 35-3. Specifying what your text files are like

    graphics/35fig03.jpg

  10. 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

    graphics/35fig04.jpg

  11. Click OK to save changes and close the window.

  12. Open a new spreadsheet (File > New > Spreadsheet).

  13. 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

    graphics/35fig05.jpg

  14. 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

    graphics/35fig06.jpg

  15. 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

    graphics/35fig07.jpg

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.



OpenOffice. org 1.0 Resource Kit
OpenOffice.Org 1.0 Resource Kit
ISBN: 0131407457
EAN: 2147483647
Year: 2005
Pages: 407

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net