1
Forms and Reports
● To develop a user-friendly data entry screen for data entry operator or a user,
who is not very well versed with computers.
● While doing data entry, the user may accidentally or intentionally alter the data
s
in the table.
e
● When the user wants to retrieve and view the data from one or more tables in a
ot
database using queries, it is again displayed in data-sheet view.
● The Report feature of OpenOffice Base helps to present the retrieved data in a
N
user-friendly, understandable and formatted manner
r's
Forms
● A form is an object of the database that has a user friendly interface where data
de
can be entered and seen in an attractive and easy-to-read format.
● For any database, it is the front end for data entry and data modification.
● It displays the data in a layout design by us and not just in a simple row and
an
column format.
Primarily, a form contains field controls arranged in a presentable and user friendly
ex
manner.
Each field control consists of a label and the field value text box. A label is a piece of
Al
text that specifies the data that should be entered in the field value text box.
e
A field value text box is linked to the respective field in the table. We may
nc
add all or selected fields from the table on the form
Add all or selected fields from the table on the form.
ui
In addition to field controls, it may contain some additional text like titles, headings
Q
and names, graphics like logos, list boxes and radio buttons
Creating a Form Using a Wizard
Simplest way to create a form
2
1. Click the option Use Wizard to Create Form… on the Tasks Pane. The Form
wizard will open along with a blank database form in design view in the
background
2. The step 1 of the wizard is to select the tables or queries for which the form has
to be created
Select table from “Tables and queries” list box
s
3. All the fields of The Events table will be listed in the Available Fields list box
e
4. Shift the fields of the table from Available Fields list box to Fields in the Form
ot
list box using > or >> button.
All the fields are shifted to Fields in the Form list box. Click on Next button to
N
move forward.
5. The second step consists of setting up a subform, i.e. a form within a form.
r's
Check the checkbox “Add Subform” to add the subform.
Click Next button
de
6. The wizard skips the next two steps that relate to the subform and moves on to
step 5.
an
This step arrange controls i.e. to set up the design of the form. By default, all
controls will be left aligned.
ex
In this step we arrange the label and field value text boxes as we want them to
be visible on the screen.
Al
Four layouts are given in this step of the wizard to choose from:
• Columnar display with Labels on the left of the field value
e
• Columnar display with Labels on top of the field value
• Display as datasheet
nc
• Block display with labels on top
ui
As we choose the Layout type, the fields are arranged in the Form Design view also.
Q
7. Click Next button.
8. The step 6 of the wizard asks whether the form will be used for displaying data,
entering data or both. Click Next
9. The next step is to apply styles to the form being created. We can select the
desired background colour and border type of the field value text boxes
By default the border of the field text value is displayed in 3D look.
3
10. Click Next
11. The next step is to set the name of the form. By default the name of the form
is same as the name of the table. Click in the textbox and type a different name
if desired
By default, the radio button with the option Work with the form is selected
s
If you wish to modify the form after the wizard finishes, click Modify the form option
e
ot
12. Click Finish button. The form with the first record will be displayed on the
screen in a separate window
N
On the left of the Form Design window is the Forms Control toolbar and at the
r's
bottom is the Records toolbar.
Forms Control Toolbar
de
This toolbar contains various controls that can be added to the form
an
Records Toolbar
ex
● The Records toolbar contains the navigation control buttons in the extreme left.
● Traverse and view the records in the file
● The record number is in the record text boxes
Al
● There are commands to add a new record, save a record, delete a record and
so on.
e
Modifying a Form
nc
The modification can be to change the background color, font size and color of the
text or even positioning of various controls in the form
ui
Q
Changing the background color
1. Right click on the form name and select Edit… option. A separate Form Design
View will open
2. To change the background colour of the form, right click on the form and select
Page Style… option from the pop up menu
4
3. The Page Style dialog box will appear, where you select Area tab and choose
the desired colour from the palette
4. Click on OK button. The selected colour will be applied on the form
Editing the labels
Changing the text or by changing the formatting effects
s
● Place the mouse pointer over the label, to change it.
e
● Press the keyboard shortcut key Ctrl+Click to,select the label. The position
ot
boxes will appear around the label.
● Right click on the selected label and select Control Properties… option from
N
the pop up menu
● The Properties: Label Field dialog box will appear. It contains various properties
r's
of the selected label. In the text box after Label property, type the field name.
The label caption on the form changes accordingly.
de
Similarly we can change other properties of the selected label like width, height,
alignment, font style and font size.
● After making the desired changes close the Properties dialog box by clicking the
an
cross (x) button on the top right of the dialog box. The changes made will be
applied on the selected text.
ex
Moving a Control
Click on the control that has to be moved. Both the label and the text box for field
Al
value will be selected and position handlers will be placed around the control.
If only one of these have to be re-positioned then press Ctrl key while clicking on that
e
control. Now, click and drag the control to move to the desired location
nc
Adding a Tool tip
A tool-tip is a small piece of text that is displayed when the mouse pointer is placed
ui
on a particular control
Q
This will make entering data for the user easy. Such type of text that appears when
the mouse pointer is placed on a particular control is called the tool-tip text or help
text.
1. Press Ctrl button and click on text box.
5
2. Right click and select Control Properties… option. The Properties: Text Box
dialog box will be displayed
3. In the dialog box, scroll down till Help Text property appears.
4. Type ‘enter blah’ in the text box.
5. Close the dialog box by clicking on cross (X) button. Now, if the mouse pointer is
placed over the text box, the tool tip will be displayed
e s
Forms Controls Toolbar
ot
The forms control toolbar contains various tools to add or edit controls on the form.
N
Adding a calendar for the date field
A calendar is displayed. This is because it is easy to choose a date rather than typing
r's
it.
de
1. Place the mouse pointer over the Date text box and press Ctrl+Click to select
it.
2. Right click and select Control Properties…. Option
an
3. In the Properties: Date Field dialog box, scroll down for Date Format property.
By default, Standard (short) format will be displayed.
ex
4. Click to open the list box and select Standard (long) format.
5. Scroll down further till you find the DropDown property. By default its value will
Al
be No. Select Yes
6. Close the dialog box. The selected date control text box on the form changes to
a list box with an arrow being displayed in the extreme right
e
nc
Adding text to the form
Titles, headings or subheadings. It is called as Labels.
1. Click the Label ( ) tool on the Form Controls tool box
ui
2. On the form, click and drag the mouse to create a label field box. It will also
Q
have position handlers.
3. Double click on the box to open the Properties: Label Field dialog box.
4. Type the title in the Label property
5. Set the Font property by clicking the Font button in front of the Font property.
The Character dialog box will be displayed where you can set the font type,
style and size. Choose the desired font style and size and click on OK button.
6
6. Close the Properties: Label Field dialog box. The title with the selected
formatting effects will be displayed on the form.
Adding a new record using a form
you can display or insert records using this form.
s
Shift from Design View to Form View by clicking on Design Mode button on the
e
Forms Controls toolbar. The Form View window appears with the first record
ot
displayed in the respective text boxes
N
To add a new record into the table using this form, click on New Record button on the
Records toolbar
r's
A blank form with the cursor blinking in the first text box will be displayed.
de
Record pointer shows the record 11, as there were already 10 records in the table.
Once the record is entered, click on Save Record button on the Records toolbar to
an
save the record in the table.
ex
To delete any record, navigate to the record by either typing the record number in the
Record text box or by using the navigation buttons. Thereafter click Delete
button on the Records toolbar. The next record will be displayed in the form.
Al
e
Records
nc
● Using a report we can present the retrieved data in an attractive and customized
manner.
ui
● We can create a report based on a table or a query or both.
Preferably, if a report has to be generated from multiple tables, a query should be
Q
created first and then that query can be used to generate the report.
1. From the Tasks Pane, click Use Wizard to Create Report… option.
2. The Report wizard along with Report Builder Window Add Field dialog box
will be displayed.
7
3. The first step of wizard is to select the table and the corresponding fields that we
want to display in our report. From the Tables or Queries list box, select the
table
4. All the fields of the table will be listed in the Available Fields list box. Click >>
button to shift all the fields to Fields in report list box.
5. Click on the Next button. The next step is to label the fields. By default, the
s
column headers will be displayed as labels or column headers for the field
e
values
ot
6. Click on the Next button. The next step is to group the data based on any of the
fields in the report.
N
7. The fourth step is to set the Sort options.The radio button for Ascending is
already selected.
r's
8. Click on the Next button. Now, the layout of the report will be selected.
9. A layout is the manner in which the labels, field values and titles will be
de
displayed in the report. Choose the desired layout also of headers and footers
Orientation option Landscape or Portrait in this step.
10. Click on Next button Here we name the report and to specify the manner in
an
which we want to proceed after the wizard finishes. Type the name of the report.
By default the type of report is Dynamic. That means as the field values in the
ex
base table or query change, the report will also change automatically. If you
don’t want automatic updation of the report, choose the Static option. In this
step, specify whether you would like to modify the report or create the report
Al
once the wizard finishes.
11. Click on Finish button to display the report
e
Inserting other controls in the report
nc
Right click on the Report name on the LibreOffice User Interface and then select
the Edit… option.
ui
The Report Builder window will open. In this window, various controls can be
Q
inserted using the Report Controls toolbar.
Inserting Titles and Headings
1. Click on the Label tool available on the Report Controls toolbar
2. Bring the mouse pointer on the report. Click and drag to insert the label textbox.
8
3. Double click on it to open the Properties dialog box. Type the title text that you
want to display in the Label property textbox, and also set the font style and
size using the Font property
4. Close the Properties dialog box. Double click on the Report in the Reports of
Database Pane. The report will be displayed with with the formatted effects
s
Inserting Date and Time
e
1. Click in the Page Header area to make it active.
ot
2. Click Insert > Date and Time… option
N
3. The Date and Time dialog box will be displayed. Select the desired format for
date and time format and click on OK button
4. The date will be inserted on the top left corner of the Page Header area.
r's
Drag to reposition
To create a report that groups the retrieved data according to a particular field, specify
de
the field name according to which the retrieved data has to be grouped in step 3 of
the wizard.
an
ex
Al
e
nc
ui
Q