Crystal Reports 2016
Level 1
Student Guide
COPYRIGHT © 2017 Pathfinder Learning, LLP. All rights reserved. [email protected] www.pathfinderlearning.com
End User License Agreement: This book or any portion thereof may not be reproduced or used in any manner whatsoever without prior
express written permission of the publisher. All brand names, product names, trademarks, and registered trademarks are the property of their
respective owners.
ISBN: 0-9908404-5-X
Copyright ©2017 Pathfinder Learning, LLP
Table of Contents 3
Table of Contents
Lesson 1: Exploring Crystal Reports 2016 10
Crystal Reports 2016 Interface ................................................................................................... 11
Report Development ............................................................................................................. 11
Touring Crystal Reports ........................................................................................................ 11
Toolbar Overview....................................................................................................................... 14
Standard Toolbar ................................................................................................................... 14
Formatting Toolbar ............................................................................................................... 14
Insert Toolbar ........................................................................................................................ 14
Experts Toolbar ..................................................................................................................... 14
Navigation Toolbar ............................................................................................................... 15
Program Customization .............................................................................................................. 16
Viewing a Sample Report........................................................................................................... 18
Report Layout............................................................................................................................. 20
Navigation Tabs .................................................................................................................... 20
Conditionally Formatted Fields............................................................................................. 20
Grouping................................................................................................................................ 20
Subtotals ................................................................................................................................ 21
Design Tab ............................................................................................................................ 21
Preview Tab........................................................................................................................... 22
Close the report ..................................................................................................................... 22
Lesson 2: Creating and Modifying Reports 23
Creating a Report........................................................................................................................ 24
Reports .................................................................................................................................. 24
Data Sources.......................................................................................................................... 24
Creating a Report .................................................................................................................. 24
The Database Expert Tool..................................................................................................... 26
Exploring the Design tab ............................................................................................................ 30
Report Sections ..................................................................................................................... 30
Adding Fields to a Report........................................................................................................... 31
Adjusting Field Position and Size .............................................................................................. 35
Resizing Fields ...................................................................................................................... 35
Moving Fields ....................................................................................................................... 35
Previewing Field Data ................................................................................................................ 39
Aligning Field Data .................................................................................................................... 42
Selecting Fields ..................................................................................................................... 42
Aligning Fields...................................................................................................................... 43
Creating a Text Object................................................................................................................ 46
Saving the Report ....................................................................................................................... 48
Saving the Data with the Report............................................................................................ 49
Previewing Report Data ............................................................................................................. 50
Preview Data Methods .......................................................................................................... 50
Navigating the Previewed Data............................................................................................. 50
Locally Stored Data............................................................................................................... 52
Copyright ©2017 Pathfinder Learning, LLP
4 Table of Contents 56
Lesson 3: Formatting Number-based Fields
Formatting Introduction ..............................................................................................................57
Accessing the Formatting Options for a Field.............................................................................58
Formatting Numbers....................................................................................................................59
Formatting Currency ...................................................................................................................61
Formatting Date and Time ..........................................................................................................63
Lesson 4: Grouping, Sorting and Filtering 70
The Importance of Grouping Records.........................................................................................71
The Group Expert...................................................................................................................71
Sorting Records with the Record Sort Expert .............................................................................81
Filtering Records with the Select Expert.....................................................................................86
The Stages of Filtering ...........................................................................................................86
Select Expert Filter Methods..................................................................................................87
Implementing Record Filters with the Select Expert .............................................................88
Filtering Records with Multiple Criteria................................................................................95
Modifying Existing Filter Criteria .........................................................................................95
Deleting Filter Criteria ...........................................................................................................95
Changing Multiple Filter Criteria Logic ................................................................................95
Creating Group Summary Calculations......................................................................................100
Summary Functions ..............................................................................................................101
Grand Totals..........................................................................................................................101
Group Totals .........................................................................................................................102
Calculating Percentages in Summaries ......................................................................................112
Sorting Groups According to Subtotal Rankings .......................................................................115
Lesson 5: Additional Formatting Objects 129
Adding Lines ..............................................................................................................................131
Accessing the Formatting Options for a Line .......................................................................131
Adding Vertical Lines to a Report ........................................................................................133
Adding Boxes.............................................................................................................................136
Accessing the Formatting Options for a Box ........................................................................136
Inserting Graphics ......................................................................................................................142
Formatting Page Options............................................................................................................146
Printer Options ......................................................................................................................146
Page Options .........................................................................................................................146
Margins .................................................................................................................................146
Combining Fields with Text Objects..........................................................................................148
Inserting Special Fields ..............................................................................................................152
Special Fields ........................................................................................................................152
Document Properties.............................................................................................................153
Lesson 6: Working with Formulas 163
Creating a Formula.....................................................................................................................164
Crystal Formula Syntax.........................................................................................................164
Formula components and syntax...........................................................................................165
The Formula Workshop..............................................................................................................167
Copyright ©2017 Pathfinder Learning, LLP
Table of Contents 5
Layout of the Formula Workshop ........................................................................................ 168
Toolbars................................................................................................................................ 168
Workshop Tree..................................................................................................................... 168
Formula Editor ..................................................................................................................... 169
Tables and Fields.................................................................................................................. 170
Functions .............................................................................................................................. 171
Operators .............................................................................................................................. 172
Formula Editor Area............................................................................................................. 173
Simple Formulas........................................................................................................................ 174
Checking for Syntax Errors in Formulas.............................................................................. 174
Recycling Formula Fields .................................................................................................... 179
Explaining Null Values ............................................................................................................. 182
Crystal Reports – How Nulls are handled ............................................................................ 182
Handling Nulls via formulas ................................................................................................ 183
String Formulas ......................................................................................................................... 195
Format strings for Date, Time, and DateTime values .......................................................... 195
Using formulas to manipulate dates ..................................................................................... 196
Add comments to formulas .................................................................................................. 201
Date and Time Functions Help Reference............................................................................ 202
Lesson 7: Working with Multiple Tables 206
Understanding Database Components....................................................................................... 207
Fields .................................................................................................................................... 207
Tables ................................................................................................................................... 207
Records................................................................................................................................. 208
Keys...................................................................................................................................... 208
Joining Tables and Join Types................................................................................................... 210
Outer Join ............................................................................................................................. 211
Inner Join.............................................................................................................................. 212
Left Join................................................................................................................................ 213
Right Join ............................................................................................................................. 214
Adding Multiple Tables with the Database Expert.................................................................... 215
Linking Multiple Tables....................................................................................................... 216
Lesson 8: Conditional Formatting 227
Formatting Section Behavior..................................................................................................... 228
Common Tab........................................................................................................................ 229
Paging Tab............................................................................................................................ 230
Color Tab.............................................................................................................................. 230
Layout Tab ........................................................................................................................... 230
Formatting Sections with Conditional Logic............................................................................. 234
Suppressing Sections Conditionally .......................................................................................... 238
Hiding vs. Suppressing......................................................................................................... 238
Formatting Fields Conditionally................................................................................................ 243
Conditionally Highlight a Single Field ................................................................................ 249
Lesson 9: Summary Reports and Charting 252
Creating a Summary Report ...................................................................................................... 253
Hide: (Drill-Down OK) ........................................................................................................ 253
Suppress (No Drill-Down) ................................................................................................... 254
Copyright ©2017 Pathfinder Learning, LLP
6 Table of Contents
Utilizing Drill-Down to View Report Details ............................................................................261
Creating Charts with the Chart Expert .......................................................................................265
Chart Layouts........................................................................................................................265
Placing and Sizing Charts .....................................................................................................265
Formatting and Editing Charts ...................................................................................................270
The Type Tab ........................................................................................................................270
The Data Tab.........................................................................................................................270
The Axes Tab ........................................................................................................................277
The Options Tab....................................................................................................................278
The Color Highlight Tab.......................................................................................................279
The Text Tab.........................................................................................................................280
Zooming In and Out on Charts..............................................................................................281
Formatting Individual Chart Objects..........................................................................................286
Chart Expert ..........................................................................................................................286
Format Chart .........................................................................................................................286
Format Background...............................................................................................................286
Chart Options ........................................................................................................................287
Auto-Arrange ........................................................................................................................287
Lesson 10: Exporting Reports 288
The Need to Export ....................................................................................................................289
Export Types .........................................................................................................................290
Exporting Formats......................................................................................................................291
Character Separated Values ..................................................................................................291
Crystal Reports (RPT)...........................................................................................................291
Crystal Reports Read-Only (RPTR)......................................................................................291
Microsoft Excel.....................................................................................................................292
HTML (3.2 and 4.0) ..............................................................................................................293
Portable Document Format (PDF) ........................................................................................293
Text (TXT)............................................................................................................................294
Microsoft Word.....................................................................................................................294
eXtensible Markup Language (XML)...................................................................................295
Record Style – Column with spaces......................................................................................295
Record Style – Column without spaces.................................................................................295
Report Definition ..................................................................................................................296
Available Export Destinations....................................................................................................297
Application............................................................................................................................297
Disk File................................................................................................................................297
Exchange Folder ...................................................................................................................297
MAPI (Messaging Application Programming Interface)......................................................297
Previewing with HTML .............................................................................................................298
Index 305
Glossary 307
Copyright ©2017 Pathfinder Learning, LLP
About this Course 7
About this Course
Target Student & Prerequisites
This course is for students who wish to develop custom reports from a variety of data sources with minimal effort
and/or programming. Reports developed in Crystal Reports can be viewed by end users through the freely
downloadable Crystal Reports Viewer, or be exported to PDF or HTML for viewing in any PDF viewer or Web
browser.
Although there are no required prerequisite skills of other applications (i.e. Microsoft Excel®, Microsoft Access®,
Oracle®, SAP®, etc…), a good working knowledge of your database’s originating software will be of benefit when
accessing and extracting data into Crystal Reports.
How to Use this Book
This book is designed to be used as part of an instructor led course. It contains various lessons that will guide you
through learning the course material. The topics are explained including definitions of terms and relevant screen
captures. Also included are exercises that will reinforce the material discussed. The exercises build on each other.
Included with your book are files that you will need to complete the exercises. There are four high level folders:
Database
Exercise Files
Images
Solution Files
The Database folder contains a mock data set entitled Northwind 2008.mdb. This data set will be used throughout
the exercises in the course.
The Exercise Files folder contains ten subfolders, one for each lesson. The folder stores exercise files which contain
partially completed reports. These serve as the starting point for some of the exercises. NOTE: Some of the folders
are empty because the reports will be created from a blank report during the exercise.
The Images folder contains the corporate logo that will be displayed at the top of several of the exercise reports.
The Solution Files contains ten subfolders, one for each lesson that store the finished versions of the reports created
or modified throughout the exercises.
Copyright ©2017 Pathfinder Learning, LLP
8 About this Course
Place these folders in a location that is readily accessible, such as your operating system’s Desktop to make it easy to
access the files.
At the end of the book, you will find a glossary of the definitions of terms used in this course. In addition, there is an
index provided to allow you to find what you are looking for.
The Northwind 2008 Database
This course uses a sample database produced by Microsoft called Northwind 2008. This database contains 12 tables
that are linked by various key fields:
Categories
Customers
EmployeeAddresses
Employees
EmployeeTerritories
OrderDetails
Orders
Products
Region
Shippers
Suppliers
Territories
Copyright ©2017 Pathfinder Learning, LLP
About this Course 9
In the diagram below, the connecting lines represent the connections between tables by the respective keys.
Copyright ©2017 Pathfinder Learning, LLP
10 Lesson 1: Exploring Crystal Reports 2016
Lesson 1: Exploring Crystal Reports 2016
Unit time: 75 minutes
In this lesson, you will be introduced to:
1 Crystal Reports 2016 Interface
2 Toolbar Overview
3 Program Customization
4 Viewing a Sample Report
5 Report Layout
Copyright ©2017 Pathfinder Learning, LLP
Lesson 1: Exploring Crystal Reports 2016 11
Crystal Reports 2016 Interface
Crystal Reports is used to combine data from single or multiple sources and translate that data into meaningful
reports. Crystal Reports allows you to extract and manipulate only the desired fields form the database(s); this
allows for a more focused approach when reporting on large datasets.
Crystal Reports is available in a variety of versions, with each version supporting various degrees of database
connectivity and features.
To obtain detailed information about all of the SAP Crystal products, visit http://www.sap.com/crystal.
Report Development
Crystal Reports allows you to create reports in any of the following formats:
Standard report
Blank report
Crosstab report
Mailing-label report
OLAP Cube report
Reports are created in the Design mode and viewed as a finished product in the Preview mode.
Touring Crystal Reports
When you launch Crystal Reports, you will begin on the Start Page. Think of the Start Page as a landing site
from which all initial program activity begins. The Start Page provides you with immediate access to the
following program elements:
Dropdown menus
Toolbars (standard, formatting, insert, experts, and navigation)
Report navigation tabs
Start a new report
Open a previously viewed report
Obtain SAP promotional information (Internet access required)
Access key resources, such as user guides and community forum support
Copyright ©2017 Pathfinder Learning, LLP
12 Lesson 1: Exploring Crystal Reports 2016
Figure 1-1 Crystal Reports Start Page
The Start Page is closed by clicking the close button (small “×”) on the Start Page’s tab.
Figure 1-2 Close Control
Copyright ©2017 Pathfinder Learning, LLP
Lesson 1: Exploring Crystal Reports 2016 13
If you have closed this page by accident and wish to regain access, click the dropdown labeled Help, then
click Show Start Page.
Figure 1-3 Manual Start Page Activation
Copyright ©2017 Pathfinder Learning, LLP
14 Lesson 1: Exploring Crystal Reports 2016
Toolbar Overview
Crystal Reports is equipped with five toolbars for accessing program features. During the delivery of this course, as
new program features are presented, the corresponding toolbar button will be presented and explained in detail. It
may take a small amount of time to become familiar with the purpose of each button, but if you develop just a few
reports, you will discover that the time is much shorter than you expected.
Standard Toolbar
The standard toolbar contains General report operations such as New, Open, Save, Print, Export, Cut, Copy,
Paste, Undo, and Redo. This is where several of the Explorers reside, such as Field Explorer, Report
Explorer, Repository Explorer, as well as the Workbench and Dependency Checker.
Figure 1-4 Standard toolbar
Formatting Toolbar
Traditional font manipulation tools are located here, including Style, Size, Bold, Italic, Underline,
Alignment, Color, Borders, and Number Styles.
Figure 1-5 Formatting toolbar
Insert Toolbar
All of the Crystal Report objects are located here, such as Text, Group, Summary, Subreport, Line, Box,
Picture, and Chart.
Figure 1-6 Insert toolbar
Experts Toolbar
This toolbar connects you with all of the major technical functionality of the program. Tools like the
Database Expert, Group Expert, Sorting, Grouping, Section Expert, and Formula Workshop.
Figure 1-7 Experts toolbar
Copyright ©2017 Pathfinder Learning, LLP
Lesson 1: Exploring Crystal Reports 2016 15
Navigation Toolbar
The Navigation toolbar is where you can update the data in your report with the Refresh button, as well as
navigate through the pages of the report with traditional Next, Previous, First Page, Last Page controls. You
can also determine the total number of pages from this toolbar.
Figure 1-8 Navigation toolbar
Copyright ©2017 Pathfinder Learning, LLP
16 Lesson 1: Exploring Crystal Reports 2016
Program Customization
In order to utilize Crystal Reports to its maximum potential (as well as your own) you may wish to customize some
of the program’s behaviors. To view and alter the program options, click the File dropdown menu and then select
Options… This will present the program’s Options Dialog Box.
Figure 1-9 Options dialog box
Although most designers will find that the default settings work well for most reports, you may find that changing
key items will streamline your workflow and increase productivity. It is best to develop a few reports first, then look
for patterns in your workflow that could benefit from key option changes.
Copyright ©2017 Pathfinder Learning, LLP
Lesson 1: Exploring Crystal Reports 2016 17
Exercise 1-1 Exploring the Crystal Reports Interface
In order to draft your first report, you must first start the program and experience the program’s interface.
Complete the exercise below to familiarize yourself with Crystal Reports’ major functional areas.
1. In Windows®, click Start > Programs
2. Click SAP Business Intelligence > SAP Crystal Reports 2016.
3. In this folder, click SAP Crystal Reports 2016.
4. This will launch Crystal Reports and present you with the following window.
Figure 1-10 Crystal Reports introductory screen
5. Observe the major functional areas. The lower third of the screen will vary depending on the content
being pushed from SAP. This lower section is where you can access the program Highlights as well as
Key Recources. If you do not have an Internet connection, this area will remain blank.
6. To close Crystal Reports, click File, then click Exit.
Copyright ©2017 Pathfinder Learning, LLP
18 Lesson 1: Exploring Crystal Reports 2016
Viewing a Sample Report
In order to get an idea of the type of finished product Crystal Reports will deliver, it would be worth taking a look at
a finished report with some of the more common features found in typical reports. Some of the most common
features include:
Text objects
Groups
Formulas
Conditionally formatted fields
Drill-Down groups
Subtotals
Graphics
Preview panel
These features are explained throughout the course.
Copyright ©2017 Pathfinder Learning, LLP
Lesson 1: Exploring Crystal Reports 2016 19
Exercise 1-2 Viewing a Sample Report
The purpose of this exercise is to open an existing finished report to use as an example while we familiarize
ourselves with the following discussions.
1. On the main start page, click Open File.
2. Browse to the location of the saved class files and open the folder named Exercise Files\Lesson 01.
3. Select the E1-2 Sample Report file and then click Open.
The report should look like the following graphic. Notice the inclusion of graphics and textboxes at the
top of the report.
Figure 1-11 Sample report
Copyright ©2017 Pathfinder Learning, LLP
20 Lesson 1: Exploring Crystal Reports 2016
Report Layout
Navigation Tabs
As you can see, the report opens with its own dedicated tab in the Report Navigation section.
Figure 1-12 Report navigation section
From here, you may return to the Start Page by clicking the labeled tab.
Report Statistics: The bottom of the report window displays the last date and time that the data in the report
was updated, as well as the number of records included in the report based on the report’s query and filter
parameters.
Figure 1-13 Report statistics
Conditionally Formatted Fields
Observe how all order amounts in excess of $2,000.00 have been colored green.
Figure 1-14 Conditionally formatted fields
Grouping
Sales have been grouped by country and then grouped by state/region within that country. Each state/region
is further broken down by cities within that state/region.
Copyright ©2017 Pathfinder Learning, LLP
Lesson 1: Exploring Crystal Reports 2016 21
Subtotals
For each level of the grouping, there is a subtotal provided. Shown below is a sample of a city subtotal and a
state/region subtotal.
Figure 1-15 Groups and subtotals
Design Tab
The design tab is where customization and changes to the report are made.
Figure 1-16 Design tab
Copyright ©2017 Pathfinder Learning, LLP
22 Lesson 1: Exploring Crystal Reports 2016
Preview Tab
The preview tab provides a view of the report with the layout. In order to navigate the report with greater
ease, a hierarchical breakdown of each country and state/region is provided to the left of the report. This
navigational tool will also be available to the viewer when the report is exported to a PDF format.
Figure 1-16 Preview panel
Close the report
To close the report, click the “×” symbol on the report’s tab or click File and then Close.
Figure 1-18 Close report control
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 23
Lesson 2: Creating and Modifying Reports
Unit time: 75 minutes
In this lesson, you will be introduced to:
1 Creating a Report
2 Exploring the Design Tab
3 Adding Fields to a Report
4 Adjusting Field Position and Size
5 Previewing Field Data
6 Aligning Field Data
7 Creating a Text Object
8 Saving the Report
9 Previewing Report Data
Copyright ©2017 Pathfinder Learning, LLP
24 Lesson 2: Creating and Modifying Reports
Creating a Report
Reports
Reports are created by querying a data source that contains all of the needed information. The report takes
typically disorganized data and transforms it by means of filters and sorting into a structure that tells a story.
Data Sources
Connecting to a data source is the first step in the report generation process. Smaller data sources may have
just the perfect amount of fields needed for your report. However, most data sources contain more fields
than you require for reporting purposes. The ability to pick only the fields you need for your report is the
key to providing focus to your report.
If the data source you are extracting data from does not contain all of the necessary information, it is possible
to extract data from multiple data sources and combine them into a virtual data source called the Data Model.
The Data Model aggregates and connects all of the selected fields from the individual data sources and
represents it as a unified data source. Although the data is not combined physically, it is represented
logically in the Crystal Reports application. Lesson 7 covers this subject in more detail.
Creating a Report
There are several ways to begin the report creation process. Depending on the type of report you are
creating, certain techniques are more efficient than others are. On the Start Page, under the START A NEW
REPORT heading, are options that allow you to launch the various report wizards available in Crystal
Reports.
Creating a Standard Report
A standard report provides a typical report format. The report wizard will walk you through
choosing data sources and selecting the fields for the report. In addition, it allows you to determine
grouping, summaries and filtering of the data.
There are multiple ways to start a standard report. Any of these options will cause the Standard
Report Creation Wizard to display.
Clicking the New Report button on the Standard toolbar
Figure 2-1 New Report button
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 25
Clicking Report wizard under the START A NEW REPORT heading
Figure 2-2 Report wizard
Clicking File, then New and selecting Standard Report from the fly-out menu
Figure 2-3 Creating a Standard Report
Creating Other Report Types
There are several other types of reports built into Crystal Reports. These include:
Blank report
Cross-tab report
Mailing label report
OLAP Cube report
Copyright ©2017 Pathfinder Learning, LLP
26 Lesson 2: Creating and Modifying Reports
These reports can be created by one of two methods; File menu or Start Page. Either method will
launch the appropriate report wizard.
Figure 2-4 Starting alternate reports
The Database Expert Tool
The Database Expert is the key tool for establishing and managing connections between your data sources
and the data model. In addition to data connections, join types between data sources can be managed with
this tool.
Figure 2-5 Database Expert Dialog Box
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 27
Available Data Sources
This section is used to connect to a new data source or quickly connect to a previously connected
data source. If this is the first time you have used Crystal Reports, the My Connections portion of
the tree will be empty. A connection to a data source must be established before a history is created
in the My Connections tree.
Selected Tables
This section displays the tables that can be queried from the data source. Each table contains the
various fields that can be included in the report.
Data Source Connection Types
Because data can come from a multitude of different sources, Crystal Reports is equipped with a toolbox full
of data connectors. These connectors provide access to the most common (and in some cases, less common)
databases used within the industry. Database vendors include SAP, Oracle, Salesforce.com, Access, and
Excel. In addition, virtually any ODBC or OLAP compliant database can be used as a data source for your
report.
Copyright ©2017 Pathfinder Learning, LLP
28 Lesson 2: Creating and Modifying Reports
Exercise 2-1 Connecting to a Data Source
This exercise will demonstrate how to connect to a database and select tables and fields that will form the
basis of the reports.
1. From the Start Page, under the START A NEW REPORT banner, click Blank Report.
2. From within the Database Expert, in the Available Data Sources section (left) expand the Create New
Connection folder. Expand the Access/Excel (DAO) folder.
3. In the presented Connection dialog box, click the ellipse button to browse to the location of the saved
class files and open the folder named Database.
4. Select the Northwind 2008.mdb database file and then click Open.
5. No further options need to be changed in this dialog box, so click Finish.
Depending on the database selected, you will be presented with categories which may include
Add Command
Tables
Stored Procedures
Figure 2-6 Database Expert
6. Expand the category labeled Tables. This will display a list of every table contained in the selected
database.
7. Select the table named Orders.
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 29
8. The table can be added to the Selected Tables window (right side) by either double-clicking on the table
name or clicking once on the table name and then clicking the greater than button in the middle
of the dialog box.
Figure 2-7 Selected Table in Database Expert
9. Click OK to close the Database Expert dialog box.
10. Save the file as My Shipping Orders.
11. Leave the file open for the next exercise.
Copyright ©2017 Pathfinder Learning, LLP
30 Lesson 2: Creating and Modifying Reports
Exploring the Design tab
Now that you have connected to the data source, it is time to begin constructing your report. This section will
explore the following areas:
Identify the key sections of a report
Add database fields to the report
Report Sections
Each report contains a series of sections. The behavior of a field and the location that it appears is directly
related to the section that a database field is placed. The default sections for a report are listed below, with
their respective display characteristics.
Section Name Display Behavior Example Section Elements
Report Header Items placed in this section are displayed Corporate logo
one time at the beginning of the report. Report title
Report print date/time
Page Header Items placed in this section are displayed Field headings
Details at the top of each printed page.
Items placed in this section act as the Database fields
focus of the report. It is the main area of Field headings
analysis for the report. Summary calculations
Confidentiality information
Report Footer Items placed in this section are displayed
Page Footer one time at the end of the report. Page numbers
Items placed in this section are displayed Contact information
at the bottom of each printed page.
Table 2-1 Report Sections
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 31
Adding Fields to a Report
Fields are added to any section of the report from the Field Explorer. The Field Explorer is a repository of fields
from the connected database and designer-created formulas, SQL expressions, page numbers, filenames, as well as a
host of other metadata information. These areas are categories in the Field Explorer.
Figure 2-8 Field Explorer
The Field Explorer should be visible by default. If the Field Explorer is not visible, click View and select Field
Explorer or click the Field Explorer button on the Standard toolbar.
All of the loaded tables are accessible via the Database Fields category. By clicking on the plus sign next to
Database Fields, the tables are displayed. Each table may be expanded separately to reveal its associated fields.
Figure 2-9 Field Explorer with Tables and Fields Displayed
Copyright ©2017 Pathfinder Learning, LLP
32 Lesson 2: Creating and Modifying Reports
Fields can be added to any section of a report by utilizing any of the following:
Right click on a field and select Insert to Report from the menu.
Figure 2-10 Inserting a Field – Right click
Select a field and click the Insert to Report button located at the top left of the Field Explorer tool.
Figure 2-11 Inserting a Field – Insert to Report Button
Click and hold on a field name and drag it to the desired section and release.
Figure 2-12 Inserting a Field – Drag and Drop
The most common section to place fields is the Details Section. This forms the heart and soul of the finished report.
When you add a field to the Details section, the name of the field is automatically added to the Page Header section.
Adding the field headings is a great time saver since the vast majority of your reports will naturally include these
headings. Crystal Reports also automatically determines the width of the column. The width is dictated by either the
length of the field’s name or the length of the field in the database, whichever length is greater.
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 33
NOTE: The automatic addition of field headings can be confusing to a beginning Crystal Reports designer. At first
glance it appears like your field has been added twice. Keep in mind, once the report is previewed, the field
references in the Details section will be replaced by actual database information.
Figure 2-13 Adding Fields to the Details Section
Some things to consider when adding fields to the report:
Field headers are only added automatically when the field is added to the Details section. If a field is added
to a different section of the report, no heading is created.
If the field is added to a different section and then moved to the Details section, a header will not be created
automatically.
If you delete the field from the Details section, the corresponding heading in the Page Header section will be
removed automatically.
The heading can be deleted without deleting the field from the Details section.
Copyright ©2017 Pathfinder Learning, LLP
34 Lesson 2: Creating and Modifying Reports
Exercise 2-2 Adding Fields to a Report
This exercise will demonstrate how to add database fields to the report.
1. Continuing on with the My Shipping Orders file created in the previous exercise, ensure that the Field
Explorer is visible. If the Field Explorer is not present on your screen, it can be displayed by either
clicking on View and then Field Explorer or by clicking the Field Explorer button on the Standard
toolbar.
Figure 2-15 Activating the Field Explorer - Button
Figure 2-14 Activating the Field Explorer – View Menu
2. Expand the Database Fields category to display the Orders table.
3. Expand the Orders table to display the fields associated with orders.
4. Using one of the aforementioned techniques (i.e. drag-n-drop), place the OrderID field in the far left of
the Details section. Observe how the field’s heading has automatically been placed in the Page Header
section.
5. Using the same process, add the CustomerID field to the right of the OrderID field.
6. Complete the exercise by adding ShipAddress, ShipCity, and ShipRegion to the right of one another.
7. Verify the Design tab is similar to the image below.
Figure 2-16 Exercise 2-2 Finished Example
8. Save the My Shipping Orders file.
9. Leave the file open for the next exercise.
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 35
Adjusting Field Position and Size
One of the first things to take care of is the appropriate allocation of space that each field will be given on the report.
It is unlikely that the perfect amount of space has been given to each column of field data. Another facet of your
report that will need to be adjusted is the space between each column of field data. It is not important at this point in
the report’s construction that you establish this perfectly, but it is good practice to get it close to the finished product
so as to reflect more accurately the overall report design.
Resizing Fields
A field can be resized by selecting one of the blue resize handles surrounding a selected field. If you resize
the field in the Details section, the corresponding heading in the Page Header section will conform to the
new dimension. If you resize the field heading in the Page Header section, the data field in the Details
section does not resize to match. This can be both a time saver as well as a source of frustration if not
understood. It is best practice to perform all field resizing on the data field in the Details section.
Figure 2-17 Resizing Handles
Moving Fields
To move a field in any section, click the field in question and hover your mouse over the selected field. This
will display a move crosshair icon.
Figure 2-18 Move Handle
Moving either a data field in the Details section or a field’s heading in the Page Header section does not
move its corresponding field. Since these two items typically travel as a team, the preferred method of
moving fields is by means of the guide handles located on the Ruler.
Figure 2-19 Ruler, Move Handles
Copyright ©2017 Pathfinder Learning, LLP
36 Lesson 2: Creating and Modifying Reports
Using the Ruler’s guide handles ensure that when one field moves, its associated header moves as well.
One way to ensure that a field is connected to a guide handle on the Ruler is to look for the small red snap
marker on the left or right side of the field. The fields guide handle will be located directly above the snap
marker.
Figure 2-20 Snap Markers
When you move a field with the Ruler’s guide handle, a dotted Guideline will appear to allow you to identify
and position fields with greater precision.
Figure 2-21 Guidelines
If a field is moved without the aid of the guide handle, it will become detached and behave as an independent
object in the report.
Figure 2-22 Detached Field
If a field becomes detached from its guide handle, the simplest way to reconnect is to manually move the
field left or right until it lines up with its respective guide handle. Since this can sometimes be difficult to
approximate visually, an option exists in Crystal Reports to actively display all of the report’s guidelines.
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 37
To display all of the report’s guidelines, click File and then click Options. On the Layout tab, in the section
labeled Design View, click Guidelines.
Figure 2-23 Program Options Dialog Box
You will now see dotted lines on the screen to allow for easier recognition of attached vs. detached fields.
Figure 2-17 Visible Guidelines
NOTE: If you wish to move or resize with greater precision, consider using the arrow keys on your
keyboard. By pressing the arrow keys you can move a field in any direction. If you are interested in resizing
the field, press and hold your Shift key while you press the arrow keys. This will resize the right side of the
field. Keep in mind that using this technique for moving (and in certain cases, resizing) will detach the field
from its guide handle.
Copyright ©2017 Pathfinder Learning, LLP
38 Lesson 2: Creating and Modifying Reports
Exercise 2-3 Moving and Resizing Fields
This exercise will provide you with experience with moving and resizing fields in a report.
1. Continuing on with the My Shipping Orders file from the previous exercise, turn the reports guidelines
on by clicking File and then click Options. On the Layout tab, in the section labeled Design View,
click Guidelines, then click OK.
2. Click and hold on the leftmost guide handle (OrderID field) and drag it to the left until the field’s left
side is touching the report’s left margin.
3. Click and hold the guide handle for CustomerID and drag it to the left until the left side of the
CustomerID field is almost touching the OrderID field. Be careful not to overlap your fields. Crystal
Reports will not warn you if your data visually overlaps.
4. Move the ShipAddress fields to the left until they are near the CustomerID fields.
5. Click and hold on the rightmost guide handle (ShipRegion field) and drag it to the right until the
field’s right side is touching the reports right margin.
6. Click and hold the guide handle for ShipCity and drag it to the right until the right side of the ShipCity
field is almost touching the ShipRegion field. Remember to be careful about overlapping your fields.
7. Click one time on the ShipAddress field in the Details section. With this field selected, grab the right
resize handle and extend the field’s width until it almost touches the ShipCity field. Notice how both
fields associated with ShipAddress have been resized.
(EXTRA PRACTICE: Undo this step and then perform it again, but this time on the ShipAddress heading
in the Page Header section. Observe that the corresponding field in the Details section does not resize
with the heading. Undo the operation and repeat with the original instruction.)
8. Verify the Design tab is similar to the image below.
Figure 2-25 Exercise 2-3 Completed Example
9. Save the My Shipping Orders file.
10. Leave the file open for the next exercise.
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 39
Previewing Field Data
The ability to take a sneak peek into the data can be useful when field names do not adequately define the underlying
data. The Browse Field feature allows you to browse the first 500 unique entries in the field. Since you are not
examining the entire range of possible field entries, a complete representation of the data is often times not achieved.
In most cases, this is satisfactory since you are only trying to gain deeper insight into the type of data stored in the
field.
There are several ways you can examine the data prior to adding the field to the report:
Click on a field in the Design tab and then click the Database menu and select Browse Data…
Figure 2-18 Browse Data – Database Menu
Right-click on a field in the Design tab and select Browse Field Data… from the resultant menu
Figure 2-27 Browse Data – Right Click
Select a field from within the Field Explorer and then click the Browse button located at the top of the
Field Explorer window.
Copyright ©2017 Pathfinder Learning, LLP
40 Lesson 2: Creating and Modifying Reports
Any of the access methods will produce something similar to the following graphic.
Figure 2-28 Browsing Field Data
If the dialog box is not wide enough to get a clear view of the previewed information, drag the dialog box resize
handle located in the lower-right corner to a more acceptable dimension.
Figure 2-19 Dialog Box Resize Handle
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 41
Exercise 2-4 Previewing Field Data
This exercise demonstrates how to preview record information from a database field.
1. Continuing on with the My Shipping Orders file from the previous exercise, right-click on
ShipAddress field in the Details section and select Browse Field Data… from the menu.
2. Resize the window to reveal as much data as your screen will allow.
Figure 2-30 Field Data Preview
3. Click the Close button to dismiss the dialog box.
4. Leave the file open for the next exercise.
Copyright ©2017 Pathfinder Learning, LLP
42 Lesson 2: Creating and Modifying Reports
Aligning Field Data
Creating a professional looking report requires that fields and graphics line up with precision. Instead of relying on
what you think looks right, there are tools available to ensure fields and graphics are perfectly aligned. The process
begins by selecting the fields that you want to align and then aligning them.
Selecting Fields
Selecting fields can be accomplished by clicking on the initial field and then pressing and holding the Shift
key on your keyboard. At this point, as long as the Shift key remains depressed, all future fields clicked will
be added to the selection. Once all desired fields have been selected, release the Shift key. This technique is
ideal when the desired fields are separated by some distance with other undesired objects lying between
them.
Another method for selecting fields, when the fields are close to one another with no undesirable elements
between them, is to select the fields graphically. This is accomplished by clicking and holding your mouse
pointer at some outer position from the data and dragging a bounding box around the desired report
elements.
Figure 2-31 Selecting Fields
This is an effective technique but it can be difficult to get just the desired elements when there are several
elements in close proximity. A more efficient alternative to this is to only partially select the desired fields.
This prevents you from getting too close to neighboring report elements and selecting too much.
Figure 2-32 Partial Field Selection
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 43
Aligning Fields
Once the desired fields have been selected, the process of alignment can now take place. Right-click on the
field that is in the correct position and click Align, then click the desired alignment option.
Figure 2-33 Alignment Options
Keep in mind that the right-clicked field becomes what is known as the reference field. In other words, if
you select Align – Bottoms, it is the bottom of the right-clicked field that the other fields will align to.
Copyright ©2017 Pathfinder Learning, LLP
44 Lesson 2: Creating and Modifying Reports
Exercise 2-5 Aligning Fields
This exercise will provide you with the opportunity to select fields in bulk and perform resizing and
alignment operations.
1. Continuing on with the My Shipping Orders file from the previous exercise, begin by selecting a few
fields in the Page Header section, then with your up arrow key, move the fields up a small amount.
Figure 2-34 Move Fields
2. Draw a selection box around several of the non-aligned fields.
Figure 2-35 Selecting Fields
3. Right-click on the field you want the other fields to align on. In this example, ShipCity is in the proper
position and will serve as the reference location for the other selected fields. Choose Align.
Figure 2-36 Accessing Alignment Options
4. Select Tops, Middles, or Bottoms.
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 45
5. Attempt to realign the fields into the original layout.
Figure 2-37 Original Field Layout
6. Leave the file open for the next exercise.
Copyright ©2017 Pathfinder Learning, LLP
46 Lesson 2: Creating and Modifying Reports
Creating a Text Object
The ability to add text to a report that has no link to the underlying data is useful when you wish to include report
titles, explanations, or any other static text. To add a text object to your report, click the Insert Text Object
button on the Insert toolbar.
Figure 2-38 Insert Text Object Button
Clicking this button will change your standard arrow pointer into a large crosshair. Place the crosshair where you
want to insert the text, and click and drag diagonally. The size and placement of the initial text box is not critical
since it can be easily moved and resized after the fact.
Figure 2-39 Establishing a Text Object
When the mouse is released, you will be placed in Edit Mode. It is apparent that you are editing a text object
because the document-wide ruler is reduced to a size that matches the width of your text box. You will also see a
flashing text cursor inside of the text object.
Figure 2-40 Edit Mode
To complete the editing process, click anywhere outside of the text object. If you require further editing of the text
object, double-click anywhere inside the boundary of the text object.
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 47
Exercise 2-6 Adding and Editing Text Objects
In this exercise, you will gain experience with adding text objects to reports and perform some basic visual
customizations to the text.
1. Continuing on with the My Shipping Orders file from the previous exercise, click the Insert Text
Object button.
2. Click and hold in an empty portion of the Report Header section.
3. Drag diagonally to establish a text zone approximately two inches wide.
4. In the newly inserted text object, type Orders Shipped by Location.
5. Click outside the text object’s boundaries.
6. Click once on the text object to enable the resizing and moving controls.
7. From the Standard toolbar’s font controls, change the text’s font to Calibri and set the font size to 20
points.
8. Make any necessary adjustments to ensure all of the text is readable and the report title appears towards
the upper left-hand corner of the Report Header section.
9. If any spelling errors exist, double-click the text object to enable editing of the text.
10. Verify the Design tab is similar to the image below.
Figure 2-41 Sample Finished Text Object
11. Save the My Shipping Orders file.
12. Leave the file open for the next exercise.
Copyright ©2017 Pathfinder Learning, LLP
48 Lesson 2: Creating and Modifying Reports
Saving the Report
Working with Crystal Reports is no different than any other data creating application; you need to save your work.
Crystal Reports is equipped with a few save options that can not only prevent the accidental loss of work but also
give the viewer the ability to view the underlying data when no connection to the data source is available.
Using the Autosave Feature
To prevent the accidental loss of data, Crystal Reports has the ability to automatically save your work based
on an interval of minutes defined by the designer. In order to establish this interval, click File and then
select Options… In the Options dialog box, select the Reporting tab and check the option labeled
Autosave Reports After. This is also where you can define a save interval between 1 and 1,000 minutes
(16.7 hours).
Figure 2-42 Autosave Feature
Be aware that if you have a tendency to experiment with reports, but don’t wish to save the alterations, you
must either deactivate this feature to prevent unwanted saves, or save the file under a new name so as to not
corrupt the original report.
Copyright ©2017 Pathfinder Learning, LLP
Lesson 2: Creating and Modifying Reports 49
Saving the Data with the Report
If your data does not change frequently, or you are in the development stage of your report, a timesaving
feature is to save the report’s data along with the report’s definition (structure). This ensures that as soon as
the report is open the data is visible. This feature can also be used to ensure data can be viewed and printed
when the report is sent to someone who does not have access to the source data.
To enable the embedding of data into your report, click File and then ensure a checkmark is present next to
the option Save Data with Report.
Figure 2-43 Save Data with Report Feature
There are a few things to keep in mind when deciding if this is a feature worth implementing.
If you do not save the data with the report definition (structure), an update will need to be performed
to refresh the report prior to analysis or printing. This is accomplished by clicking the Refresh
button on the Navigation toolbar or by pressing the F5 key on the keyboard.
If you save the data along with the report’s definition, the file will consume more disk space in
relation to the amount of data contained in the report. This can make it difficult to email the report
through some email systems due to size restrictions on email attachments.
Copyright ©2017 Pathfinder Learning, LLP
50 Lesson 2: Creating and Modifying Reports
Previewing Report Data
Now that you have added fields to the report, aligned the objects, and added a title it’s time to see what kind of
masterpiece is waiting to be unleashed to the world.
The Design tab is where all of the construction of the report takes place, but in order to see a more accurate
representation of the finished product, the report must be previewed. Previewing a report is similar to executing a
Print Preview action on a traditional document.
Preview Data Methods
Crystal Reports has two methods for previewing data:
View – Print Preview (or click the Print Preview button on the Standard toolbar or press
CTRL-R on the keyboard). This will produce a preview of the report with all requested records in
the data source.
View – Preview Sample. This is a convenient alternative to previewing the report when the data
source contains a large number of records or is slow to query. You can define the number of records
to pull from the data that would give an adequate representation of the report’s finished state.
NOTE: Once the Preview Sample feature is invoked, the entire report will not be viewable until the
Preview Sample feature is reactivated and set to All records.
Figure 2-44 Preview Sample Dialog Box
Navigating the Previewed Data
Once you have the preview enabled, you will see a new tab to the right of the Design tab labeled Preview.
The Preview tab allows you to see the report as it will appear on the printed page. Navigating between the
previewed data and the design area is accomplished via these two tabs.
Figure 2-45 Preview Tab
Copyright ©2017 Pathfinder Learning, LLP