Tip: Collect Slide Masters in a Template
13.2 Using Databases with Base
LibreOce includes the database module Base. Use Base to design a database to store many kinds of information. From a simple address book or recipe le to a sophisticated document management system.
Tables, forms, queries, and reports can be created manually or by using convenient wizards.
For example, the Table Wizard contains several common elds for business and personal use.
Databases created in Base can be used as data sources, such as when creating form letters.
It is beyond the scope of this document to detail database design with Base. Find more information at the sources listed in Section 10.10, “For More Information”.
13.2.1 Creating a Database Using Predefined Options
Base comes with several predened database elds to help you create a database. A wizard guides you through the steps to create a new database. The steps in this section are specic to creating an address book using predened elds, but it should be easy to follow them to use the predened elds for any of the built-in database options.
The process for creating a database can be broken into several subprocesses:
1. Creating the Database
2. Setting Up the Database Table 3. Creating a Form
4. Modifying the Form
106 Using Databases with Base SLES 12 SP4
13.2.1.1 Creating the Database
1. Start LibreOce Base.
The Database Wizard starts.
You can choose between creating an HSQLDB or Firebird database.
HSQLDB Embedded (default)
This database format is also available in older versions of OpenOce.org and LibreOce. It depends on Java being installed on the computer.
Firebird Embedded
This database format can only be used in newer versions of LibreOce. It does not depend on Java. When you do large database operations, Firebird can perform better.
2. Proceed with Next.
3. Click Yes, register the database for me to make your database information available to other LibreOce modules and select the check boxes to Open the database for editing and Create tables using the table wizard. Then click Finish.
4. Browse to the directory where you want to save the database, specify a name for the database, then click Save.
13.2.1.2 Setting Up the Database Table
After you have created the database, if you have selected the Create tables using the table wizard check box, the table wizard opens. If you have not, go to the Task area and click Use Wizard to Create Table. Next, dene the elds you want to use in your database table.
In this example, set up an address database.
1. For this example, click Personal.
The list Sample tables changes to show the predened tables for personal use where the address table template is. The table templates listed under Business contain predened business tables.
2. In the Sample tables list, click Addresses.
The available elds for the predened address book appear in the Available elds menu.
3. In the Available elds menu, click the elds you want to use in your address book.
107 Creating a Database Using Predefined Options SLES 12 SP4
Select one item at a time by clicking. Alternatively, to select multiple items, hold Shift and click each of the items separately.
4. Click the icons single right arrow and single left arrow to move selected items to or o the Selected elds list.
To move all available elds to the Selected elds menu, click the icon double right arrow.
5. Use the icons up arrow and down arrow to adjust the order of the selected entries, then click Next.
The elds appear in the table and forms in the order in which they are listed.
6. Make sure each of the elds is dened correctly.
You can change the eld name, type, maximum characters and whether it is a required
eld. For this example, leave the settings as they are, then click Next.
7. Make sure that Create a primary key and Automatically add a primary key are activated.
Additionally activate Auto value.
Proceed with Next.
8. Give the table a name, and activate Create a form based on this table.
Proceed with Finish.
108 Creating a Database Using Predefined Options SLES 12 SP4
13.2.1.3 Creating a Form
Next, create the form to use when entering data into your address book.
After the previous step, you should be in the Form Wizard already. Otherwise, open it by going to the main window. Under Tables, right-click the correct table. Click Form Wizard.
1. In the Form Wizard, click the double right-arrow icon to move all available elds to the Fields in the form list, then click Next.
2. To add a subform, activate Add Subform, then click Next.
For this example, accept the default selections.
3. Select how you want to arrange your form, then click Next.
4. Select The form is to display all data and leave all of the check boxes deactivated, then click Next.
5. Apply a style and eld border, then click Next.
For this example, accept the default selections.
6. Name the form, activate Modify the form, then click Finish.
13.2.1.4 Modifying the Form
After the form has been dened, you can modify the appearance of the form to suit your preferences.
After the previous step, you should be in the Database Form editor already. If not, select the right form by clicking Forms in the side bar of the main window. Then, in the Forms area, right-click the correct form. Select Edit.
1. Arrange the elds on the form by dragging them to their new locations.
For example, move the eld First Name, so it appears to the right of the eld Last Name.
2. When you have nished modifying the form, save it and close it.
13.2.1.5 Further Steps
After you have created your database tables and forms, you are ready to enter your data. You can also design queries and reports to help sort and display the data.
109 Creating a Database Using Predefined Options SLES 12 SP4
Refer to LibreOce online help and other sources listed in Section 10.10, “For More Information”
for additional information about Base.