📘 FORMS AND REPORTS
Database Management System using LibreOffice Base
This chapter explains how Forms and Reports are used in LibreOffice Base to make data entry and presentation of database information more user-friendly.
1. Why Do We Need Forms and Reports?
In a database, tables store data in an organised manner. Data can be entered directly through the datasheet view, but the row-and-column format is not always user-friendly.
A Form provides a user-friendly screen for entering, viewing and modifying data, whereas a Report presents retrieved data in an attractive, understandable and formatted manner.
Both Forms and Reports are database objects and are available in the Database Pane of LibreOffice Base.
2. Forms
A Form is a database object that provides a user-friendly interface through which data can be entered, viewed and modified in an attractive and easy-to-read format.
Form: A database object having a user-friendly interface for entering and viewing data in an attractive and easy-to-read format.
Front End of Database
For a database, a form acts as the front end for data entry and data modification.
Unlike a simple row-and-column datasheet, a form displays data according to a layout designed by the user.
3. Field Control
A form primarily contains field controls arranged in a presentable and user-friendly manner.
Each field control consists of two important parts:
| Part | Meaning |
|---|---|
| Label | Text that specifies what data should be entered in the corresponding field. |
| Field Value Text Box | A text box linked to the respective field of the table. |
Field Control = Label + Field Value Text Box
Other Elements in a Form
- Titles
- Headings
- Names
- Graphics / Logos
- List Boxes
- Radio Buttons
4. Ways to Create a Form
There are two ways to create a form in LibreOffice Base:
- Using a Wizard
- Using Design View
5. Creating a Form Using Wizard
The Form Wizard is the simplest way to create a form.
Step 1 — Open Forms
Open the database and click the Forms icon in the Database Pane. Then select:
Use Wizard to Create Form…
Step 2 — Select Table or Query
Select the table or query for which the form has to be created. For example: Events table.
Step 3 — Available Fields
After selecting the table, its fields are displayed in the Available Fields list box.
Step 4 — Select Fields
Move the required fields from Available Fields to Fields in the Form.
The >> button can be used to move all available fields to the form.
Step 5 — Subform
A Subform means a form within a form.
To add a subform, select the Add Subform checkbox.
If no subform is required, click Next without selecting it.
Step 6 — Arrange Controls
The wizard provides different layouts for arranging the labels and field values.
| Layout | Description |
|---|---|
| Columnar display with labels on the left | Labels appear on the left of the field value. |
| Columnar display with labels on top | Labels appear above the field value. |
| Display as datasheet | Data is displayed in row-and-column format. |
| Block display with labels on top | Fields are arranged in blocks with labels on top. |
Step 7 — Form Usage
The wizard asks whether the form will be used for:
- Displaying data
- Entering data
- Both displaying and entering data
Step 8 — Apply Styles
The style step allows us to choose:
- Background colour
- Border type of field value text boxes
The available border styles include: 3D, No Border and Flat.
Step 9 — Give Form Name
Enter a suitable name for the form, for example: EventsForm.
After completion, the wizard allows us to:
- Work with the form
- Modify the form
Step 10 — Finish
Click Finish. The form is created and the first record is displayed.
6. Forms Controls Toolbar
The Forms Controls Toolbar contains various controls that can be added to or edited on a form.
Function of Forms Controls Toolbar: It contains various controls/tools used to add or edit controls on a form.
7. Records Toolbar
The Records Toolbar contains navigation controls used to move from one record to another.
It also contains commands for operations such as:
- Adding a new record
- Saving a record
- Deleting a record
- Navigating through records
| Toolbar | Main Function |
|---|---|
| Forms Controls Toolbar | Add or edit controls on a form. |
| Records Toolbar | Navigate and perform record operations such as new, save and delete. |
8. Modifying a Form
After creating a form, it can be modified according to the requirement.
Examples:
- Change background colour
- Change font size
- Change font colour
- Change position of controls
- Change label text
- Change size of text boxes
- Add tooltips
- Add calendar to date field
- Add titles and headings
9. Changing Background Colour
- Open the database and select Forms.
- Right-click the form name.
- Select Edit….
- In Design View, right-click the form.
- Select Page Style….
- Open the Area tab.
- Select the desired colour.
- Click OK.
10. Editing Labels
- Place the mouse pointer over the label.
- Press Ctrl + Click to select the label.
- Right-click the selected label.
- Select Control Properties….
- Change the Label property.
- Other properties such as width, height, alignment, font style and font size can also be changed.
Ctrl + Click → Select individual control such as a label or text box.
11. Moving a Control
A control can be moved to another location on the form.
- Click the control.
- Both label and field value text box are selected.
- Position handlers appear.
- To select only one part, use Ctrl + Click.
- Click and drag the selected control to the desired location.
12. Changing Text Box Size
- Press Ctrl and click the text box.
- Position handlers appear around the text box.
- Place the pointer on a handler.
- The pointer changes to a double-sided arrow.
- Click and drag to change the size.
13. Tool Tip / Help Text
A tool-tip is a small piece of text displayed when the mouse pointer is placed over a particular control.
Tool-tip / Help Text: A small text message that appears when the mouse pointer is placed over a particular control.
Example:
Enter Event Identification Number
Steps to Add Tool Tip
- Press Ctrl and click the EventID text box.
- Right-click and select Control Properties….
- Find the Help Text property.
- Enter the required message.
- Close the Properties dialog box.
Tool Tip = Help Text
14. Adding Calendar to Date Field
A calendar makes date entry easier because the user can select a date instead of typing it manually.
Important Properties
- Select the Date text box.
- Open Control Properties….
- Find Date Format.
- Select Standard (long).
- Find the DropDown property.
- Change its value from No to Yes.
- Close the dialog box.
To display a calendar for a Date field:
Date Format → Standard (long)
DropDown → Yes
15. Adding Text / Title to Form
Titles, headings and subheadings can be inserted while designing a form.
Steps
- Select the Label tool from Forms Controls Toolbar.
- Click and drag on the form to create a label box.
- Double-click the box.
- Open Properties: Label Field.
- Enter the required text in the Label property.
- Use the Font property to change font type, style and size.
- Close the Properties dialog box.
Title: Data Entry Form
16. Design View and Form View
| Design View | Form View |
|---|---|
| Used to create and modify the form. | Used to display and work with records through the form. |
| Controls can be added, moved and formatted. | Records can be viewed, entered and modified. |
The Design Mode button on the Forms Controls Toolbar is used to toggle between Design View and Form View.
17. Adding a New Record Using Form
After designing the form, switch to Form View.
- Click the New Record button on the Records Toolbar.
- A blank form appears.
- Enter the required data.
- Click Save Record.
Deleting a Record
- Navigate to the required record.
- Click the Delete button on the Records Toolbar.
- The next record is displayed.
18. Reports
A Report is another useful feature of a Database Management System.
Queries display retrieved data in simple row-and-column format. A report presents that retrieved data in an attractive, understandable, formatted and customized manner.
Report: A database object used to present retrieved data in an attractive and customized manner.
Report Can Be Based On
- Table
- Query
- Both table and query
If a report has to be generated from multiple tables, it is preferable to create a query first and then use that query to generate the report.
19. Creating a Report Using Wizard
Step 1 — Open Reports
Click the Reports icon in the Database Pane.
Step 2 — Report Wizard
Select: Use Wizard to Create Report…
Step 3 — Windows Open
The Report Wizard opens along with:
- Report Builder
- Add Fields dialog box
Report Wizard opens along with Report Builder and Add Fields dialog box.
Step 4 — Select Table and Fields
Select the required table or query. For example: Events.
Move the required fields from Available Fields to Fields in report.
Step 5 — Label the Fields
The default field names can be changed into more explanatory column headings.
Step 6 — Group Data
Records can be grouped according to a particular field.
Example: CategoryID can be used to generate category-wise reports.
Step 7 — Sort Data
Data can be sorted in:
- Ascending order
- Descending order
Example: Records can be sorted according to EventID.
Step 8 — Select Layout
The layout determines how labels, field values and titles appear in the report.
Example: Tabular layout.
Header/footer and page orientation can also be selected.
Orientation options: Landscape and Portrait.
Step 9 — Name the Report
Give a suitable name such as: EventsReport.
20. Dynamic and Static Report
| Dynamic Report | Static Report |
|---|---|
| Automatically reflects changes made in the underlying table or query. | Does not automatically update when the underlying data changes. |
| Useful when current data needs to be reflected. | Useful when a fixed version of the report is required. |
Dynamic → changes automatically with table/query data.
Static → does not automatically update.
21. Report Builder
The Report Builder is used to modify and format a report.
Additional controls can be inserted using the Report Controls Toolbar.
22. Inserting Titles and Headings in Report
- Click the Label tool on the Report Controls Toolbar.
- Click and drag on the report to create a label box.
- Double-click the label.
- Enter the required title in the Label property.
- Use the Font property to change font type, style and size.
- Close the Properties dialog box.
Annual Sports Day Report
23. Inserting Date and Time in Report
- Click inside the Page Header area.
- Select Insert → Date and Time….
- The Date and Time dialog box appears.
- Select the desired date/time format.
- Click OK.
- The date/time can be repositioned by dragging it.
24. Grouping Records in a Report
Reports can group retrieved data according to a particular field.
Example: If events have to be displayed category-wise, move the CategoryID field to the Groupings list box.
Grouping = arranging records according to a field.
Example: CategoryID → Category-wise report
25. Form vs Report
| Form | Report |
|---|---|
| User-friendly interface for entering, viewing and modifying data. | Presents retrieved data in an attractive and customized manner. |
| Mainly used for data entry and modification. | Mainly used for presentation of data. |
| Works as the front end for database data entry. | Provides formatted presentation of retrieved data. |
26. Important Properties & Tools
| Term / Tool | Purpose |
|---|---|
| Forms Controls Toolbar | Add/edit controls on a form. |
| Records Toolbar | Navigate and manage records. |
| Control Properties | Modify properties of a selected control. |
| Help Text | Add tooltip/help message. |
| Design Mode | Toggle between Design View and Form View. |
| Date Format | Controls the format of date display. |
| DropDown | Allows dropdown/calendar functionality for date control. |
| Report Controls Toolbar | Add controls while editing a report. |
| Groupings | Groups records according to selected field. |
27. Most Important Exam Questions
Q1. What is a Form?
Ans. A Form is a database object having a user-friendly interface for entering and viewing data in an attractive and easy-to-read format.
Q2. What is a Report?
Ans. A Report is a database object used to present retrieved data in an attractive and customized manner.
Q3. What is a field control?
Ans. A field control consists of a label and a field value text box. The text box is linked to the corresponding field of the table.
Q4. Name the two ways to create a Form.
Ans. Using a Wizard and Using Design View.
Q5. What is a Subform?
Ans. A Subform is a form within a form.
Q6. What is a Tool Tip?
Ans. It is a small piece of text displayed when the mouse pointer is placed over a particular control.
Q7. Which property is used to add tooltip text?
Ans. Help Text property.
Q8. How can a calendar be added to a Date field?
Ans. Set Date Format to Standard (long) and DropDown property to Yes.
Q9. What is the function of Records Toolbar?
Ans. It provides navigation and record-management controls such as moving between records, adding, saving and deleting records.
Q10. What is the difference between Dynamic and Static Report?
Ans. A Dynamic Report automatically reflects changes in the underlying table/query, whereas a Static Report does not automatically update.
Q11. On what can a report be based?
Ans. A report can be based on a table, query or both.
Q12. Which layout can be selected for a report?
Ans. One available layout is Tabular. Header/footer and orientation such as Landscape or Portrait can also be selected.
28. 🔥 MCQ FACTS — Direct Revision
- Form is a database object.
- Report is a database object.
- Form provides a user-friendly interface.
- Field Control = Label + Field Value Text Box.
- Two methods of creating Form = Wizard + Design View.
- Subform = Form within a form.
- Tooltip property = Help Text.
- Calendar requires Standard (long) date format.
- Calendar requires DropDown = Yes.
- Design Mode toggles Design View / Form View.
- Report can be based on Table / Query / Both.
- Report Wizard works with Report Builder + Add Fields.
- Report data can be grouped.
- Report data can be sorted Ascending / Descending.
- Report orientation = Landscape / Portrait.
- Dynamic Report reflects changes in the underlying data.
⚡ QUICK REVISION — CHAPTER 12
- Form: User-friendly data entry/viewing interface.
- Report: Attractive and formatted presentation of retrieved data.
- Field Control: Label + Field Value Text Box.
- Form Creation: Wizard or Design View.
- Subform: Form within a form.
- Forms Controls Toolbar: Add/edit form controls.
- Records Toolbar: Navigate/manage records.
- Tooltip: Help Text.
- Date Calendar: Standard (long) + DropDown = Yes.
- Design Mode: Design View ↔ Form View.
- New Record: Records Toolbar.
- Save Record: Records Toolbar.
- Delete Record: Records Toolbar.
- Report Source: Table / Query / Both.
- Multiple Tables: Preferably create a query first.
- Grouping: Based on selected field.
- Sorting: Ascending / Descending.
- Orientation: Landscape / Portrait.
- Dynamic: Automatically reflects data changes.
- Static: Does not automatically update.
Chapter 12 mein sabse zyada important concepts:
Form vs Report • Field Control • Two methods of Form Creation • Forms Controls Toolbar • Records Toolbar • Tool Tip • Help Text • Date Format • DropDown • Design Mode • New/Save/Delete Record • Report Wizard • Grouping • Sorting • Landscape/Portrait • Dynamic vs Static Report