How do I create CD / DVD database Labels in OpenOffice.Org under Linux / Mac OS X / Windows?

by on May 7, 2007 · 10 comments· LAST UPDATED May 16, 2007

in , ,

This is a reader-contributed article.

If you're serious about music or DVDs, at some point you cross the threshold of having more than you can keep track of easily. The box full of index cards has served its purpose; it's time to move on to storing information about your CDs and DVDs in a database.

This might seem like more of a pain than you can stand. What's the point of doing a database when you can just type it all into a spreadsheet, for instance? Well, a spreadsheet is a good start but with a database you get a lot more features, including easily printing custom labels for all those legal backups you've made. You could also print out a record of all your movies or music, if you keep notes on them such as summaries, who you've loaned them to, and anything else you track.

Putting together a database and creating the forms to print what you want takes more than a couple steps, but it's not that difficult. Even better, it's free, since you can use the free open source office suite OpenOffice.org to do everything.

You can download and install OpenOffice.org from www.openoffice.org. Once you've got the program installed, you'll complete these steps.

  1. Create a database. There are several ways to do this, but I'll show you the quickest way.
  2. Create or download the document you want to print, from a source such as WorldLabel, and connect the document to the database.

Creating a Database

If you're a database god and enjoy spending time deep in a database—well, you can do anything you want. If you want the most results for the least trouble, here's what I recommend. Get your data in a spreadsheet, then create a database file that can read the spreadsheet. This is simple and if you don't need advanced database features, it's all you need.

This process creates an OpenOffice.org database file that points to your spreadsheet of information. The spreadsheet doesn't have the power to do mail merges, but the database file pointing to it does. It acts as a middle man saying "The data's over there, with these fields – go get it."

Getting Data Into a Spreadsheet

You either have your data in a spreadsheet already, or you can get it into a spreadsheet pretty easily. You'll want to have it set up to look something like this, with field labels across the top, and with each piece of data separate.

Figure 1: Data setup

If your data is in .csv files, you can open those files in a spreadsheet.

1) In OpenOffice.org choose File → Open.

2) In the File Type list of the Open window, select Text CSV (click in that list and type T four times).

Figure 2: Selecting the Text CSV file format

3) Select the CSV file and click Open. In the window that appears, verify that the settings are correct for the data, then click OK.

Figure 3: Verifying the settings are correct for the data

4) Save the file as a spreadsheet, in spreadsheet format.

Figure 4: Saving the imported data in spreadsheet format

Creating the Database File That Points to the Spreadsheet

Now you're ready to create the database file that reads the information out of your spreadsheet. It's very simple.

1. Choose File → New → Database.

2. In the first window, select Existing Data Source, and Spreadsheet type. Click Next.

Figure 5: Specifying Spreadsheet as the database type

3. In the next window, point to the full path of the spreadsheet you want to use. Click Next.

Figure 6: Pointing to your spreadsheet

4. Leave all the checkboxes marked. You don't need to edit the database but the first time, at least, it's good to take a look at what the main database window looks like. Click Finish.

Figure 7: Finishing the database creation

5. Name the database. This name will show up when you do mail merges, and it's the name and location you'll look for when you want to do things with the database like create queries or reports. Click Save.

Figure 8: Naming and saving the database

6. You'll see the database. Click the Tables icon at the left, and select a table name. Each sheet containing data in your spreadsheet will become a table. Now, on the right side, instead of None, select Document. You'll see the data in the spreadsheet.

Figure 9: Viewing the new database and its table(s) in the database editing window

You don't have to do anything else—you're ready to pull information into your documents.

Updating the Data

When you have more data, just add it to the spreadsheet. When you want more tables, just add the data to another sheet in the spreadsheet.

Creating a Query to Restrict Data

Let's say you might want to print labels for all the DVDs in your collection, or you might want to print labels only for DVDs released between 1998 and 2002. You'd need to create a query so that you could print labels based on that query, or on the whole database.

1. Open the .odb database file you created.

2. Click the Queries icon at the left side.

3. Click the option to use Design view.

Figure 10: Creating a query in Design view

4. In the window that appears, click Add to add the table you want to base the query on.

Figure 11: Selecting the table to base the query on

5. Double-click each field that you want to add to the query. Then add the limiting information in the Criterion field; an example is shown.

Figure 12: Creating the query

6. Click the Run Query icon, with the green checkmark, to see the results.

Figure 13: Running the query and seeing the results

7. Click the Save Query icon and name the query.

Figure 14: Saving and naming the query

8. Close the window.

Printing CD or DVD Labels From Your Database

Let's say that you've created a lot of backups of your movies or you're a musician with a burgeoning music career, or you've created a number of mix CDs. For whatever reason, you need to print out a lot of labels. The easiest way to do this is to create a mail merge that sucks the information out of your database and prints a label for each of your movies or CDs.

1. You need to print, so you need a document. You can download a CD template such as the 4.5" CD templates for Writer. The spacing is important so you'll probably make more trouble for yourself than it's worth by creating your own label template from scratch. I've shown the template here with the borders on—it's created as a table—so you can see what you're working with more easily.

Figure 15: Template for CD or DVD case label with borders showing

2. To pull the data from your database, press F4 or choose View → Data Sources. Expand the database you want to use and select the table or query to use.

Figure 16: Selecting the query or table to do labels for

3. Click on the name of the field (not the data) that you want to use and drag it into the label. When you move your mouse over the field, you'll see the full path of the database, table, and field. Drag in all the fields that you want to use.

Figure 17: Dragging in the fields to print on the labels

4. At this point, most of the choices are up to you. Add any other text, like labels for the title, actors, etc. You can put in graphics, do colorful formatting; anything you want. Use table formatting tools to align the text at the top or bottom, or just press Return a few times to get it where you want it. Add shading to the table or to the background of the document to get the color you want. Do everything in the first label to the second label, as well: the same formatting, etc.

Figure 18: Formatting the fields in the labels

5. Copy the fields from the first label to the second.

6. You now need to insert the trigger that will make the next record in the database print—otherwise the next movie's information won't print until the next page.

a) In the second label area, click to the left of the first field, in this case Movie.

Figure 19: Preparing to insert an extra logic field

b) Choose Insert → Fields → Other, Database tab, select the Next Record field, select the database and table you're using, and click Insert.

Figure 20: Inserting the field that will trigger the next record

c) The Next Record field will be inserted but it doesn't take up any space, so it won't be very obvious. You only need to insert the Next Record field once per record; not in front of each field.

Figure 21: The inserted Next Record field

d) If you have three or more label areas in the template, copy all the fields from the second label area to each additional area.

Now when you print, you'll get a new record for each label.

7. Choose File → Print and click Yes to print a form letter. Don't mark the checkbox; you want this window to appear each time.

Figure 22: Choosing to print a form letter, aka a mail merge

8. In the print window, choose to print to a printer and click OK.

Figure 23: Selecting the output for the mail merge

9. In the Print window, select the printer you want, and be sure it's loaded with labels. Click OK.

10. One label will be printed for each movie (or other record) in your database.

Figure 24: The printed labels

About the author: Solveig Haugland is the author of the OpenOffice.org 2 Guidebook and blogs about OpenOffice.org at openoffice.blogs.com.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 10 comments… read them below or add one }

1 R0nin May 8, 2007 at 1:34 am

What you’ve described is how to mass print all records in the database. Now tell me, how do I print just ‘one specific’ record of that database.

Reply

2 nadav May 8, 2007 at 1:49 pm

very helpful, thanks :-)

Reply

3 Jonty May 10, 2007 at 3:55 pm

Please help, I am trying to print my forms I have used a filter on in Base.

When I print it only prints one form ?

Jonty

Reply

4 Robbie May 11, 2007 at 3:15 pm

This is great, now….what if we want to set up a database that scrapes IMDB.com for the information or that scrapes Amazon.com. That way it’d load all the details automatically and you could include things like coverart, replacement costs, etc. in a database you access from the web. Actually, anyone want to help me make that one? Email me:
web at cougaruited dot com

Reply

5 John Meyer May 15, 2007 at 12:32 pm

While OpenOffice can track your collection quite easily, there are other tools that have actually been designed to handle what you are talking about. For instance, I use Tellico for my book collection, but it also has modes to track movies and music, among others. In addition, Tellico can retrieve information from IMDB, the Library of Congress, Amazon, and other sources. It also fills in the check-digit for the ISDN number of a particular item.

Reply

6 nixCraft May 15, 2007 at 12:47 pm

John,

Thanks for sharing tellico – collection manager for books, videos, music etc :)

Appreciate your post!

Reply

7 Database June 14, 2007 at 6:11 pm

Thank you good article.

Reply

8 Open Office and Google Docs January 4, 2008 at 9:40 pm

I believe the Open Office website now has label templates for this… if it helps any.

Thanks for your post…

Karl A. Shalek
http://www.fastercats.com

Reply

9 bayana March 18, 2008 at 3:25 pm

thank for the note. it was really useful to move from Access to Office Org

Reply

10 Adi Coyajee June 24, 2008 at 8:10 am

This is a very tedious procedure. And all these frames are not printable on my HP B/W inkjetprinter. I sincerely hope thate Open Office 3 will present us an efficient wizzard for all printing from Open Office software/

Reply

Leave a Comment

Previous post:

Next post: