Learning Reportbuilder: The End-User'S Guide To Building Reports
Learning Reportbuilder: The End-User'S Guide To Building Reports
ReportBuilder
CONTENTS
Welcome to Learning ReportBuilder, a series of manipulate the canvas. The canvas is the area that
tutorials developed to teach you how to create stun- contains the report layout. This is where we place
ning reports. The tutorials begin with the basics, the bands and components that will ultimately con-
such as how to use the Report Designer, and end trol the content of each page of the report.
with advanced reporting techniques like crosstab
PREVIEW
creation. This guide should therefore be helpful to
The preview tab plays an integral role in the report-
both the novice and the seasoned report-builder.
creation process because it allows you to see how
the report will look when printed. As you work
through the tutorials, you'll notice that this work-
space is frequently accessed so that we can see how
the report is shaping up. We will make many
changes and corrections based on what we see in
this workspace. The tools in this space allow you
to view each page of the report or zoom in to get a
better look at a specific page. You can also print
the report from the preview workspace.
DATA
The data workspace is often the key to successful
DESIGN
report creation because it allows us to select and
The Report Designer, pictured above, is the appli- manipulate the data needed for a given report.
cation you will use to build reports. It contains These tasks are accomplished via two visual tools:
three workspaces: Data, Design, and Preview. the Query Wizard and the Query Designer. These
When first displayed, the Report Designer defaults tools greatly simplify the often-difficult task of
to the design workspace because this is where you data selection by giving us the ability to select data
will spend the majority of your report-building without requiring an in-depth knowledge of data-
time. The design workspace is divided into two bases.
areas: the workbench and the canvas. The work-
bench is comprised of toolbars, component pal-
ettes, rulers, and other tools that can be used to
2 Introduction
Once the data is selected, we can begin laying out The Invoice tutorial illustrates how to export saved
the report. The primary purpose of a report is to data so that you can use it for a new report and pre-
transform raw data into information. Our task as sents the concept of groups.
report-builders is essentially to make data mean-
The Mailing Label tutorial introduces the Label
ingful. The following tutorials will show you how
Template tool, which allows you to create labels
to do just that.
with ease.
ABOUT THIS BOOK
The Fish Photo Album shows you how to create a
As you work through this guide, it is important to colorful report using the DBImage component and
keep in mind that the tutorials build on one introduces some concepts in relation to compo-
another, moving from basic concepts to complex nents and the way they work.
reports. Therefore, it may be difficult to complete
an advanced tutorial without having first com- The Sales Statistics tutorial teaches the difference
pleted earlier tutorials. Each tutorial produces between data and information and further develops
some kind of report and brings to light important the concept of groups.
aspects of ReportBuilder. The Form Letter tutorial shows you how to set up a
A Quick Test Spin gives you a glimpse of the letter for mass mailing.
Report Designer's report-building potential. The Fish Reference Booklet illustrates how to cre-
Calisthenics offers a series of exercises that pre- ate a report with side-by-side memos and intro-
pare you for the tutorials. You will be a nimble duces regions.
user when you complete the calisthenics. The Crosstab tutorial offers a report in the form of
The Summary Tutorial concentrates all that you a spreadsheet, which is useful when a large amount
learned in Calisthenics into a report. Like the tuto- of data needs to be analyzed.
rials that follow, it gives you an opportunity to use Appendix A describes the toolbars and their con-
all the tricks you learned in Calisthenics. tents in detail.
The Cover Page tutorial illustrates the ease with The glossary provides definitions for terms you'll
which you can design a cover page so that the encounter as you work through the tutorials.
report looks clean and professional.
QUERY WIZARD
The Query Wizard is a tool that allows you to
access information from your database to use in
your report.
8 Select DBText2.
10 Select DBText3.
3 Click the bold icon . All three label cap-
tions should turn bold.
6 A Quick Test Spin
2 Set the left to 0.1. 5 Select the Company DBText and set the top to
0.0.
3 Right-click over the Contact Name label and set
the left to 2.3. 6 Shift-click the other DBTexts so that they are all
selected.
4 Set the Phone No. label left to 3.8.
5 Set the Company label top to 0.3. 7 Click the Align Top icon on the Align or
6 Select the 'Company' label. Space toolbar.
7 Hold down the Shift key and click on the other Note: The DBText components may overlap.
2 labels. All three labels should now be selected. That's fine. The next task will correct the overlap.
9 Click the Align Top icon . The Contact 2 Click the Left Align icon . The DBText
Name and Phone No. labels should align with the component should be positioned directly beneath
Company label. the label and both components should be aligned
left.
FIXES
When you preview a report, you'll undoubtedly
find something that can be improved. Let's fix the
spacing.
tion divider up and down. 5 Close the Report Designer window by clicking
the button at the upper right corner of the win-
dow.
OVERVIEW
1 Click the New Report icon on the main
These exercises will get you oriented in the Report
toolbar. The Report Designer will appear with the
Designer environment and teach you to use some
design workspace active.
basic tools. It's a good idea to study this section
because each task is extremely detailed, whereas
the other exercises will assume that you are famil- 2 Click the Label icon.
iar with the basics and therefore be less explicit. 3 Click in the white space of the header band.
COMPONENT CREATION You've just created a label component.
The first thing you need to know in order to write a 4 Create two more labels in the header band.
report is the significance of the canvas. The canvas
is divided into sections called bands. A band is 5 Locate the shape icon on the toolbar.
labeled in the section divider immediately below it;
thus, the first band is called the 'header', the second 6 Click the icon.
is called the 'detail', and the third is called the 7 Click in the white space of the header band in
'footer'. When the report generates, the bands are order to create a shape.
printed on different parts of the page. There are
8 Press Ctrl + S to save your work. Name the
many different band types for different occasions,
report Cal1. Save at the end of each task.
but for now we'll just use the header, detail, and
footer bands. Note: You can use the process of clicking the
icon, then clicking in a band to create any type of
Let's create some components and put them in the
component.
bands. A component is an element used to control
how the report looks. Each component has a
unique purpose.
10 Calisthenics
1 Locate the ruler on the left side of the work- 1 Select the Label1 component by clicking on it.
space. The selected label should look like this:
5 Drag the mouse to the left until the rectangle 8 Release the handle. The toolbar is now a float-
pivots and appears as follows: ing window. The area at the top of the toolbar
(labeled 'Draw') is called the title bar. You can
move the window by placing your cursor over the
title bar and dragging.
6 Drag the cursor down and notice how the label 10 Move the shape up and down in the header
gets taller. band. Notice the guides on the vertical and hori-
zontal rulers. Whenever you are dragging or siz-
ing, the guides show you the position and size of
the selection.
Positioning
1 Deselect the components by clicking in the
white space of the header band.
3 Select the shape component in the header band.
2 Select the shape.
4 Hold down the Shift key and then click on the
3 Hold down the Ctrl key and press the up arrow
three labels. All four components should now be
several times to move the shape.
selected.
4 As you move the shape using this method, look
5 Click the Align Top icon of the Align or at the status bar in the lower right-hand corner of
the Report Designer. The Top measurement should
Space toolbar. The labels should align with the
shape. track with the component's location
16 Calisthenics
5 Use the right arrow key to move the shape to the 7 Set the color to aqua.
right. The Left measurement should track with the
component's location.
Task 1
Create and Color Shapes
4 Click the down arrow button to the right of the 1 Position the purple shape so that its corner over-
icon. The Fill Color palette will be displayed. laps the corner of the yellow shape.
5 Select yellow. 2 Position the purple shape so that its corner over-
laps the corner of the aqua shape. The three shapes
6 Select the second shape. should look like this:
Calisthenics
17
3 Select the Preview tab. Notice that the shapes 10 Restore the original order of the shapes by
retain their front-to-back ordering. deciding which shape needs to be sent to the back
or brought to the front. (Answer: Send the yellow
4 Return to the design workspace and right-click
shape to the back.)
over the purple shape.
Task 3
5 Select the Send to Back menu option. Notice
Use a Shape as a Background
how the purple shape is now behind the aqua
shape. 1 Right-click over the yellow shape.
1 Try to select all of the components in the header 5 Hold down the Shift key and click the yellow
band by clicking to the left of the first component, shape.
holding down the left mouse button, and dragging
Note: You can use the shift-click method to dese-
the mouse (i.e. the bounding box method).
lect any component that is part of a multi-selection.
Notice how the components cannot be selected.
6 Move the selected components. The compo-
This is because the yellow shape is selected and no
nents can be moved now because the yellow shape
bounding box can be drawn.
is deselected.
2 Hold down the Ctrl key and try to select the
7 Try to deselect the components by clicking on
components using the bounding-box method again.
Label1. Nothing happens. That's because you must
When the Ctrl key is held down, you will see a
select an unselected component or click in the
bounding box.
white space of a band in order to clear the current
selection.
ADVANCED SIZING
When you have a shape stretched using Parent-
3 Expand the bounding box to encompass all of Width and ParentHeight, you cannot change the
the components and release the mouse button. All size via the sizing handles. This exercise shows
of the components, including the yellow shape, you how to resize such a shape.
should be selected.
Calisthenics
19
1 Place your cursor over the sizing handle on the SPEED MENU
left side of the yellow shape. The left/right arrow The speed menu appears when you right-click over
will be displayed. a component. It offers different options for altering
the overall look of your component via changes in
shape, size, and visibility. Here is the speed menu
for a shape:
3 Select Position. . . . A dialog box like the one The layout should look like this:
below will be displayed; however, the numbers
layout check
may be slightly different from these. That's fine.
2 Select Position. . . .
1 Select the aqua shape. 11 Click the Align Top icon on the Align or
Space toolbar. All shapes should align with the top
2 Shift-click the other two shapes in order to add of the aqua shape because it was selected first.
them to the selection.
Task 4 Task 2
Save Your Work Create a Dataview Via the Query Wizard
1 Select File | Save from the main menu. 1 The Query Wizard will come up with a list of
Available Tables. Choose the Clients table by dou-
ble-clicking on it. The Clients table should now
appear in the list of Selected Tables.
DATA TREE
The Data Tree allows you to build a report based
on data you have selected from the database. In
order to use the Data Tree, you must first select
data by creating a dataview.
Task 1
Create a New Report
Task 4 5 Hold down the Ctrl key and click the 'Tele-
Create a Vertical Report phone' field. Your selection should look like this:
Task 5
Create a Tabular Report
6 A dialog box like this will appear: 10 Position your cursor over the 'Last Name' field
in the Data Tree and drag the selection into the
lower left corner of the header band.
Task 6
Create a Tabular Report with a Grid
• A list of company names 3 Select File | New in order to access the New
Items dialog.
• A contact for each company
4 Double-click on the Query Wizard icon. The
• A phone number for each contact Query Wizard will come up with a list of Available
Tables.
6 Click Finish.
1 If it is not already visible, launch the Data Tree 3 Place a shape component in the detail band.
toolbar. 4 Set the shape's fill color and line color to yel-
2 Dock it on the left side of the workspace. low.
3 Click the layout tab of the Data Tree. 5 Right-click over the shape and select Paren-
tHeight and ParentWidth.
4 Set the Style to Tabular.
6 Hold down the Ctrl key while you select the
5 Deselect the Grid boxes if they are checked.
'Custno', 'Company', 'Contact', and 'Phone' fields in
6 Click the font icon for Labels. the Data Tree.
1 Place your cursor over the 'Detail' divider. Your 3 Select all of the components in the detail band.
cursor will change to an up/down arrow , indi- 4 Shift-click the yellow shape to remove it from
cating that you can drag the control up and down. the selection.
Summary Tutorial
31
5 Drag the selection up so that the components Task 5
line up with the top of the detail band. The layout Align the Components and Adjust the Detail
should look like this: Band
Task 6
Lay Out the Footer Band
4 Launch the Size toolbar. 3 Select PrintDateTime from the drop-down list
box in the upper left corner of the workspace. The
5 Locate the Shrink Width to Smallest
date and time should appear in the component.
icon and click on it. The label's width should 4 Place another system variable component in the
shrink to match that of the DBText. lower right side of the footer band.
32 Summary Tutorial
5 Select PageNoDesc (Page Number Description) 5 Preview the report once again. It should look
from the drop-down list box. The page number this:
should appear in the component.
right-justify icon .
PREVIEW
1 Click on the Preview tab and look at your
report.
FIXES
1 Click the Design tab to return to the design
workspace.
Task 2
Create a Shape and a Label
Left 2.0
Top 2.5
Width 4.0
Height 1
34 Cover Page
3 Set the fill and line color of the shape to light Task 4
gray. Create and Adjust Labels
4 Place a label over the shape. 1 Create four labels and place them over the
shape.
5 Set the caption to Customer Report.
2 Set the caption for each label:
6 Set the font size to 28.
Label2 Customer Number
7 Set the justification to left . Label3 Company
Label4 Contact
8 Select the shape and then shift-click the label.
Label5 Phone Number
9 Launch the Align or Space toolbar.
3 Select the labels and set the font size to 22. The
title page should look like this:
10 Click the Align Center icon and the
Task 3
Create and Adjust a Shape
Left 2.0
Top 4.0
4 Select the Customer Report label and then shift-
Width 4.0
click the Customer Number label.
Height 3.3
2 Set the line color of the shape to dark gray. 5 Click the Align Middle icon of the Align
or Space toolbar.
Cover Page
35
6 Set the top of the Customer Number label to PREVIEW
4.75. 1 Click the Preview tab. The title page should
7 Set the top of the Phone Number label to 6.5. look like this:
DESIGN WORKSPACE 4 Click Next until you see the screen with the
Task 1 checkered racing flag. Select 'Modify the report's
Create a Layout Via the Report Wizard design'.
Company
Contact
6 Right-click over the New Report label in the
Orderno
header band and select Autosize from the speed
Amountpaid
menu.
1 Return to the design workspace. 3 Right-click over the Contact DBText compo-
nent and select ReprintOnSubsequent.
2 Right-click over the Company DBText compo-
nent in the detail band and select SuppressRepeat- 4 Click the Preview tab.
edValues from the speed menu.
5 Go to the second page. Notice that 'Blue Sports
3 Right-click over the Contact DBText compo- Club' is now at the top of the page, providing clari-
nent in the detail band and select SuppressRepeat- fication.
edValues.
Task 4
4 Click the Preview tab. The company and contact Create a Line Guide
names no longer repeat.
You may have noticed that the ReprintOnSubse-
5 Scroll down to the bottom of the preview page. quent option creates a lot of white space in this
Notice that the last company name is Blue Sports report, which makes it difficult to correlate com-
Club. pany names with their orders as you read from left
to right. We can add a line guide in order to
6 Click the Next Page icon . Notice that 'Blue improve this situation.
Sports Club' does not appear at the top of this page.
Because the company and contact names do not
repeat, the top of the next page has no company
name; it is therefore difficult to tell what company
placed these orders.
When you find yourself using the same dataviews 8 Preview the report. Notice how the company
over and over again, it is often useful to save them and contact names repeat. In the previous tutorial,
in a data module outside of the report so that you we learned how to handle repeated values via the
can use them (via the import feature) when creating SuppressRepeatedValues property. However, we
new reports. can handle these values another way.
Task 2 Task 3
Generate the Layout Via the Report Wizard Create a Group
1 Access the design workspace. 1 Return to the design workspace and select
Report | Groups from the main menu. A dialog box
2 Select File | New and double-click on the Report
will appear.
Wizard icon.
2 Choose Customer.Company from the drop-
3 Select the following fields:
down list box:
Company
Contact
Orderno
Amountpaid
Task 5
Move the Repeating Data into the Group
Header
3 Drag the selection into the group header band. 1 Return to the design workspace.
4 Right-click over the shape and select Send to 2 Select the Orderno DBText component in the
Back. The DBText components should now detail band. This initializes the font style and size
appear in front of the shape. for the DBCalc component we are about to create.
9 Click OK.
7 Click OK.
46 Invoice
8 Preview the report. The group for 'Blue Jack 2 Select Report | Groups. Click 'Start new page':
Aqua Center' now starts on page two. The 'Keep
group together' option allows the header, detail,
and footer of a group to print on the same page,
when possible.
Task 8
Begin Each Group on a New Page
3 Click OK.
5 Drag the line to the bottom of the header band. 2 Shift-click the corresponding DBText and
DBCalc components in the detail and group footer
bands.
Task 2
Adjust the Label Components in the Header
Band 3 Use the Align or Space toolbar to right-align the
selection.
1 Right-click over the Contact label and set the
top to 0.9. 4 Right-align the Order No. DBText component
in the detail band with the Order No. label in the
2 Align the tops of all the labels in the detail band
header band.
with the Contact label.
5 Set the top of both DBText components in the
3 Set the following left positions for the labels:
detail band to 0.05.
Company 0.0
Task 4
Contact 2.0
Modify the Label in the Title Band
Orderno 4.2
Amountpaid 5.3 1 Drag the label in the title band into the header
band.
4 Change the captions of the labels as follows:
2 Set the left and top of the label to 0.
Orderno Order No.
Amountpaid Amount Paid 3 Select Report | Title from the main menu. The
title band will be removed from the canvas.
5 Set each of the labels to AutoSize.
Invoice
49
4 Right-click over the label and select AutoSize. 4 Change the color of the line in the header band
The layout should look like this: to teal using the Line Color palette.
Task 5
Change the Color of the Navy Components
Joining Tables
In creating a master-detail report, we are taking Our first table is a list of customers, the second
advantage of a fundamental piece of database table is a list of orders placed by those customers.
technology: the join. In order to understand a join Given these two tables, let’s try to answer this
you first have to understand that the data of a question: On what dates did each customer place
database is stored in tables. Tables are simply a an order? We can answer this question using the
collection of data organized as rows and columns. following steps:
A typical table is shown below:
1. Get the name of the first customer from the
customer table.
2. Scan the orders table, looking for this
customer name.
3. When an order is found, add the customer
Notice the names at the top of each column. These
name to a list, and put the order date below it.
names are not part of the data, rather, they
4. Continue scanning the orders table, looking for
describe the data which appears below them. In
the next date this customer ordered.
the database world, each column is called a field
5. Repeat steps 3 and 4 until we have scanned
(the name at the top of column is the field name)
the entire orders table.
and each row is called a record. Let’s add another
6. Get the name of the next customer.
table to our example: 7. Repeat steps 2 through 5 until all customers
have been completed.
Order Summary
53
5 Check Start New Page. Task 4
Lay Out the Group Header Band
6 Click OK.
1 Place a DBText component in the group header
You have created a group which includes the fol-
band and select Company from the drop-down list
lowing bands: group header, detail, and group
box.
footer. This group will track the value of the com-
pany field and start a new page each time the value 2 Set the Company DBText component proper-
of that field changes. ties:
7 Select Report from the main menu and deselect AutoSize True
the header band. The header band will be removed Left 0.0
Top 0.0
from the layout.
Font Name Arial
8 Press Ctrl + S and save the report under the Font Size 16 pt.
Font Style Bold and Italic
name Order Summary.
In this process, we are relating customers to orders Foreign keys allow us to relate multiple rows of one
using the name field. At first glance, this process table to a single row of another. Such a relationship
seems simple enough, but it is only simple because has several valid descriptions, they are:
the data has been very carefully organized. one-to-many - where the customer is the ‘one’
and the orders are the ‘many.’ This description is
First, each customer only appears once in the cus- based on the fact that there are many orders for one
tomer table. That is, the value of the name field is customer.
always unique, never appearing in more than one parent-child - where the customer is the ‘par-
row of the table. Imagine how difficult it would be ent’ and the ‘order’ is the child.
to locate the orders for a customer if the same name
master-detail - where the customer is the ‘mas-
appeared twice; every order for that customer
ter’ and the order is the ‘detail’.
would correlate to two customers and we wouldn’t
know which was the correct one. When a column
contains a unique value for each row in a table it is Whenever we relate two tables in a database, we do
called a key. The concept of a key is fundamental to so by comparing the value in one field with the
databases because it allows us to relate one table to value in another. To understand the nature of the
another. relationship, we must know which table is the mas-
ter and which is the detail, we must know what is
The second big organizational detail that allows the key and what is the foreign key. Once we know
our process to succeed is that the customer name this, we can join the table, to create a third, more
appears in the order table. While it seems only natu- useful table. Here is the result table that we can cre-
ral that the customer name appear with the order, ate from customer and orders:
this special database technique is known as a
foreign key.Whenever the key field of one table is
placed in another table, it is a foreign key in that
table.
54 Order Summary
3 Place another DBText component in the group 6 Click the Preview tab.
header band and select CustNo from the drop-
down list box.
Left 0.0
Top 0.3
Font Name Arial
Font Size 16 pt.
Font Style Bold and Italic
Linking Dataviews
In the previous sidebar, we talked about joining. table (i.e. the dataview data.)
Joining tables is something you can do inside the
Instead, a link allows the dataviews to remain sepa-
Query Wizard and Query Designer. In fact, the
rate, and because each dataview creates a usable
Learning ReportBuilder application has been spe-
result table, this opens the door for a very powerful
cially configured to make joining tables very easy.
ReportBuilder feature: subreports.
When you select a table, all tables which cannot be
validly joined are disabled and cannot be selected; Before we take a look at how linked dataviews can
whereas valid tables are selectable. This capability be used with subreports, let’s get our minds around
is called AutoJoin, and it works based on informa- a simpler case: unlinked dataviews. For this case,
tion supplied by the developer that created the let’s imagine that we have created two dataviews,
reporting application (in this case, Digital Meta- one on the orders table and one on the items table.
phors.) Essentially AutoJoin requires that the valid No link exists between these dataviews. Next we
relationships between the tables be defined by the go to the design workspace and place a DBText
developer. Once defined, ReportBuilder will only component in the detail band. We assign the com-
allow joins between the tables specified. This ponent to the Order No. field. When we preview
makes it much easier to perform joins, because you the report we see that all of the Order Nos. are dis-
don’t have to know which tables relate to which played, but no item information is displayed.
other tables or on what fields those tables relate.
1 Click the design tab to return to the design 6 Right justify the system variable.
workspace.
7 Select both system variables.
Next we return to the design workspace and add a dragging the Order No. field from the Items data-
subreport to the detail band (below the Order No. view to the Order No. field in the Orders dataview.
DBText component.) We click the tab at the bottom This establishes a master-detail link between the
of the workspace to access the layout for the subre- dataviews with the Items dataview as the detail and
port. In the detail band we place a DBText compo- the Orders dataview as the master. When we pre-
nent, assign it to the Item No. field and set its color view, we get the correct items listed for each order:
to yellow. We then preview, noting the appearance
of the yellow item numbers. We notice that every
item in the entire item table is shown for each order.
This little
exercise should give you some insight into the dif-
ference between joins and links. Joins are estab-
lished between the tables inside a dataview, causing
When a sub- the tables to be combined into a single result table
report is placed within the detail band of a parent which the dataview then provides to the outside
report, we have an ideal way to traverse all of the world. Links are established between dataviews,
records of a one-to-many relationship. However, and allow related tables to remain independent of
unless there is a relationship defined between the one another, safely nested inside their own little
dataviews, the ‘many’ or child dataview will not dataview. This is a perfect setup for subreports,
return the correct records. In our imaginary case we each of which can be assigned to a separate data-
we can fix this by accessing the data workspace and view, allowing us to traverse multiple levels of data.
56 Order Summary
9 Click the Align Top icon to give both variables 5 Select Report from the main menu and deselect
the same top. the title and summary bands.
Task 3
layout check
list box.
4 Set the top to 0.5. 6 Change the caption of the ItemsTotal label to
5 Drag the detail band up to meet the bottom of ‘Amount Due’.
the subreport. 7 Set the properties of both labels:
6 Select the tab titled ‘SubReport1 : Orders’ at the Top 0.0
bottom of the data workspace. Font Color Navy Blue
4 Click OK.
Order Summary
57
10 Set the Amount Due label and the ItemsTotal 9 Set the height of the group footer band to 0.75.
DBText components properties:
Task 5
Left 2.0 Preview and Finish
Alignment Right Justify
1 Click the Preview tab.
11 Drag the group header band up to meet the bot-
2 As you preview, notice how the total amount
tom of the labels.
due is the sum of the orders for each company.
12 Drag the detail band up to meet the bottom of
the DBText components.
Task 4
Calculate the Total Amount Due
3 Right-click the DBCalc component and select 3 Close the Report Designer, saving the changes.
Calculations.
You have created an order summary with a master-
4 Select the Calc type Sum and click OK. detail relationship between dataviews with a subre-
5 Right align the Amount Due Label in the group port showing the detail data
header band and the DBCalc component in the
group footer band.
Autosize True
Alignment Right Justify
13 Click OK.
60 Detailed Order Summary
Task 2 4 Shift-click the Order label and align the top with
Change the Group the OrderNo DBText component.
1 Return to the Design tab. 5 Create a line component in the group header
band
2 Select the tab titled ‘SubReport1: Orders’ at the
bottom of the data workspace. 6 Set the line component properties:
5 Click OK.
Task 3
Layout of the Group Header and Footer Bands Task 5
Create a SubReport
1 Delete the Amount Due label in the group
header band. 1 Delete the OrderNo and ItemsTotal DBText
components in the detail band.
2 Create a DBText component in the group header
band and select OrderNo from the drop-down list. 2 In the detail band create a SubReport and select
Items from the drop-down list.
3 Set the DBText component properties:
Autosize True
Left 0.6
Top 0.2
Font Name Arial
Font Size 11
Font Style Bold and Italic
Detailed Order Summary
61
3 Set the properties of the SubReport: 6 Deselect the components and individually set
the label properties from left to right:
Left 0.5
Top 0 Caption Left Alignment
Width 6.3
ItemNo 0.2 Right
4 In the detail band create a line component. PartNo 0.95 Center
5 Set the line component properties: Description 1.75 Left
Qty 4.02 Center
Left 0 Price 4.7 Right
Top 0
Height 0.1667 Item Total 5.3 Right
Line Color Navy Blue
Line Thickness 2 ¼ pt. 7 Shift-click the following labels:
Line Position Left
Description
6 Drag the detail band up to meet the bottom of Price
the SubReport. Item Total
Left 0
Top 0.2396
Task 6 Width 6.25
Layout the Title Band Line Color Green
Line Thickness 1 ½ pt.
1 Select the ‘SubReport2: Items' tab at the bottom
of the screen. 11 Drag the title band up to meet the bottom of the
line component.
2 Create a label in the title band.
Top 0.0417
Font Name Times New Roman
Font Size 11
Font Style Bold and Italic
Font Color Green
7 Select the Design tab. 8 Select the Extended Total DBText component.
Task 8 9 Set the properties:
Layout the Detail Band
Autosize True
1 Create a DBText component in the detail band. Width 0.8125
2 Set the DBText properties: 10 Right-click the Extended Total DBText compo-
nent and select Display Format.
Top 0.0208
Font Name Arial 11 Choose the first format with a dollar sign.
Font Size 8
Font Style Bold
layout check
Left 0
Top 0
Height 0.2396
Width 6.25
Detailed Order Summary
63
3 Select the shape component and click the Fill
Color icon.
Red 202
Green 255
Blue 202
• A contact name
A B C D E
1 Click the Calcs tab. C Gets the value of the State field
2 Double-click the City field. It will move from D Places a space between the state and the zip
the Available Fields list to the Calculations list:
E Gets the value of the Zip field
5 Click OK.
Task 4
Configure the Report Layout
Task 3 1 Access the design workspace.
Sort the Data
2 Select File | New from the main menu.
1 Click the Sort tab.
3 Double-click on the Label Templates icon:
2 Double-click on Zip.
5160 – Address
68 Mailing Label
The Label Template dialog box should look like 4 Place four DBText components in the detail
this: band:
sheet.
72 Mailing Label
Column2 2.9375
Column3 5.6875
7 Click Finish.
Task 2
Lay Out the Detail Band
Left 0.45
Top 0
Width 2.7
Height 1.1
74 Fish Photo Album
6 Place a DBText component over the shape. 5 Right-click and select MaintainAspectRatio.
The image should be readjust so that it is no longer
7 Set the size and position:
distorted. While the image no longer fills the entire
Left 0.5 DBImage component, it looks better because the
Top 0.1 height and width of the original image have been
Width 2.6 scaled by the same amount. Aspect ratio is the ratio
of the height to the width. Maintaining the aspect
8 Assign the Common Name field to the DBText
ratio is simply scaling the height and the width by
component by selecting 'Common Name' from the
the same percentage.
drop-down list box at the upper left corner of the
Report Designer.
Task 3
Create a Graphic
Left 0.5
Top 0.5 Task 4
3 Assign the 'Graphic' field to the DBImage com- Use the Data Tree to Create Components
ponent. Notice that the image is cropped because it 1 Create another shape and place it below the red
is too big for the component. shape in the detail band.
4 Right-click and select Stretch. The entire image 2 Set the size and position:
of the fish should now be visible. This image is
Left 0.45
slightly distorted because it natively has a rectan-
Top 1.0
gular shape and the Stretch property is scaling it to
Width 2.7
fit into a square.
Height 0.8
Fish Photo Album
75
3 Launch the Data Tree. If it does not appear 11 Select the labels and DBText components. Hold
docked on the left side of the Report Designer, down the Ctrl key and use the arrow keys to move
dock it there. the selection up and down. Notice the Top value in
the status bar at the bottom right of the Report
4 Select the Layout tab at the bottom of the Data
Designer. This value is updated each time you
Tree and set the Style to Vertical.
move the selection. Use the arrow keys to move
5 Select the Data tab at the bottom of the Data the selection to 1.1042. The layout should look
Tree and Ctrl-click the following fields: like this:
Category
Length In
Species Name
Task 5
Generate a Framing Shape and Text
Left 3.17
7 While all of the components are still selected,
Top 0.01
change the font size to 8 pt.
Width 4.15
8 Autosize the labels (the components on the left). Height 1.8
9 Set the left of each label to 0.6. 3 Place a DBMemo component over the
shape.
10 Set the size and position of the DBText compo-
nents: 4 Set the size and position:
Color red As you preview, notice that the description for the
Size 12 pt 'Atlantic Spadefish' is not shown completely. Let's
Style bold fix this first.
7 Press Ctrl + S and save the report under the 1 Return to the design workspace.
name Fish Photo.
2 Right-click over the DBMemo and select
8 Preview the report. Stretch.
Handling Stretchables
The DBMemo is a special class of component called a stretchable. As the report prints, stretchable components
increase or decrease in height based on their content. This differs from static components, which always print
with the same height. When a band contains both static and stretchable components, it is difficult to get the
printed pages of a report to look exactly right because stretchable components print at a height that is different
from the one given in the report layout. The following properties can help you keep your reports looking good
when stretchables are used.
Example Strechable
The following figures break down the various components and their properties, showing you how a stretchable is
typically handled.
Layout Preview
A Shape and DBText components appear above C Shape behind memo with the StretchWithParent
the memo. ReprintOnOverFlow is set to True so property set to True. This will create the effect of a
that these will reprint if the memo overflows. border around the memo.
B Memo set to Stretch so that it will expand to D Shape and DBText components are set to
accommodate content. Anchor Bottom so that they maintain position rela-
tive to the bottom of the band (and thus print after
the memo).
78 Fish Photo Album
8 Return to the design workspace and right-click 6 Preview. Advance to page two. The California
over the shape. Moray entry is now printed completely on this
page. Page two of the final report should look like
9 Select ReprintOnOverflow. Preview and
this:
advance to page two. The shape now appears on
this page as well.
Task 2
Improve the Pagination
1 Return to the design workspace. Note: Here we created a group that breaks for
2 Select Report | Groups. every record in the report. The group has the Keep
Together option set to True, which means that if
3 Select Biolife.CommonName. the group header, detail, and group footer bands
4 Click the Add button. A group is created on the cannot fit on the current page, then the group will
Common Name field. Notice that the 'Keep group break to the next page. Thus, when the description
together' box is checked. in the detail band didn't fit on page one, the group
moved it to page two.
5 Click OK.
7 Close the Report Designer, saving the changes.
Sales Statistics
79
SALES STATISTICS
• How many orders has each customer placed? 3 Select File | New.
• How much product was moved with each order? 4 Double-click on the Query Designer icon.
• What were the total sales per order and per cus- 5 Select the Customer, Orders, Items, and Parts
tomer? tables.
We will answer these questions by selecting data at 6 Click the Fields tab.
the most detailed level, and then using the report to
7 Click the All Fields check box.
summarize the data. The report will contain the
following items:
1 Access the design workspace. 10 Preview the report. This report contains data in
its raw form. The data doesn't really answer the
2 Hide the Data Tree if it is visible.
proposed questions, but it does give us something
3 Select File | New. we can transform into answers. Notice the data in
the Total column. We can use this total to compute
4 Double-click the Report Wizard icon.
the total per order and per company.
Sales Statistics
81
MODIFY THE BASIC REPORT LAYOUT 7 Select a DBText component in the detail band.
Task 1 This establishes the font size and style for the
Calculate Totals for Each Company DBCalc we are about to create.
1 Return to the design workspace. 8 Place a DBCalc component in the group footer
band.
2 Select Report | Groups.
9 Assign it to the 'Total' field.
3 Click Add.
10 Right-align the DBCalc component with the
4 Assign the group to the CustNo field by expand-
Total DBText component in the detail band.
ing the drop-down list box and selecting 'CustNo'.
11 Set the top of the DBCalc component to 0.09.
5 Click OK. A group header and group footer
band will appear on the canvas. Notice the Task 2
descriptions on these bands. The number shows Calculate the Total Quantity Per Company
which group the band belongs to and the word 1 Place another DBCalc component in the group
'Custno' shows the field to which the group is footer band.
assigned.
2 Assign it to the 'Qty' field.
6 Extend the group footer band to the second tick
on the vertical ruler: 3 Right-align the DBCalc with the Qty DBText
component in the detail band.
9 Preview. The yellow shapes show where the 3 Click the Add button, then select Cus-
group footer is printing. The group footer band tomer.Orderno from the drop-down list box.
contains the grand total for both the quantity of
4 Click OK. New group header and group footer
items sold and the sales revenue. Now let's calcu-
bands are created for the Orderno group. The lay-
late the total for each order.
out should look like this:
Task 3
Calculate Totals for Each Order
layout check
1 Return to the design workspace.
Sorting Data
Notice that August and June appear twice, whereas
Groups allow the report document to be organized
a correct report would have only one section for
into sets of rows that share a common value. How-
August and June. This random sequence occurs
ever, groups can only function if the field to which
because the data is not sorted by month.
they are assigned has been used to sort the data. If
you associate a group with a field, but do not sort
the data by that field, then the group will still func-
tion. That is, the group will generate a group footer
and group header each time the field value changes,
but because the data is not sorted properly, the
group will appear to generate at random. Whenever
you see a group generating too many times, check
to make sure the data is sorted properly.
84 Sales Statistics
3 Set the shape's color to aqua. The layout should FIT AND FINISH
look like this: Task 1
Modify the Bands
Left 0.05
Top 0.06
Note: The shapes were used to help us quickly Width 7.95
identify where the group footer bands were print- Height 0.18
ing. Now that we have hidden the detail band, they 4 Send the shape to the back.
are no longer necessary.
5 Set the color of the shape to light gray. The
Task 2 layout should look like this:
Set the Format of the DBCalcs
Itemno
Description
Listprice
5 Change the text for these labels accordingly:
6 Autosize these three labels. The final layout 8 Close the Report Designer, saving the changes.
should look like this:
layout check
Form Letter
87
FORM LETTER
OVERVIEW Task 1
This tutorial illustrates how to create a form letter. Create a Brief Letter
The report will include these items: The first thing you'll need to do is compose a 2-3
• A letter for each customer in the data-base line letter in WordPad. We'll use this letter to illus-
trate the process of opening a document via the
• The name and return address of the
RichText component and changing it into a Form
recipient within each letter
Letter.
Earl Gray
1000 Pocahontas Drive
Burlington, KY 45001
BUILD THE REPORT 7 Right-click and select Edit. A new window will
Task 1 open:
Select Data
1 Return to ReportBuilder.
5 Click Finish
Task 2
Lay Out the Detail Band
1 Access the design workspace. 8 Select File | Open. Locate your letter and click
Open.
2 Select the Report menu option and remove the
header and footer bands. 9 Your letter should appear. Maximize the win-
dow.
3 Expand the detail band to one inch.
1 Double-click over the recipient's first name. 7 Close the window and click Yes when the save
prompt appears.
2 Select Edit | Insert Field. A dialog box will
appear with a list of fields: Task 4
Experiment with MailMerge
4 Open 'Form Letter.rtf' in the directory contain- 11 Press Ctrl + S and save the report under the
ing your ReportBuilder application. This is a mock name Form Letter.
form letter. We want to be able to send it to all the
12 Preview. The name and return address for the
people in the client table; therefore, we're going to
each person in the database appear, but the letter
need to replace the current name and return address
does not. In order for the letter to print, we must
with fields that contain data for each person.
change some settings on the Rich Text component.
5 Double-click the name Jane in the return
Task 6
address at the upper left corner of the screen.
Modify the Component
6 Insert the First Name field. The name Jane
1 Return to the design workspace.
should be replaced with the First Name field.
2 Right-click the component and select Stretch.
7 Repeat the process for the following fields:
3 Preview. A portion of the letter prints, but the
last name
text is truncated on the right due to the width of the
address
component.
city
state 4 Return to the design workspace.
zip
5 Select the component and widen it by dragging
8 Replace Jane and Plain in the first line of the let-
the right side to the 6.5 mark on the horizontal
ter with the first and last name fields.
ruler.
9 Replace Jane in line nine with the first name
6 Preview. The first letter is addressed to Jennifer
field.
Davis. Scroll down. Notice that the second letter
10 Close the window and save. The layout should (addressed to Arthur Jones) prints at the bottom of
look like this: this page. We want each letter to print on a sepa-
rate page.
Task 7
Create a Group
layout check
5 Click Finish.
Task 2
Create the Yellow DBMemo
Left 0.13
Top 0.06
Width 7.67
Height 0.92
6 Set the highlight color to yellow. 4 Left-align it with Yellow. Click in the header or
footer band in order to deselect the two compo-
7 Right-click over the component and select
nents. (It is much easier to clear the selection this
Stretch.
way since the background shape fills the entire
8 Launch the Report Tree by selecting View | detail band, providing no white space on which to
Toolbars. click.)
9 Right-click over DBMemo1 in the Report Tree 5 Set the highlight color to aqua.
and select Rename.
6 Use the Report Tree to set the name to Aqua.
10 Set the name of the DBMemo to Yellow and hit
7 Press Ctrl + S and save the report under the
the Enter key to save the change.
name Fish Reference.
Task 3
8 Preview. Notice that Aqua prints in front of
Create a Shape
Yellow.
1 Place a shape in the detail band. Set the posi-
Task 5
tion:
Shift Aqua relative to Yellow
Left 0.07
1 Return to the design workspace.
Top 0.03
Width 7.8 2 Right-click over Aqua and select ShiftRela-
Height 3.4 tiveTo. A dialog box will be displayed:
Task 4
Create the Aqua DBMemo 3 Select Yellow from the drop-down list.
1 Return to the design workspace. 4 Preview. Now Aqua prints after Yellow.
2 Place a new DBMemo below Yellow.
1 Return to the design workspace. 1 Right-click over Fuchsia and select Lines. The
Memo Editor will be displayed:
2 Locate the Memo icon on the Standard Compo-
nent Palette.
8 Select Yellow.
4 Click OK.
96 Fish Reference booklet
Notice that the text for Aqua and Fuchsia does not 6 Copy and paste the DBText component and drag
print entirely. it below Fuchsia. The layout should look like this:
layout check
7 Preview. Notice that the text for the memos is
so long that the DBText components print on the
6 Return to the design workspace. next page. These DBText components are
orphaned.
7 Select Stretch for Aqaua and Fuschia.
8 Return to the design workspace and set the
8 Preview. Now all of the text prints. Next, we
width of both memos to 3. Right-align Fuchsia
need to print additional information that relates to
with Yellow.
each memo.
9 Preview once again. Now the DBText compo-
Task 8
nents print on the same page. However, they both
Create DBText Components
print at the same position at the end of the band.
1 Return to the design workspace. We want each DBText to print immediately after
2 Place a DBText component below Aqua. the memo that precedes it. In order to achieve this,
we'll need to use regions.
3 Assign it to the Common Name field.
4 Select ShiftWithParent.
Fish Reference booklet
97
Task 9 5 Drag the DBText inside the region. Select the
Create a Region region and drag it up, then down. Notice how the
DBText component moves when the region moves.
1 Return to the design workspace.
This is because the DBText is contained within the
region.
2 Click the Region icon and then click
beneath Aqua. 6 Set the width of the region to 3 and left-align it
with Aqua.
3 Use the Line Color palette to select No Line.
Stretching Memo
When you are creating a report that must contain multiple memos in a single band, it may be necessary to use
some rather advanced techniques in order to keep the memo content and any related informational components
looking good in the resulting report. When a single memo is placed in a band and the Stretch property is set to
True, the memo will modify its height each time it is generated in order to accommodate its content. We call this
change in height stretching. When the components within a band stretch, the band stretches as well. Thus, it is
possible for us to print a memo with informational components below it by using the Anchors property of the
informational components to specify a Bottom anchor. When the memo prints, the band stretches and the infor-
mational components shift based on the amount of stretching. A picture of a report that contains a stretching
memo with shifting informational components is shown below:
Layout
Preview
98 Fish Reference booklet
Anchors work well when you have a single stretch- If we use a Bottom Anchor for each of the informa-
ing component in the band. But what if you have tional components, then the components will shift
two side-by-side stretching components and infor- based on whichever memo is longer, as this pre-
mational components need to follow each one? The view shows.
layout below shows two memos in a band. Each
memo needs to be followed by its own informa-
tional components.
Layout
Preview
Fish Reference booklet
99
6 Preview. The regions print in front of the 5 Preview. Now each region prints below the cor-
memos. Let's fix this. responding memo. Let's put more complete infor-
mation inside the regions.
Task 11
Modify the Regions FIT AND FINISH
2 Select Aqua from the drop-down list box. 1 Return to the design workspace and delete the
DBText components in the regions.
3 Right-click over the dark gray region and select
ShiftRelativeTo 2 Launch the Data Tree.
4 Select Fuchsia. .
Regions
In order to associate a set of informational compo- The ShiftRelativeTo property allows us to associate
nents with a single stretching component in a band, stretching components that should print as a logical
we will need to use a region. A region is a special unit. In this case we would assign the ShiftRela-
type of component that has the ability to contain tiveTo of the region on the left to the memo directly
other components. You place other components in above it, and the ShiftRelativeTo of the region on
a region by dragging them into it. The layout below the right to the memo directly above it. Now when
has been modified so that the informational compo- we preview the report, we will get this effect:
nents are contained in regions. Logically grouping
the components in regions is the first step to solving
this layout problem. The last step requires us to set
the ShiftRelativeTo property of each region.
Layout
Preview
It is important to know that when layouts contain multiple stretching components (such as memos), and other
related component are not printing in the correct positions, you can often remedy the situation by using regions to
logically group components, and then assign the ShiftRelativeTo property to associate regions with the appropri-
ate stretching component.
100 Fish Reference booklet
3 Click the Layout tab and set the alignment to 4 Use the sizing handles to narrow the DBText
Vertical. component until it fits inside the region:
Arial
Bold
10 pt.
5 Select the Category DBText and narrow it until
5 Set the Field properties: it fits inside the region.
6 Left-align the new label with Aqua. 1 Create a region below Yellow.
8 Click the label, then copy and paste it. Drag it 3 Select No Line.
above Fuchsia.
4 Use the sizing handles to resize the region so it's
9 Left-align the new label with Fuchsia. the same width as Yellow.
10 Set the text to Review. 5 Set the height of the region to 0.4.
Task 8
Preview and Finish
OVERVIEW Task 1
This tutorial shows how to create a report using the Select Data
Crosstab tool. In order to fully understand the con- 1 Create a new report.
cept of crosstabs, we need to create physical print-
outs and look at them in different ways; therefore, 2 Hide the Data Tree and the Report Tree if they
you'll need access to a printer, some scissors, tape, are visible.
and a stapler for this tutorial. By the end of this 3 Access the Query Designer.
tutorial we will have created the following prod-
ucts: 4 Select the Customer and Orders tables.
• A poster-style crosstab using 'down then across' 5 Click the Fields tab and select All Fields.
pagination 6 Scroll down to the Amount Paid field and select
• A poster-style crosstab using 'across then down' it, wait a second, then click again.
pagination 7 Change the name to Sale Amount.
• A document-style crosstab using the standard 8 Click the Calcs tab and double-click on the
style Company field.
• A document-style crosstab using the repeated 9 Maximize the Query Designer, then choose
captions style Expression from the Function drop-down list and
enter the following expression:
11 Click OK.
106 Crosstab
Crosstab
The spreadsheet was one of the first applications total sales for each month by state. Here is one way
that made the PC so successful. Spreadsheets you could present the data:
present calculations in a grid format - that is, with
State: AL
column headers, row labels, and calculations in the
cells. A typical spreadsheet is pictured below: Year: 1999
Total Sales: $2577
State: CA
Year: 2000
Total Sales: $3548
There are many different formats a spreadsheet may
take. The crosstab format is one of the most popu- This format is OK, but it makes a state-to- state
lar. Crosstab stands for cross tabulation, a process comparison difficult. Another format is as follows:
by which totals and other calculations are per-
formed based on common values found in a set of
data.
10 Click OK.
Crosstabs continued
in rows and columns. The values in the cells are the ReportBuilder has a built-in facility for creating
calculations created when the sales data is summa- crosstabs. The crosstab component is designed to
rized. handle the most common crosstab requirements
with minimal effort on your part. For example, let's
The simple crosstab we've outlined here can be
assume you wanted to create the crosstab we just
taken a step further. What if we wanted to know the
described. You would take the following steps:
sales by city (within state) as well as the total num-
ber of sales per city. We can present this informa- 1 Select the sale data from the database
tion by adding another dimension to the columns
(i.e. city) and another calculation to the values (i.e. 2 Create a crosstab component in the report
count of sales). The resulting crosstab would look layout.
like this:
3 Select the state, city, and month as dimen-
sions.
12 Preview. A blank page is displayed because no 5 Select Sum of Sale Amount and set the color to
values have been assigned to the crosstab. fuchsia.
1 Return to the design workspace, right-click over 7 Select the 1000 to the right of the grand total
the crosstab, and select Configure. and set the color to gray.
2 Drag the Sale Amount field over the new value 8 Close the Crosstab Designer.
cell. When the indicators appear, drop the field
9 Preview. The colors allow you to see where
into the diagram. The diagram should look like
each element prints. The values in red represent
this:
the sale amount per month. The value in gray is
the grand total for the year. The numbers in green
represent the months. The yellow and fuchsia sec-
tions show where the headings, or captions, print.
Now let's add some more values. Right now we
have the sum of sales. Next we'll add the average
and number of sales per month (count) to the
crosstab.
8 Select the second Sum of Sale Amount (the one 1 Drag the SaleMonth cell over the new column
below the average). cell and release.
2 Drag the State field over the new row cell and
10 Click OK. release. The diagram should look like this:
11 Preview. The crosstab includes new values.
Advance to the second page. The grand totals are
on this page. The report tells us the sum, average,
and count for the sale amount per month.
Task 2
Set the Format of the Values
7 Set it to PageSetDesc. 1 3
9 Select Ctrl + S to save the report. 7 Label this crosstab 'Down then Across'.
10 Preview. Notice that the page number prints on Task 2
each page. Control Pagination: Across then Down
UNDERSTANDING CROSSTAB LAYOUTS 1 Right-click over the crosstab component and
Task 1 select Pagination.
Control Pagination: Down then Across
2 Click on Across then Down.
1 From the Preview screen, print out all four
3 Preview.
pages of the crosstab.
4 Print all four pages of the crosstab.
2 Return to the design workspace and right click
over the crosstab. 5 Retrieve your printed pages and lay them out
like this:
3 Select Pagination. Notice that the pagination
defaults to Down then Across. This setting refers
to the order in which the pages print. 1 2
3 4
Crosstab
111
6 Cut off the 1/2 inch bottom margin of pages one 7 Flip through them. Notice that the captions for
and two. Cut off the 1/4 inch left margin of pages the state and the month appear on each page.
two and four.
8 Right-click over the crosstab and set the Style to
7 Tape the pages together, using the crosstab grid Standard.
to align them properly:
9 Preview and print.
OVERVIEW
This section describes the toolbars and their basic functions. For information on the usage of a particular tool-
bar, locate it in the index and then go through the tutorial that features the toolbar. You can view a list of all
toolbars in ReportBuilder by accessing the View | Toolbars option from the Report Designer main menu or by
right-clicking over the gray area of the workbench (i.e. the toolbars and component palettes).
114 Appendix A: Toolbars
This toolbar is useful when you want to move a component or selection of components with extreme precision.
Each icon represents the direction the selection will move. Selections will move one pixel each time you press
an arrow key.
A B C D
A Nudge up: Moves all selected components up C Nudge left: Moves all selected components one
one pixel. pixel to the left.
B Nudge down: Moves all selected components D Nudge Right: Moves all selected components
down one pixel. one pixel to the right.
Appendix A: Toolbars
115
THE SIZE TOOLBAR
You can use the size toolbar to set all of the components within a selection to a uniform height or width.
A B C D
A Shrink Width: Determines the minimum width C Shrink Height: Determines the minimum height
of all the selected components, and then sets the of all the selected components, and then sets the
width of the components to that value. height of the components to that value.
B Grow Width: Determines the maximum width D Grow Height: Determines the maximum height
of all the selected components, and then sets the of all the selected components, and then sets the
width of the components to that value. height of the components to that value.
116 Appendix A: Toolbars
This toolbar is used to set the color and style used by shape, line, and region components.
A B C D
A Fill Color: Sets the color for a shape or region. C Line Thickness: Determines the thickness of a
line. Applies to line components only.
B Line Color: Sets the color of the border for
shapes and regions. Sets the color for a line. D Line Style: Sets the style of a line.
Appendix A: Toolbars
117
THE ALIGN OR SPACE TOOLBAR
The Align or Space toolbar is useful when components need to be positioned uniformly. For example, it can
align several components so that the tops are all even or it can space components so that they have an equal
amount of space between them. The first component selected determines the position to which the others will
align.
A B C D E F G H I J
A Align Left Edges: Aligns a group of compo- F Align Bottom Edges: Aligns a group of compo-
nents with the leftmost position of the component nents with the bottommost position of the first-
that was first selected. selected component.
B Align Horizontal Centers: Centers a group of G Space Horizontally: Spaces a set of components
components based on the horizontal center of the based on the leftmost position of the first-selected
first-selected component. component and the rightmost position of the last-
selected component.
C Align Right Edges: Aligns a group of compo-
nents with the rightmost position of the first- H Space Vertically: Spaces a set of components
selected component. based on the topmost position of the first compo-
nent selected and the bottommost position of the
D Align Top Edges: Aligns a group of compo-
last component selected.
nents with the topmost position of the first-selected
component. I Center Horizontally in Band: Centers a compo-
nent horizontally within a band.
E Align Vertical Centers: Aligns a group of com-
ponents based on the vertical center of the first- J Center Vertically in Band: Centers a compo-
selected component. nent vertically within a band.
118 Appendix A: Toolbars
The icons on the Standard component palette represent components that are frequently used to build reports.
To create a component, click on an icon and then click in a band.
A B C D E F G H I J K
A Selection tool: Selects one or more components H Shape: Displays various shapes, such as
within the layout. Also clears any selection (by squares, rectangles, circles, and ellipses. Use the
clicking in the white space of a band). edit toolbar to set the shape type.
B Label: Displays text. Use the edit toolbar to set I Line: Displays a line. Use the edit toolbar to set
the caption of a label. the line orientation.
C Memo: Prints multiple lines of plain text in a J BarCode: Renders barcodes. Use the Edit tool-
report. bar to set the data to be encoded. Right-click and
access Configure to select bar code types.
D RichText: Prints formatted text.
K 2DBarCode: Renders 2D BarCodes. The string
E System Variable: Displays common report
value assigned to the Data property is encoded
information such as page number, page count, print
based on the BarCodetype. The following symbol-
date and time, and current date and time.
ogies are supported: PDF417, Maxicode.
F Variable: Performs calculations.
This palette offers several components that are identical to ones in the standard palette, except for one thing:
they are data-aware. Data-aware components have the ability to read the value of a field from a database table,
and then display that value in the report. This is different from the standard components, which display the
content assigned when you lay out a report. You associate a data-aware component with a given database table
and field by selecting the data pipeline and the data field from drop-down lists in the edit toolbar.
A B C D E F G
A DBText: Displays data from most types of data- D DBCalc: Performs simple database calculations
base fields. Cannot handle images or Richtext. (Sum, Min, Max, Average, Count).
B DBMemo: Prints plain text from a memo field E DBImage: Prints graphics (Bitmaps, GIFs,
of a database table. It will automatically word- JPEGs) that are stored in a database field.
wrap the text.
F DBBarCode: Converts the data from a database
C DBRichText: Prints formatted text from a field to a barcode symbol.
memo field. It will automatically word-wrap the
G DB2dBarCode: Converts the data from a data-
text.
base field to a barcode symbol.
120 Appendix A: Toolbars
The Advanced component palette contains components that can help you tackle complex reporting require-
ments.
A B C D
The Report Tree can be used to view the components within each band. Components selected in the Report
Tree become the selection in the report layout. You can select multiple components by holding down the Ctrl
key and clicking on each name. You can rename components by right-clicking over the name, selecting
Rename, and then typing in a new name. Make sure to hit the Enter key after renaming to ensure that the new
name is assigned. This tool window is dockable only on the left and right sides of the design workspace.
The Object Inspector appears in the bottom pane of the Report Tree tool window. Use the Object Inspector to
view and modify properties of the currently selected object. When multiple objects are selected, the Object
Inspector filters the property list to show the properties that are common to all selected objects. Modify the a
property value will update all selected objects.
122 Appendix A: Toolbars
The Data Tree can be used to create data-aware components within a band. Simply select a set of fields and
drag the selection into the band. A set of corresponding data-aware components will be created. This tool win-
dow is dockable only on the left and right sides of the design workspace
Appendix A: Toolbars
123
THE STANDARD TOOLBAR
The Standard toolbar allows you to perform basic functions such as opening, saving, and printing reports, as
well as cutting and pasting selections.
A B C D E F G H I
A New Report: Creates a blank report. F Print Preview: Displays the Print Preview win-
dow.
B Open Report: Displays the Open dialog, allow-
ing you to open an existing report. G Cut: Places the currently selected components
in the clipboard and removes them from the report
C Save Report: Saves a report to file.
layout.
D Page Setup: Displays the Page Setup dialog,
H Copy: Copies the currently selected compo-
allowing you to set the paper size and configure the
nents into the clipboard.
layout for the report.
I Paste: Pastes the components in the clipboard
E Print: Displays the Print dialog before sending
into the report layout.
the report to the printer.
124 Appendix A: Toolbars
Use the Format toolbar to set the font and colors of text-based components. You can also control the layering
of components with this toolbar.
A B C D E F G H I J K L M N O
A Font Name: Shows the name of the font chosen H Right Justify: Right justifies text.
for the selected component.
I Full Justify:
B Font Size: Shows the size of the font chosen for
J Font Color: Sets the text color.
the selected component.
K Highlight Color: Sets the background color.
C Bold: Sets text to bold.
L Anchors: Specifies how a report component is
D Italic: Sets text to italic.
anchored to its parent.
E Underline: Underlines text.
M Border: Specifies which of the outside border
F Left Justify: Left justifies text. lines of a report component are rendered.
The Edit toolbar is unique in that it changes based on the selected component. It is used with the following
components: data-aware components (1), labels (2), shapes (3), and lines (4).
band A section of canvas that describes how part Calcs page A page in the Query Wizard that
of the report will look. A band is labeled in the allows you to make a calculation based on the data
section divider immediately below it; thus, the first in the database.
band is called the 'header', the second is called the
'detail', and the third is called the 'footer'.
128 Glossary
calculation An option in the Query Wizard / CrossTab Wizard A tool in the design work-
Query Designer that allows you to derive new data space that generates a report based upon the
from existing database fields. choices you make in the wizard. Access this tool
by selecting File | New, then clicking the CrossTab
canvas The area in the design workspace that
Wizard icon.
contains the reports layouts. The canvas is divided
into rectangular areas called bands.
D
component An element used to control how the
report looks. Each component has a unique pur- data Specific facts (addresses, names, employee
pose. In order to place a component in the design numbers, hire dates) that are entered into a data-
workspace, click the icon on the component pal- base. Data can be accessed via queries. Data,
ette, then click on the white space of the band in which is not very meaningful in its raw form, can
which you want the component to appear. When a be transformed into useful information through a
component is selected, an edit or drop-down list report.
may appear in the upper left hand corner of the data-aware components Components to which
design workspace. This area provides different you can assign data fields. In the Report Designer,
options depending upon the selected component. these components are prefixed by DB, meaning
Configure A speed menu option for the Crosstab database.
component. It allows you to access the Crosstab Data Component Palette The palette from
Designer. which you create data-aware components. Click
CrossTab A component that presents summa- on the icon and click on the canvas to create a data-
rized data in a grid format. Crosstabs are designed aware component. See page 105 for a complete
by right-clicking over the component and access- description of this palette.
ing the Configure option. data module A behind-the-scenes container for
Crosstab Designer The dialog displayed when dataviews. When you want to copy data from one
the Configure option on the speed menu for the report to another, export the data module from the
crosstab component is selected. A crosstab layout first report and import the data module into the sec-
is created via this designer. ond.
expression Used when creating a calculation. It Group Header Band A band that contains the
allows you to create other fields based on the data header for a group. The components in a group
from existing fields. header band appear at the beginning of a group.
Position. . . dialog A speed menu option that Report Tree A toolbar that displays all of the
allows you to change the size and position of an components in a report. It is particularly helpful in
object. Right-click over a component to access the organizing components within bands. See page
Position... dialog. 107 for a complete description of the report tree.
Preview A workspace where you can preview Report Wizard A tool that allows you to create
the generated report to see how it will look when a report by answering a few simple questions.
printed.
ReprintOnOverFlow A speed menu option that
properties Settings for components such as font sets a component so that it will reprint. For exam-
style, size, and color. ple, a memo has an accompanying label. If the
label is set to ReprintOnOverFlow, it will reprint
Q on each page of the memo's text. Right-click over
a component to select ReprintOnOverFlow.
Query A request for data using a language spe-
cific to databases called SQL. The Query Designer Rich Text A component that allows you to print
and Query Wizard create SQL queries as we formatted text.
choose the data we want for a report. Rich Text Editor A dialog box accessible via
Query Wizard A tool that allows you to select the Rich Text component that allows you to replace
data for a report. text with database fields.
Query Designer A tool that allows you to make rulers The design workspace has two rulers: the
changes in the data selection. horizontal ruler and the vertical ruler. As you
move a component in the workspace, you'll see a
R guide that tells you the location of the component
on the rulers.
Region A special kind of component that can
contain other components. S
report Data in the form of information: a pol-
select To click on an object. See 'highlight' as a
ished product that contains useful data.
contrasting term.
Report Designer A report-building environ-
selection A group of selected components.
ment. It includes the design workspace, the data
workspace, and the preview workspace.
Glossary
133
selection handles When multiple components Size Toolbar A toolbar that allows you to set all
are selected, little gray boxes appear around the of the components in a selection to the same width
components. These selection handles indicate the or height. See page 101 for a complete description
objects that are selected. of this toolbar.
Selection tool A tool used to select one or more sizing The act of altering the size of a component
components within the layout. It can also be used via the sizing handles or the Position menu.
to clear any selection (by clicking in the white
Sizing handles The little black boxes that appear
space of a band).
when an object is selected. If you drag your cursor
Send to Back A speed menu option frequently over one of the sizing handles, the cursor will
used with shapes that allows components to be change to a double-sided arrow. You can then
moved to the background. If you want to use a resize the component by holding down the mouse
shape as a background, use the Send to Back func- button and dragging.
tion.
speed menu The menu that appears when you
shift-click A method of component selection right-click over a component. The menu options
where you hold down the Shift key and then click vary depending upon the component.
on components. You can also remove a component
SQL Structured Query Language. The language
from a selection using this method.
used to retrieve data from a database in an ordered
ShiftRelativeTo A speed menu option that form so that it can be used to create reports. See
allows you to associate components so that they page 104 for a complete description of this toolbar.
print one after the other. This option is especially
Standard Component Palette A toolbar that
useful when you want one component (a memo, for
includes the most frequently used components for
example) to appear below another.
report building. See page 104 for a complete
ShiftWithParent A speed menu option that description of this toolbar.
allows a static component to print after a stretch-
Standard Toolbar A toolbar that contains stan-
able component. Right-click over a component to
dard functions, such as saving, opening, and print-
select ShiftWithParent.
ing reports. See page 109 for a complete
description of the toolbar.
134 Glossary
Start new page An option in the groups dialog Style A speed menu option for the crosstab com-
that allows you to force a group onto a new page ponent that allows you to choose between
each time the group field changes value. Repeated Captions or Standard printing.
Static components Components that print just as Subreport A component that allows you to cre-
they appear in the layout. ate a report within a report in order to show more
levels of detail or to print several reports as one.
status bar The bar at the bottom of the design
workspace that tracks the movement of selected Summary Band A band that prints once at the
components. It's useful for component placement end of a report. The band is typically used to sum-
and alignment in that it allows you to position com- marize data. Select Report | Summary to create
ponents based on an exact measurement. It also this band.
displays the name of the selected component.
SuppressRepeatedValues A speed menu option
Stretch A speed menu option that applies only to that prevents repeated values from printing.
stretchable components. When set to true, the
System Variable A component that allows you
component will change size depending upon the
to display the page number, time, date, and other
amount of text it contains. Right-click over a com-
useful information.
ponent to select Stretch.
V
vertical A setting in the Data Tree layout tab that
configures the drag and drop behavior to create
labels down the page and data across the page. The
opposite of tabular.
W
workbench The area in the design workspace
that surrounds the canvas and contains tools used
to modify the report layout.
Index
137
INDEX
A SubReport 120
System Variable 31, 118
About 51 Variable 118
Advanced Component Palette configure
description of 120 usage of 106, 108
Align or Space Toolbar Cover Page 33
description of 117 Crosstab Component
usage of 15, 34, 44 about 106
Autosize usage of 106
usage of 38, 75, 86, 96
D
B
Data Component Palette
bands description of 119
detail 4 data module 41
footer 4 Data Pipelines
group footer 43, 81 description of 122
group header 43, 81 data traversal 82
header 4 Data Tree
title 33 about 22
bounding box 11 description of 122
C how to dock 23
calcs usage of 30, 75
usage of 66, 80 data workspace
components about 1
about properties 11 data-aware components 119
advanced selection of 18 database table 82
advanced sizing 18 DataView
aligning 15 about 4, 22
Barcode 118 usage of 41
basic selection of 10 DBCalc Component
creation 9 description of 119
Crosstab 105 usage of 44, 81
Data-Aware 119 DBImage Component
DBBarCode 119 description of 119
DBCalc 44, 119 usage of 74
DBImage 74, 119 DBMemo Component
DBMemo 75, 76, 119 about 76
DBRichText 119 description of 119
DBText 74, 119 usage of 76
exploring properties 21 DBText Component
Image 118 description of 119
Label 118 usage of 5
Line 116, 118 design workspace
Memo 118 about 4
orphaned 96 detail band
Region 97, 120 about 4
RichText 87, 118 display format
Shape 94, 118 usage of 85
sizing 13 Draw Toolbar
static 76 description of 116
stretchable 76 usage of 11, 16
Index
138
E M
Edit MailMerge
usage of 89 about 89
Edit Toolbar usage of 88
description of 125 MaintainAspectRatio
usage of 4, 44, 47 usage of 74
expression Memo Component
about 66 description of 118
usage of 66, 80 usage of 95
F Memo Editor
usage of 95
Fill Color Palette 16
N
floating window 12
Footer Band Nudge Toolbar
about 4 description of 114
form letter 87 O
Format Toolbar
description of 124 orphaned components 96
Front-to-Back Order Overflow
about 16 about 76
G P
group Pagination
about 82 usage of 110
usage of 42, 78, 101 Position
Group Footer Band about 20
usage of 43, 81 usage of 21, 101
Group Header Band Preview
usage of 43, 81, 84 how to 7
guides 10 preview workspace
about 1
H
properties
Header Band about 11
about 4 exploring 21
I Q
invoice 41 Query Designer
K usage of 65, 79
Query Wizard
Keep group together about 3
about 78 usage of 29, 37, 73
usage of 45, 78
R
L
Region Component
Label Component about 99
description of 118 usage of 97
usage of 4, 34 Report Tree
letter description of 121
See form letter usage of 94
Line Component Report Wizard
color 116 usage of 38, 42, 80
description of 118 ReprintOnOverflow
guide 39 about 76
style 116 Richtext Component
thickness 116 description of 118
usage of 95 usage of 88
RichText Editor
usage of 88
Index
139
S V
selection handles 10 Vertical Report 24
Shape Component Visible
description of 118 usage of 69, 84, 86
usage of 9, 33, 83, 94
shift-click 11
ShiftRelativeTo
about 99
usage of 94
Size Toolbar
description of 115
usage of 31
sizing handles 13
speed menu 19
Standard Component Palette
description of 118
usage of 40
Standard Toolbar
description of 123
Start new page
usage of 46, 101
static components
about 76
stretch
about 76
stretchable components
about 76
StretchWithParent
about 76
Style
usage of 111
SuppressRepeatedValues
usage of 39
System Variable Component
description of 118
usage of 31
T
Tabular Report 25
Title Band 33
title bar 12
title page
See cover page
toolbars
Advanced Component Palette 120
Align or Space 117
Data Component Palette 119
Data Tree 22, 23, 122
docking 11
Draw 11, 116
Edit 125
Format 124
Report Tree 121
Size 115
Standard 123
Standard Component Palette 118