Using Forms in Writer

From Apache OpenOffice Wiki
Jump to: navigation, search

This is Chapter 15 of the 3 Writer Guide, produced by the OOoAuthors group. A PDF of this chapter is available from this wiki page. The PDFs are up to date for the second edition of the book,and the wiki pages for this chapter have been updated.


This chapter covers the use of forms within Writer documents. Most of the information here also applies to forms in other components, but there are some differences.

The chapter presents information on using forms in four main sections: setting up a basic form, an example for creating a form, linking a form to a data source and finally some advanced techniques. forms cover a lot of ground and not everything is included here. Notable omissions are using forms in HTML documents and writing macros to link to form controls.

When to use forms

A standard text document displays information: a letter, report or brochure, for example. Typically the reader may edit everything or nothing in any way. A form has sections that are not to be edited, and other sections that are designed for the reader to make changes. For example, a questionnaire has an introduction and questions (which do not change) and spaces for the reader to enter answers. offers several ways to enter information into a form, including check boxes, option buttons, text boxes, pull-down lists, and other items, collectively known as form controls.

Forms are used in three ways:

  • To create a simple document for the recipient to complete, such as a questionnaire sent out to a group of people who fill it in and return it.
  • To link into a database or data source and allow the user to enter information. Someone taking orders might enter the information for each order into a database using a form.
  • To view information held in a database or data source. A librarian might call up information about books.

Using forms to access a database offers a fast and easy way to build up complex graphical front ends. Your form can include not only the fields that link up to the data source but also text, graphics, tables, drawings and other elements.

A typical way to use a simple form is:

  1. You design the form, then save it when you are happy with it.
  2. You send the form to others (for example, by email).
  3. They fill in the form, save it and send it back to you.
  4. You open the form and see what their answers are.

Tip.png By using a data source, or setting a form to update over the web, you can automatically gather data. However, both of those are more complex and you might prefer to keep things simple.

Alternatives to using forms in Writer

In 3, the Base component provides an alternative way to access a data source. There are a lot of similarities between forms in Base and Writer, but one may be better for a particular task than the other. Base is appropriate only if the form accesses a data source; you would not use it for simple forms.

Most other components—Calc, Impress, and Draw—also support forms in almost the same way that Writer does.

Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).
Personal tools