How to print more than one record on a sheet of paper in OpenOffice

How to print more than one record on a sheet of paper in OpenOffice


When you download mail merge template or create your own, you lose a feature that's built into the OpenOffice.org mail merges and reports: printing more than one record on a sheet of paper. However, it's easy to add that ability yourself.

This article addresses the issue of how to have information from multiple records on the same sheet of paper, in mail merges for lists, downloaded label templates, and other mail merge documents. The first section of this article explains how mail merges work regarding when the next record is chosen, and why. If you’re already familiar with this, go straight to the solution in the tutorial part of the article, Triggering a new record whenever you want it by using the next record field.

This article has three sections: the problem, how the program works, and how to get around it.

  • How mail merges work by default covers the default behavior, and why that’s not always what you want
  • Why the mail merge doesn’t trigger the next record all the time covers why it’s sometimes a good idea, and sometimes not, to have the same record print multiple times on the same sheet of paper. It’s a “nice to know” explanation that you can skip if you’re looking for the solution.
  • Triggering a new record whenever you want it by using the next record field provides steps for controlling exactly when your mail merges switch to the next record.

A mail merge is a connection between a document and a database

How mail merges work by default

A mail merge is a connection between a document and a database. The document pulls information for certain fields, like Name and Address and Birthdate, out of the database. You set up your mail merge document easily (figure 1).

Figure 1: Standard mail merge setupFigure 1: Standard mail merge setup

The information for the first record (the first person in this case) is printed, then the second record, and so on (see figure 2).

Figure 2: The printed results of a mail mergeFigure 2: The printed results of a mail merge

Here’s the question, though:

When do you go to the next record? What makes the mail merge document switch so that we see the information about Miranda?

In labels, it makes sense for information about the next record to show up in the next label, which is the next time that the field appears. And that’s how it works when you create labels—at least, when you create labels by choosing File→New→Labels. It’s also how things work when you create a report generated from your database; multiple records will be printed in the same page because the logic is built into the report wizard.

Let’s say that you don’t want to use the document-creation tools provided by OpenOffice.org; you want some more control over exactly what output you have. So you download templates, like the ones at WorldLabel.com, which has free OpenOffice.org templates. If you’re using those templates or if you create your own mail merge document from scratch, you’re going to get the same name and address in every label area until you go to the next page, with 10 or 30 labels for the same person. The logic to trigger the next record isn’t built into those templates.

Situations when you want to have multiple fields from the same record on the same page

The default behavior for mail merges is to err on the side of giving you the opportunity to repeat information if you want it. And sometimes you do. If you’re creating a mail merge letter, you sometimes want the same information for one record to repeat. Sometimes your letter goes for three pages. It certainly doesn’t make sense to show information from the next record after each carriage return, or the next time the field shows up.

The default behavior for mail merges is to err on the side of giving you the opportunity to repeat information if you want it

FIgure 3 shows you how you might set up a typical mail merge letter.

Figure 3: Setting up a mail merge letterFigure 3: Setting up a mail merge letter

Figure 4 shows you what it would look like if you triggered a new record each time you got a new carriage return, reuse of a field, or new page.

Figure 4: Unfortunate results of a mail merge that flips to the next record each time a field appears againFigure 4: Unfortunate results of a mail merge that flips to the next record each time a field appears again

These are specific situations for printing on the same page. When you do want a bunch of different records on the same page, however, how do you trigger the Next Record?

Triggering a new record whenever you want it by using the next record field

Every time you want to trigger the next record, choose Insert→Fields→Other, Database tab. In the Type column select Next Record, and in the Database Selection list select your database and table. Click Insert (Figure 5).

Figure 5: Inserting the Next Record triggerFigure 5: Inserting the Next Record trigger

You will see either nothing appear in the document, or a very small gray speck. If you insert it by itself you’ll see it, but you won’t see it when you insert it, as you typically will, next to another field (figure 6).

Figure 6: How the Next Record field looks (at its most obvious)Figure 6: How the Next Record field looks (at its most obvious)

You don’t even need to click Insert every time. You can copy and paste that small gray field to the next line, or the next label, or, another four inches down the page—wherever you want the next record to begin.

Here are a couple ways you could use it.

Labels

In labels you create from WorldLabel templates or other templates, set up the first label normally and copy it to the second label area too. Then insert the Next Record field in front of the FirstName field in the second label area, and copy the whole label. Paste it to all the other label areas in the template. You only need to insert the Next Record field once per record; not in front of each field (see figure 7).

Figure 7: Using the Next Record with labelsFigure 7: Using the Next Record with labels

Reports or lists

If you don’t want to use the Reports function in the database management window, or if you just want something simpler, you could set up a report like this. Drag the first line of fields out, then press Return and copy and paste them to the second line.

Having control over exactly what you want to do doesn’t always mean it’s easy to figure out

Click to the left of the first field in the second line and insert the Next Record field. You only need to insert the Next Record field once per record; not in front of each field.

Now copy that second line and paste it again until you’ve filled the page figure 8).

Figure 8: Setting up a report using the Next RecordFigure 8: Setting up a report using the Next Record

In conclusion: control doesn’t always mean simplicity

As we know from using LaTeX and Word, having control over exactly what you want to do doesn’t always mean it’s easy to figure out. There are two logical and very different ways for the mail merge to work. OpenOffice.org chose one, and if you want it to work the other way, well, it’s just a matter of inserting the Next Record field. On the plus side, you only need to set up your label template once, then use it again each time you print new records.

Category: 
License: 

Author information

Solveig Haugland's picture

Biography

Solveig Haugland has worked as an instructor, course developer, author and technical writer in the high-tech industry for 16 years, for employers including Microsoft Great Plains, Sun Microsystems,and BEA. Currently, Solveig is a StarOffice and OpenOffice.org instructor, author, and freelance technical writer. She is also co-author, with Floyd Jones, of three books: Staroffice 5.2 Companion, Staroffice 6.0 Office Suite Companion and OpenOffice.Org 1.0 Resource Kit, published by Prentice Hall PTR. Her fourth book, the OpenOffice.org 2.0 Guidebook, is available from Amazon.com, from Cafepress, and directly from Solveig . For tips on working in OpenOffice.org or StarOffice, visit Solveig's blog: http://openoffice.blogs.com.

Most forwarded

Interview with Dave Mohyla, of DTIDATA

Dave Mohyla is the president and founder of dtidata.com, a hard drive recovery facility based in Tampa, Florida.

TM: Where are you based? What does your company do?
DTI Data recovery is based in South Pasadena, Florida which is a suburb of Tampa. We have been here for over 10 years. We operate a bio-metrically secured class 100 clean room where we perform hard drive recovery on all types of hard disks, from laptop hard drives to multi drive RAID systems.

Anybody up to writing good directory software?

Since the very beginning, directories (of any kind) have had a very central role in the internet. (I have recently grown fond of Free Web Directory. Even Slashdot can be considered a directory: a collection of great news and invaluable user-generated comments. As far as software is concerned, doing a quick search on Google about software directories will return the free (as in freedom) software directories like Savannah, SourceForge, Freshmeat and so on, followed by shareware and freeware sites such as FileBuzz, PCWin Download Center and All Freeware (great if you're looking for shareware and freeware, but definitely less comprehensive than their free-as-in-freedom counterparts).

Interview with Mark Shuttleworth

Mark Shuttleworth is the founder of Thawte, the first Certification Authority to sell public SSL certificates. After selling Thawte to Verisign, Mark moved on to training as an astronaut in Russia and visiting space. Once he got back he founded Ubuntu, the leading GNU/Linux distribution. He agreed on releasing a quick interview to Free Software Magazine.

Is better education the key to finding better software?

I read David Jonathon's article Anybody Up To Writing Good Directory Software? the other day, which got me thinking about software directories in general. As David mentioned, many of the software directories one finds when doing a quick google search are free as in beer, not as in freedom. But what interests me is the software directories that already exist, providing a combination of both free as in beer software, and open source software. Sites such as Freeware Downloads and Shareware Download don't advertise themselves as providing free as in liberty software, but each of them have a good selection of open source software available... if you know where to look.

Most emailed

Free Open Document label templates

If you’ve ever spent hours at work doing mailings, cursed your printer for printing outside the lines on your labels, or moaned “There has got to be a better way to do this,” here’s the solution you’ve been looking for. Working smarter, not harder! Worldlabel.com, a manufacture of labels offers Open Office / Libre Office labels templates for downloading in ODF format which will save you time, effort, and (if you want) make really cool-looking labels

Creating a user-centric site in Drupal

A little while ago, while talking in the #drupal mailing list, I showed my latest creation to one of the core developers there. His reaction was "Wow, I am always surprised what people use Drupal for". His surprise is somehow justified: I did create a site for a bunch of entertainers in Perth, a company set to use Drupal to take over the world with Entertainers.Biz.

Update: since writing this article, I have updated the system so that the whole booking process happens online. I will update the article accordingly!

So, why, why do people and companies develop free software?

More and more people are discovering free software. Many people only do so after weeks, or even months, of using it. I wonder, for example, how many Firefox users actually know how free Firefox really is—many of them realise that you can get it for free, but find it hard to believe that anybody can modify it and even redistribute it legally.

When the discovery is made, the first instinct is to ask: why do they do it? Programming is hard work. Even though most (if not all) programmers are driven by their higher-than-normal IQs and their amazing passion for solving problems, it’s still hard to understand why so many of them would donate so much of their time to creating something that they can’t really show off to anybody but their colleagues or geek friends.

Sure, anybody can buy laptops, and just program. No need to get a full-on lab or spend thousands of dollars in equipment. But... is that the full story?

Fun articles

Santa Claus - the most successful open source project

It dawned on me the other day, as I was shopping for the dozens of gifts it seems I have to buy every December, that Santa Claus is the most successful open source project in history. (Bridget @ Illiterarty would agree with that). Santa Claus is essentially a marketing development that is embodied by everyone who stuffs a sock, gives a gift, hosts a dinner or wishes Merry Christmas over the holiday season.

Most emailed

Editorial

When I first started thinking about Free Software Magazine, I was feeling enthusiastic about the dream. I had Dave, Gianluca, and Alan willing to help me, I had established members of the free software community willing to help me out, I had writers volunteering their time and energy for free, and I had a generous offer from OpenHosting for servers, all before I'd proved myself. There was a sense of excitement in the air, and I thought maybe, just maybe, I could make this work.

Free Software Magazine uses Apollo project management software and CRM for its everyday activities!