Chapter 12: Forms and Reports Notes
1. Introduction & Core Concepts
- Database Objects: Both Forms and Reports are key database objects located in the Database Pane of the LibreOffice Base interface.
- Purpose of Forms: Provide a user-friendly interface for data entry and modification to prevent accidental or intentional damage to underlying tables, serving as the front-end interface.
- Purpose of Reports: Present data retrieved from tables or queries in a formatted, customized, and understandable presentation layout rather than standard row-and-column datasheet view.
2. Forms in LibreOffice Base
Structure of a Form
- Field Controls: The primary component of a form, consisting of two parts:
- Label: Text specifying what data should be entered.
- Field Value Text Box: Linked directly to the corresponding database field.
- Additional Elements: Form designs can also include titles, headers, logos, list boxes, radio buttons, and action controls.
Methods of Creating Forms
- Using a Wizard (simplest and guided method).
- Using Design View (manual layout and customization using tools).
Steps in the Form Wizard
- Field Selection: Choose the base table/query and move desired fields from Available Fields to Fields in the Form.
- Set up a Subform: (Optional) Add a nested form within a form.
- Control Layout: Choose control alignment (e.g., left, right) and select from four layout styles:
- Columnar display with labels on the left.
- Columnar display with labels on top.
- Display as datasheet.
- Block display with labels on top.
- Data Entry Mode: Set whether the form will display data, enter data, or perform both operations.
- Apply Styles: Customize background colors and border styles for text boxes (3D look by default, Flat, or No Border).
- Set Name: Assign a form name (e.g.,
EventsForm) and choose whether to open the form for work or edit it immediately.
Form Modification & Customization
- Changing Background Color: Right-click form $\rightarrow$ Page Style… $\rightarrow$ Area tab $\rightarrow$ select color $\rightarrow$ OK.
- Selecting Controls:
- Click to select the control group (label + text box).
- Press
Ctrl+ Click to select only the label or text box independently.
- Editing Labels:
Ctrl+ Click on label $\rightarrow$ right-click $\rightarrow$ Control Properties… $\rightarrow$ modifyLabeltext, font style, size, width, or height. - Adding a Tooltip (Help Text):
Ctrl+ Click on field text box $\rightarrow$ right-click $\rightarrow$ Control Properties… $\rightarrow$ scroll to Help Text property $\rightarrow$ enter hint text. - Adding a Calendar Dropdown:
Ctrl+ Click on date field text box $\rightarrow$ Control Properties… $\rightarrow$ changeDate Formatto Standard (long) $\rightarrow$ setDropDownto Yes. - Adding Custom Titles/Text: Click Label tool ($\text{A}$) on Form Controls toolbar $\rightarrow$ drag on form $\rightarrow$ edit caption via
Properties: Label Field.
Toolbars
- Form Controls Toolbar: Used to add, modify, and manage controls on the form. Includes the Design Mode toggle button to switch between Design View and Form View.
- Records Toolbar: Located at the bottom; contains buttons for record navigation, adding a new record, saving, and deleting records.
3. Reports in LibreOffice Base
Overview
- Functionality: Generates formatted printable documents based on tables, queries, or both.
- Recommended Practice: For multi-table reports, create a query first and use that query as the data source for the report.
Steps in the Report Wizard (6 Steps)
- Field Selection: Choose the base table/query and select fields to include in the report.
- Labeling Fields: Change short database field names to clearer column header labels.
- Grouping: Group records based on specific field values (e.g., grouping events by
CategoryID). - Sort Options: Define primary and secondary field sorting in Ascending or Descending order.
- Choose Layout: Select data layout (e.g., Tabular), header/footer styles, and page orientation (Landscape or Portrait).
- Create Report: Specify the report title and choose the report type:
- Dynamic Report: Automatically updates output whenever underlying table/query data changes.
- Static Report: Preserves a fixed snapshot of data at the time of creation.
Modifying Reports (Report Builder Window)
- When editing a report, the Report Builder window and Add Field dialog box open.
- Inserting Report Titles: Select Label tool on Report Controls toolbar $\rightarrow$ drag text box in header $\rightarrow$ modify
Labelcaption and font properties. - Inserting Date & Time: Click on Page Header $\rightarrow$ select Insert $\rightarrow$ Date and Time… from the menu bar $\rightarrow$ choose format.
4. Summary Quick Reference
| Feature | Form | Report |
| Primary Use | Interactive data entry, editing, and viewing | Presenting and summarizing retrieved data |
| Data Flow | Two-way (Input & Output) | One-way (Output only) |
| Data Source | Base Table(s) | Tables, Queries, or both |
| Creation Methods | Wizard, Design View | Wizard, Report Builder |
| Dynamic Updates | Direct real-time database modifications | Can be Dynamic (auto-updating) or Static |
5. Check Your Progress — Answer Key
A. Multiple Choice Questions
- (b) Forms Controls Toolbar
- (a, c) First record, last record
- (b) It can contain only text fields (False statement)
- (c) Ctrl
- (b) Help Text
- (c) Report
- (b) Standard (long) (Requires DropDown set to Yes)
- (a) Design Mode
- (c) Both a and b
- (c) Both (a) and (b)
B. True or False
- False — Both forms and reports are database objects.
- True — Form layouts can be selected in step 5 of the wizard.
- False — Selected or all fields can be added to a form.
- True — Via Wizard or Design View.
- True — Opens in its own window.
- False — Controls can be repositioned and moved anytime.
- True — Records toolbar includes the New Record button.
- False — Reports can be generated from tables, queries, or both.
- False — Default sorting option is Ascending.
- True — Reports support grouping by specific fields.
- False — Reports can contain custom layouts, headers, titles, dates, and dynamic groupings.
- True — Date and time can be inserted into the header area.
- False — Reports can be edited in Report Builder view.
C. Fill in the Blanks
- Entering data, displaying data
- Label, field value text box
- Label
- 3D look
- Tool-tip (or Help text)
- Landscape
- Layout
- Insert
- 6
- Dynamic
D. Short Answer Questions
- Difference between Form and Report: A form is an interactive front-end interface used to input, modify, and view data, whereas a report is a formatted output object used to summarize and present retrieved data for viewing or printing.
- Field Control: A field control is a form visual element consisting of a label (specifying expected input) and a field value text box (linked to the database table field).
- Tool to insert text: The Label tool ($\text{A}$) on the Form Controls toolbar.
- Two ways to create a form: Using a Wizard, and using Design View.
- Static vs. Dynamic Report: A dynamic report updates automatically when base table/query data changes, whereas a static report keeps a fixed snapshot of data at the time of creation.
- Toolbar Functions:
- Forms Controls Toolbar: Contains tools for adding, editing, and managing form controls, and toggles design/form mode.
- Records Toolbar: Provides navigation control buttons to traverse records, add new records, save records, and delete records.
