Professional Documents
Culture Documents
Chapter 6
Forms and Reports
Jerry Post
Copyright © 2003
1
D Uses of Forms
A Collect Data
T Display Query Results
Display Analysis and Computations
A Switchboard for other Forms and Reports
S
E
2
D Human Factors Design
A User Control
Match user tasks.
Feedback
Methods
A Consistency Uses
Acceptance of input
Layout, Design & colors
B Actions
Clarity
Changes to data
Completion of tasks
Events / Activation
A Organization
Purpose
Forgiveness
Anticipation and correction
S Terminology
Aesthetics
of errors
Confirmation on delete and
3
D Windows Interface Standards
A The Windows Interface: An
Application Design Guide
Manipulation
Activation
T (Microsoft)
Navigation and Choices
Drag and Drop
Feedback
A Mouse, Icons
Keyboard, Short-cuts
Progress indicators and
status gauges
B Menus
Selections from a list
Flashing
Tool tips
4
D Windows Interface
A
Window components
T Frame (sizing)
Title bar
A Control-menu box
Buttons
B Minimize
Maximize
A Close
Scroll box (thumb)
S Scroll bar
E
5
D Windows Menus
A
Menus
T Drop-down
Short Cut Keys
A Mnemonic character
Pop-up (as needed)
B
A
S
E
6
D Message Box (A Simple Form)
A Message Boxes
T
Title
Message
A
Simple buttons
Icons
B Modal (required)
A
S
E
7
D Interface / Accessibility
A
Multiple Input Methods Some Suggestions:
T Keyboard Beware of Red/Green.
Mouse Avoid requiring rapid
A Voice user responses.
Avoid rapid flashing on
Multiple Output
B Visual
the screen.
Give users customization
A
Sound options.
Color Volume
S Color
Typefaces & Fonts
E
8
D Form Layout
A Types of Forms Form
T
Tabular
Single Row Order
A
Sub-forms (one-to-many)
Switchboard Items
B Controls
Form Properties
11
7
Dog
Dog
5
1
13 Cat 2
A Form Events
S
E
9
D Tabular Form
A Works best for single table.
T Designer can control data
entry sequence.
A Probably include buttons for
sorting.
B
A
S
E
10
D Single Row (Columnar) Form
A Data for only one row.
T Designer can set optimal
layout.
A Similar in appearance to
paper forms.
A
the form easier to use.
Note the importance of the
navigation buttons.
S Probably want a Find
command.
E Useful to include subforms.
11
D Sub-Forms
A Typically a one-to-many relationship.
Subform contents are linked to the main form through a common
A
B
A
S
E
12
D Switchboard Form
A Blank Form
T Graphics/Picture/Backgroun
d
A Identify User
Choose Task.
B
A
S
E
13
D Menu Design
A
Main Menu Customer Information
T 1. Setup Choices Daily Sales Reports
A 2.
3.
Data Input
Print Reports
Friday Sales Meeting
Monthly Customer Letters
B 4.
5.
DOS Utilities
Backups Exit
A
S
Hard to understand Organized by user tasks.
E
14
D Menus
A Consistency
With operating environment
Pop-up
Miniature form
T Within project
Pull-down
Tied to location/pointer
Right-mouse button
A
Name, Action
Shortcut keys
Attribute settings
Modal (keeps focus) or not
B
Access keys (&File, File)
Breaks/groups (-)
Dimmed option
A Check mark
Submenus ()
S Logical groupings
Tradeoff: length v depth
15
D Queries
A Queries are used to
T automatically look up data.
e.g., Customer name
B queries.
Each form should store data
in only one table.
A For multiple tables, use a
subform or separate forms.
S
E
17
D Form Query: Underlying Tables
A Customer Order
SaleID 1234 Date 7/25/01
T CustomerID 17
Carly Embry
A
B
Data
Data
entry
display
A SaleID
1232 23
Sale
CustomerID Sdate
7/24/01
CustomerID
15
Customer
First Last
Connie Fisher
Query
S 1233
1234
74
17
7/24/01
7/25/01
Join
16
17
Rosie Wade
Carly Embry
E
18
D Form Properties (Some)
A Data Format
T Base Table / Query
Filters
Caption
Scroll Bars
A Sort
Integrity
Record Selectors
Navigation Buttons
B Edits
Additions, Deletions
Size and Centering
Background/Pictures
A
Locks Colors
Other Tab Order
Pop-up menus
S Menu Bar
Help
E
19
D Controls on Forms (Basic)
A Label Text box
Drop down list
or combo box
List box
A Country
Shoes
Electronics
B
Payment Method Options
Credit Card x Gift wrap Sales
Check x Gift card
A Cash Monogram
E
20
D Pictures
A Background pictures Employee
T
Unbound, unchanging.
Stored with the form.
Name: Che Zhang
ID: 3354
A
Keep edit screen readable.
Sizing (zoom, scale, clip).
Phone: 222-111-1524
A
Define column as object.
Tie to scanner or graphics
package through OLE.
S Beware of data size
Resolution
E Number of colors
User machine capabilities.
21
D Basic Controls
Option Group
A Label
Text Box (single response)
T
A Command
B Button
A
S
E Combo Box
(click arrow to open)
List Box
(always open)
22
D Combo & List Boxes
A User selects from a list
Combo box can enter new
Example when you want to
use data entry:
23
D Combo Box
A ControlSource sets the
Name
ControlSource
Properties
CustomerID
CustomerID
T column to receive the choice
(in the Sale table)
Format
DecimalPlaces Auto
InputMask
A RowSource generates the
list of data to display.
RowSource/Type Table/Query
RowSource SELECT . . .
S Customer.LastName,
Customer.FirstName,
Customer.Phone FROM Customer
E ORDER BY Customer.LastName;
24
D Combo Box Sources
A Microsoft Access supports
three methods:
Useful feature of list combo
box.
Fixed list. The Row Source property is
T Query from a table.
Defined function.
a text string.
This string can be
25
D Controls on Forms (Complex)
A Common
Calendar
T
Tab
Grid Tab
A
Calendar
Gauge Grid
B
Slider
Spin Box
A Additional
Purchase
Create your own (C++)
S Gauge Slider Spin box
E
26
D Charts
A Build a query that generates
Sale 1
Animal Merchandise
A Individual series
Aggregate data
Sale 3 Animal
Merchandise
Labels
B Columns to link to form.
Summary chart--unlinked.
A Insert chart.
Set chart type.
Total Sales
S
Set up data and labels.
Set chart properties.
Animals
Merchandise
E Verify size.
27
D Multiple Forms
A Sale
T Customer Edit
FirstName: Mary Customer
A
LastName: Jones
Address: 123 Oaxaca Ave. FirstName: Mary
LastName: Jones
S Gender: Female
Age: 20
E AccountBalance: $150
28
D Multiple Forms
A Using data on other forms
Animal
Subtotal
E Tax
OrderTotal
=Subtotal*[TaxRate]
=Subtotal+Tax
29
D Integrity
A Avoid relying on forms
Set integrity conditions in
Controls
Security rights
T table definitions
Be sure to set referential
Data formats
Data entry
integrity (relationships)
A
Round-off
Use forms to make it easy to Selectivity
enter quality data Visible
B
Combo/list boxes
Menus
Enabled & Locked
Example: no production
A
Pop-up forms
Ties to related forms
change after item is sold.
User assistance
Tool tips
S
Data transfer across forms
Computations
Status bar
Menu
E Error checking & trapping
Help--context sensitive
30
D Large Projects Switchboard
Design Standards
A Templates
Colors, layout
form
Customer Order
T
Assembly
Titles
Actions, common buttons
Order
A
Naming convention is crucial Assembly
Forms form form
Controls
B Event procedures
Variables
A Team Coordination
Menu design
Order form
Item# item not
Backorder
Notice
available
S
Within a form/standards & Form
Across an application
Customer#
Event / action diagrams
E State diagram
Scenario diagram/messages
large
customer
Customer
Discount
31
D Objects
A Scenario diagrams Messages are usually
initiated by calling exposed
Objects
T
Properties
Events
functions in an object
Data can be passed directly,
B Message: compute
discount using
Customer ID
Market
A & Order size
Pricing
Object
S Customer
E Order object
Message: discount pct
32
D International Attributes
A Language
Character sets and punctuation
T marks
Sorting
A Data formats
Date
B
Time
Metric v English
A
Currency symbol and format
Separators (decimal, . . .)
Phone numbers
S Separators
International code prefix
E Postal codes
National ID Numbers
33
D Direct Manipulation of Objects
A Kennel/
Orders
Current Choices
Customer
T Bird
Cat
A
Tabby
Dog
Fish
B Mammal
Reptile
A Spider
Brown Lab
S A graphical approach.
Minimize data entry.
E Drag and drop objects (blue arrows).
34
D Creating a Graphical Approach
Get the hardware.
A Images: Scanners
Sound: Microphone and Sound card
T
Video: Camera and capture card
Lots of disk space.
A High speed processors.
Add an object column to your table definition.
B Design the screens.
Be creative.
A
Get user input.
Make the user’s job easier.
S
Avoid using graphics just for show.
Double-click
E
Drag-and-drop
Programming!
35
D Oracle Forms
A
Use List of Values (LOV) instead of select boxes.
T
A
B
A
S
E
36
D Oracle Forms Designer
A
T
A
B
A
S
E
37
D Oracle Forms: Sales
A Oracle provides
minimal support for
T updateable queries,
so several items are
S sections.
E
39
D Oracle Forms Design Hints
A Displaying non-updateable data from other tables is tricky.
T In Master/Sale set:
DML Data Target Type = Table
A
Query Data Source Name (parentheses are critical!)
40
D Oracle Forms Hints
A Add non-updateable columns by hand. Use aliases in the query to
ensure all column names are unique. Then set properties:
S
E
41
D Report Design
A Report usage/user needs. Security controls
Distribution list
Report layout choices.
T Tabular
Columns/Subgroups
Unique numbering
Concealed/non-printed
A
Charts/graphs
Paper sizes.
data
Secured printers
B
Transmission limits
Printer constraints. Print queue controls
How often is it generated? Output concerns
A
Events that trigger report?
How large is the report?
Typefaces
Readability
S
Number of copies?
Colors?
Size
User disabilities
E OCR needs
42
D Terminology
A Page Layout
Landscape v. portrait
Facing pages (portrait)
T Margins
Gutter (binding space)
A Typefaces
Serif (Times New Roman)
B Sans-serif (Arial) gutter
margins
Ornamental
A Fixed width
Landscape
S Font size
common: 10 - 12 point
E
72 points approx. 1 inch Alignment marks for
color separations.
pica (1/6 inch) (12 points)
43
D Report Types: Tabular
A
T
A
B
A
S
E
44
D Report Types: Labels
A
T
A
B
A
S
E
45
D Report Types
A Column.
T Column with groups.
A
B
A
S
E
46
D Report Layout
A Report Header
T Page Header
Group Header1
A Group Header2
...
Detail
B ...
Group Footer2
A
Group Footer1
Page Footer
Report Footer
S
E
47
D Report Layout/Common Use
A Report Header Group Footer
T Title pages that are printed
one time for entire report.
Subtotals for the group.
Page Footer
A Page Header
Title lines or page notes that
Printed at the bottom of
every page--page totals or
are printed at the top of
B
page numbers and notes.
every page.
Report Footer
Group Header Printed one time at the end
A Data for a group (e.g.,
Order) and headings for the
of the report. Summary
notes, overall totals and
S
detail section. graphs for entire data set.
Detail
Innermost data.
E
48
D Report Layout/Groups
A Often use groups/breaks for Customer(C#, Name, …)
one-to-many relationships. Order(O#, C#, Odate, …)
T Use a query to join all OrderItem(O#, Item#, Qty, …)
necessary tables.
A Can include all columns.
Use query to create
Report of Orders
Group1: Customer
49
D Report Computations
A
Query
T Same row computations.
Extended=Price*Quantity
A Report
B
Group subtotals.
Page and report totals.
A
Mixed, e.g., commission = rate * total
Scope depends on location
S
Group footer: subtotal
Page footer: page total
Report footer: report total
E
50
D Report Graphs
A Graphs
Separate query.
T Detail
Locate in detail or group footer section.
B report.
Subtotals and totals
Typically located in report footer or header.
A Compare group totals
Relies on Group By and aggregation.
S Be sure query groups match report groups.
E
51
D Report Graph for Group
A
T
A
B
A
S
E
52
D Oracle Report Writer: Preview
A
T
A
B
A
S
E
53
D Oracle Report Writer: Design
A
T
A
B
A
S
E
54
D Oracle Reports: Data View
A The data view can be used to
T
Menu
Toolbar
File Edit Help Report File Edit Help
A
File Edit Help
Help
Sales
Transactions
B
Report
Switchboard
Switchboard
Improving forms
Customized reports
A Distributing Applications
S
E
56
D Application Design
A Customer Form Customer Order
T Order Form
Bad design:
1592
Jane Doe
333 Elm St.
Customer:
1592 Jane Doe
333 Elm St.
A Better design:
Automatically transfer data
across forms.
S
E
57
D Application Importance
A User interface Decision Support
Make users’ jobs easier. Monitoring of events.
T
Tie input forms and reports.
Automate basic tasks
Analysis, Graphs, Reports.
Statistical analysis and
A Tie to external data collection
devices.
optimization.
Forecasts and simulation.
B Help system.
Ensure data integrity
Linking to other software.
Expert Systems &
A
Validate data. Intelligence
Perform computations. Logic and forward chaining.
Verify totals. Analysis and decisions in
S
Control user access.
Maintain related transactions.
code.
Databases of cases,
58
D Application Organization
A Organized by user needs.
Identify user.
Build forms and reports.
Start with a core concept.
T Outline tasks.
Organize forms and reports.
Identify most important
features. Get them correct.
E
59
D Application Structure
A Forms and Reports Front end
Visual Basic
T Internet
Oracle Forms
A
B Middle Tier
If x > 10,000 Then (Optional)
A Database
Oracle
Else
End If Business logic
Rules
S SQL Server
DB2
E Access
Back end
60
D User Orientation
A Database application is a model
of the organization.
T Applications based on user jobs.
Flexibility and user control.
A Application organization
User tasks.
S Reports
Easy access from forms.
User selection of scope and
E conditions or filters.
61
D Initial Menu / Switchboard
A Starting point for users.
T Identify the user.
From network if possible.
E
62
D Switchboard Uses
A Acts as a directory for the application.
T Identifies users.
Contains startup and shutdown code.
A Can preload forms in background.
Make them invisible.
A
Can establish network connections.
Contains copyright and usage notes.
S
E
63
D Sally’s Pet Store: Poor Organization
A Order Receive Sell
Merchandise Merchandise Merchandise
T Item Item Item
A What is wrong?
Get
B Focus needs to be at higher level
(Order, Receipt, Sale); not Item.A
Customer
Data
S
You cannot go from Receipt to Sale.
You need to get customer data before
64
D Sally’s Pet Store: Better Organization
A Supplier
T Customer
A
Orders Receipt
B specia
A orders
l
Sale
S Inventory
Items More links--usually as buttons.
65
D Sally’s Pet Store: Initial VTOC
A Sales Sale Animal
Sale Merchandise
T
Animals
A Animal Genealogy
Customer Receipts
B
Suppliers
Supplier Payments
Purchase Animals
A Purchase Merchandise
Inventory
Sales Report
S Accounting
Cash Flow
Marketing
E
Accounts Payable
Employees Accounts Receivable
66
D Menus
A Why a custom menu?
Limit user actions.
File Help
Contents
T
Simplify user interface.
Add custom actions. Search
About Rolling Thunder
A
Menus can be activated by
keystrokes.
Accessibility
B Touch-typists and
heads-down data entry. File Edit Help
E
67
D Creating Menus
A
View | Toolbars | Customize
T Drag and Drop
Multilevel menu.
A Sublevels/hierarchy.
Each level is a separate menu with its
B own name.
Menu choices
E Submenu.
Run any code.
68
D Toolbars
A Why toolbars?
Print
S Icon/graphic (bitmap)
Tool Tip
Export data to spreadsheet
69
D Menus and Toolbars
A
T
A
B
A
S
E
70
D Creating Toolbars
A View | Toolbars | New
Customizing
T Add new button.
Select from DBMS list.
A Bring up query/form/report.
Run code.
B Change icon.
Modify existing icon.
A Replace icon.
Create your own icon and paste it on the button.
S Place text label on button.
Tool tips are vital.
E Status bar for description.
71
D Icons
A 16 by 16 pixels
T 16 colors
Bright and shaded
B
A
S
E
72
D Help
A On-line help replaces manuals Sally’s Pet Store--Contents
T Context sensitive:
Pressing F1 key provides
Copyright Notice
The Firm
Introduction
A information on topic with
current focus
Processes
Entering Data
Hypertext links to related topics Sales
B Sequential topics
Descriptions
Animal Health
A Examples
Definitions / Glossary
Breeds (and other terms)
S Contents / overview
Index / keywords
E Full-text search
Windows 95 & Win-NT
74
D HTML Help
A Get the Microsoft HTML Help Workshop:
T http://msdn.microsoft.com/library/tools/htmlhelp/
Create each of the following
75
D HTML Help Workshop
A
T
A
B
A
S
E
76
D HTML Project Hints
A
Project Options
T Project Title
Default file (first page)
A Can create new files with File - New
B
Be sure to Add/Remove Topic files to project list
Edit – Compiler Information to add keywords to HTML file
77
D Context-Sensitive Help
A
Set the help file name in the form properties.
T
A
B
A
S
E
Set the topic number (Context Id) for each form or control. 78
D Context Sensitive HTML Help
A Create a Topic file for pop- Create a header file to link
T up topics the topic names to numbers
Use HTML API to set the
S …
E
79
D Appendix: Oracle PL/SQL: Data Types
A CHAR
Primary Data Types
T NUMBER(precision, scale) Fixed length string
VARCHAR2
precision: Number of digits
A scale: Round-off point
NUMBER(7,4): 123.4567
Variable length string
LONG, LONG RAW
B INTEGER
Default: NUMBER(4)
Binary data
DATE
A BOOLEAN
Yes/No
S
E
80
D Appendix: Oracle PL/SQL Structure
A CREATE OR REPLACE PACKAGE myPackage AS
PROCEDURE myProcedure(oldProjectID IN NUMBER);
END myPackage;
T CREATE OR REPLACE PACKAGE BODY myPackage AS
DECLARE
A myGlobalVar NUMBER;
E END myProcedure;
End myPackage;
81
D Appendix: PL/SQL Operators
A
T
A
B
A
S
E
82
D Appendix: PL/SQL IF-THEN-ELSE-ELSEIF
A
DECLARE
T X NUMBER(10,2);
BEGIN
A -- retrieve the balance
IF (BALANCE > 0) THEN
Use ELSEIF for case statements.
B
X = BALANCE*1.10; IF (ACCOUNT = ‘P’) THEN
ELSE -- do personal accounts
X = 0.0; ELSEIF (ACCOUNT = ‘C’) THEN
A END IF;
END;
-- do corporate accounts
ELSEIF (ACCOUNT = ‘S’) THEN
-- handle error
E END IF;
83
D Appendix: PL/SQL Loops
A (Start statement)
T LOOP
WHILE (condition) LOOP
A …
EXIT; …
S END LOOP;
E
84
D Appendix: Procedures or Subroutines
A
PROCEDURE DropOldAccounts (CutDate DATE) IS
T -- local variables are defined here
BEGIN
A -- First copy the data to a backup table
INSERT INTO OldAccounts
B
SELECT * FROM Account WHERE AccountID NOT IN
(SELECT AccountID FROM Order WHERE
Odate > CutDate);
A -- Copy additional tables…
-- Delete from Account automatically cascades to
S others
DELETE FROM Account WHERE AccountID NOT IN
(SELECT AccountID FROM Order WHERE
E Odate > CutDate);
END DropOldAccounts;
85
D Appendix: SQL Cursors
A DECLARE
CURSOR c1 IS
E
86
D Appendix: Error Handling
A PROCEDURE myProc ( ) IS
DECLARE
T -- declare all local variables
BEGIN
S
E
87