BOC310 Crystal Reports 2008 Report Design I.pdf

300
8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 1/300 Crystal Reports 2008: Report Design I - Fundamentals of Report Design Learner’s Guide BOC310

Transcript of BOC310 Crystal Reports 2008 Report Design I.pdf

Page 1: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 1/300

Crystal Reports 2008: Report Design I -

Fundamentals of Report Design

Learner’s Guide

BOC310

Page 2: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 2/300

Copyright© 2009 SAP® BusinessObjects™. All rights reserved. SAP

BusinessObjects owns the followingUnited States patents, which

may cover products that are offered and licensed by SAP

BusinessObjectsand/or affliatedcompanies: 5,295,243; 5,339,390;5,555,403; 5,590,250; 5,619,632; 5,632,009; 5,857,205; 5,880,742;

5,883,635; 6,085,202; 6,108,698; 6,247,008; 6,289,352; 6,300,957;

6,377,259; 6,490,593; 6,578,027; 6,581,068; 6,628,312; 6,654,761;

6,768,986; 6,772,409; 6,831,668; 6,882,998; 6,892,189; 6,901,555;

7,089,238; 7,107,266; 7,139,766; 7,178,099; 7,181,435; 7,181,440;

7,194,465; 7,222,130; 7,299,419; 7,320,122 and 7,356,779. SAP

BusinessObjects and its logos,BusinessObjects,Crystal Reports®,

Rapid Mart™, Data Insight™, Desktop Intelligence™, Rapid

Marts®, Watchlist Security™, Web Intelligence®, and Xcelsius®

are trademarks or registered trademarks of Business Objects,

an SAP company and/or affiliated companies in the UnitedStates and/or other countries. SAP® is a registered trademark

of SAP AG in Germany and/or other countries. All other names

mentioned herein may be trademarks of their respective owners.

Page 3: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 3/300

C O N T E N T S

About this CourseCourse introduction...................................................................................................xiii

Course description.....................................................................................................xiv

Course audience.........................................................................................................xiv

Prerequisites................................................................................................................xiv

Additional education.................................................................................................xiv

Level, delivery, and duration...................................................................................xiv

Applicable certifications and designations.............................................................xiv

Course success factors ................................................................................................xv

Course setup ................................................................................................................xv

Course materials .........................................................................................................xv

Learning process ........................................................................................................xvi

Lesson 1

Planning a ReportLesson introduction ......................................................................................................1

Defining database concepts .........................................................................................2

Database terms and definitions ...........................................................................2

Planning and developing a report prototype............................................................3Report prototype layouts......................................................................................3

Developing a report prototype.............................................................................3

Report Requirements Checklist............................................................................3

Activity: Developing a report prototype............................................................4

Debrief: Planning a report ...........................................................................................8

Lesson summary ...........................................................................................................9

Lesson 2

Creating a ReportLesson introduction.....................................................................................................11

Creating a report..........................................................................................................12

Report creation methods ....................................................................................12

Specifying the data source .................................................................................13

Adding tables...............................................................................................................18

Adding tables to a report....................................................................................18

Linking database tables ......................................................................................19

The design environment.............................................................................................21

iiiTable of Contents—Learner’s Guide

Page 4: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 4/300

Understanding the Design window .................................................................21

Working with toolbars in the Design window ...............................................23

Inserting objects on a report.......................................................................................25

Working with the Field Explorer.......................................................................25

Working with the Report Explorer....................................................................27

Working with the Repository Explorer.............................................................30

Working with the Workbench............................................................................33

Determining data field types .............................................................................35

Previewing a report ....................................................................................................37

Previewing reports ..............................................................................................37

Viewing a report ..................................................................................................38

Working in the Design and Preview tabs ........................................................40

Saving a report ............................................................................................................42

Adding summary information ..........................................................................42

Saving a report .....................................................................................................43

Saving a preview of a report ..............................................................................44

Checking a report for errors ..............................................................................45

Activity: Creating a report..................................................................................47Positioning and sizing objects ...................................................................................49

Positioning objects using a grid ........................................................................49

Positioning objects using guidelines ................................................................51

Positioning objects using free-form placement ...............................................53

Locking an object’s position and size ...............................................................53

Moving objects .....................................................................................................53

Aligning objects ...................................................................................................56

Resizing objects ....................................................................................................56

Cutting, copying, and pasting objects ..............................................................57

Formatting objects ......................................................................................................58

Formatting fields using the Formatting toolbar .............................................58Formatting fields using the Format Editor.......................................................58

Locking an object’s format .................................................................................63

Using text objects .................................................................................................63

Activity: Positioning, sizing, and formatting objects......................................65

Quiz: Creating a report ..............................................................................................67

Lesson summary .........................................................................................................68

Lesson 3

Selecting RecordsLesson introduction.....................................................................................................69

Defining the Select Expert .........................................................................................70

Using the Select Expert........................................................................................70

The Select Expert’s features ...............................................................................71

Determining the criteria for record selection...........................................................72

Defining record selection ...................................................................................72

Changing record selection to be case insensitive ............................................74

Fundamentals of Report Design—Learner’s Guideiv

Page 5: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 5/300

Understanding saved and refreshed data ...............................................................76

Saving data with a report....................................................................................76

Refreshing data in a report.................................................................................76

Applying record selection..........................................................................................78

Setting selection criteria ......................................................................................78

Activity: Applying record selection...................................................................79

Setting additional criteria ..........................................................................................80

Setting additional record selection criteria ......................................................80

Activity: Setting additional selection criteria...................................................81

Modifying record selection ........................................................................................82

Modifying existing record selection .................................................................82

Modifying a record selection formula ..............................................................82

Activity: Refining the record selection..............................................................86

Applying time-based record selection .....................................................................88

Setting record selection based on a date ..........................................................88

Activity: Applying a time-based record selection...........................................89

Quiz: Selecting records ...............................................................................................91

Lesson summary .........................................................................................................92

Lesson 4

Organizing Data on a ReportLesson introduction.....................................................................................................93

Sorting records ............................................................................................................94

Applying a sort order to records .......................................................................94

Using sort controls...............................................................................................95

Activity: Applying sorting options....................................................................97

Grouping records ........................................................................................................99Creating groups ...................................................................................................99

Navigating using the Preview Panel.................................................................99

Navigating in the report using drill-down ....................................................100

Applying sort order options when grouping ................................................100

Modifying groups .............................................................................................103

Changing the definition of a group ................................................................103

Deleting groups .................................................................................................104

Activity: Creating and modifying groups......................................................105

Creating nested and multiple groups ............................................................106

Reordering groups ............................................................................................107

Activity: Creating and reordering multiple groups......................................108

Adding a specified order group ......................................................................109

Activity: Adding a specified order group......................................................112

Grouping on time-based data ..........................................................................113

Activity: Grouping on a date field...................................................................114

Summarizing data .....................................................................................................116

Inserting a summary .........................................................................................116

Inserting a group and summary at the same time .......................................118

vTable of Contents—Learner’s Guide

Page 6: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 6/300

Activity: Inserting summaries..........................................................................120

Creating a group selection based on summary data ....................................121

Activity: Grouping on summary data.............................................................123

Creating a grand total .......................................................................................123

Activity: Inserting a grand total.......................................................................124

Quiz: Organizing data on a report .........................................................................126

Lesson summary .......................................................................................................127

Lesson 5

Formatting a ReportLesson introduction...................................................................................................129

Adding graphical elements......................................................................................130

Adding a line to a report ..................................................................................130

Adding a box to a report ..................................................................................132

Adding a graphic to a report ...........................................................................133

Adding a dynamic image object .....................................................................135Activity: Adding graphical elements..............................................................136

Combining text objects with database fields ........................................................140

Embedding a database field into a text object ...............................................140

Preventing truncation of text objects ..............................................................141

Formatting individual elements of text objects .............................................142

Setting tabs in a text object ...............................................................................143

Applying specialized formatting ............................................................................145

Formatting multiple objects .............................................................................145

Applying predefined templates.......................................................................146

Applying text rotation.......................................................................................148

Applying accounting conventions ..................................................................149Applying numeric, currency, date, time, and date/time formatting.........151

Activity: Applying formatting elements.........................................................157

Inserting fields with pre-built functions ................................................................159

Inserting special fields ......................................................................................159

Formatting special fields ..................................................................................161

Embedding a special field into a text object ..................................................162

Activity: Adding special fields.........................................................................162

Debrief: Validating the report design..............................................................164

Quiz: Formatting a report ........................................................................................166

Lesson summary .......................................................................................................167

Lesson 6

Applying Section FormattingLesson introduction...................................................................................................169

Formatting sections...................................................................................................170

Defining the Section Expert..............................................................................170

Exploring the Common tab ......................................................................170

Fundamentals of Report Design—Learner’s Guidevi

Page 7: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 7/300

Exploring the Paging tab...........................................................................173

Exploring the Color tab..............................................................................175

Exploring the Layout tab...........................................................................176

Formatting a section ..........................................................................................177

Activity: Formatting sections............................................................................179

Creating summary reports.......................................................................................180

Defining a summary report .............................................................................180

Creating a summary report .............................................................................180

Viewing the summary report in the Preview window ................................181

Activity: Creating a summary report..............................................................181

Quiz: Applying section formatting ........................................................................183

Lesson 7

Creating Basic FormulasLesson introduction ..................................................................................................185

Defining a formula and its purpose........................................................................186Formulas .............................................................................................................186

The components of a formula...........................................................................186

Crystal syntax.....................................................................................................188

Special characters used in Crystal syntax.......................................................189

Data types ...........................................................................................................189

Working with formulas in the Field Explorer................................................190

Deleting a formula ............................................................................................191

Creating formulas......................................................................................................192

Formula creation methods ...............................................................................192

Adding comments to a formula ......................................................................192

Creating a formula in the Formula Workshop..............................................192Creating a formula in the Formula Editor .....................................................196

Applying Boolean formulas.....................................................................................198

Boolean formulas ...............................................................................................198

Creating a Boolean formula .............................................................................198

Activity: Applying a Boolean formula............................................................201

Applying If-Then-Else formulas..............................................................................202

If-Then-Else formulas .......................................................................................202

Creating an If-Then-Else formula ...................................................................202

Activity: Applying an If-Then-Else formula..................................................202

Applying date calculations.......................................................................................204

Date calculation .................................................................................................204

Creating a date calculation ..............................................................................204

Activity: Applying date calculations...............................................................205

Applying numeric calculations................................................................................207

Numeric calculations ........................................................................................207

Creating a numeric calculation .......................................................................207

Activity: Applying numeric calculations........................................................208

Applying string manipulation.................................................................................210

viiTable of Contents—Learner’s Guide

Page 8: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 8/300

String manipulation...........................................................................................210

Creating string manipulation formulas..........................................................210

Activity: Applying string manipulation formulas........................................212

Debrief: Creating basic formulas.............................................................................214

Lesson 8

Applying Conditional ReportingLesson introduction...................................................................................................215

Determining trends in data......................................................................................216

Using the Highlighting Expert.........................................................................216

Conditionally formatting fields using the Highlighting Expert .................216

Setting highlighting priorities .........................................................................217

Activity: Using the Highlighting Expert.........................................................219

Formatting data conditionally ................................................................................221

Conditional formatting .....................................................................................221

Applying on or off properties .........................................................................221Applying attribute properties .........................................................................222

Applying conditional formatting functions ..................................................223

Activity: Formatting data conditionally.........................................................223

Quiz: Applying conditional reporting ...................................................................225

Lesson summary........................................................................................................226

Lesson 9

Representing Data VisuallyLesson introduction...................................................................................................227

Creating a chart .........................................................................................................228

Choosing a chart location and type ................................................................228

Inserting a chart using the Chart Expert ........................................................228

Exploring the Type tab ..............................................................................229

Exploring the Data tab ..............................................................................232

Exploring the Axes tab ..............................................................................233

Exploring the Options tab ........................................................................234

Exploring the Color Highlight tab ..........................................................235

Exploring the Text tab ...............................................................................236

Charting on summary data ..............................................................................237

Drilling down on a chart ..................................................................................238

Activity: Charting on summary data..............................................................239Charting on details or formula information ..................................................240

Activity: Charting on detail information........................................................242

Customizing a chart ..........................................................................................243

Editing charts in the Chart Options dialog box ............................................243

Exploring the Appearance tab .................................................................244

Exploring the Titles tab .............................................................................244

Exploring the Data Labels tab ..................................................................245

Fundamentals of Report Design—Learner’s Guideviii

Page 9: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 9/300

Exploring the Legends tab ........................................................................246

Exploring the Gridlines tab ......................................................................246

Exploring the Axes tab ..............................................................................247

Using the zooming features with bar and line charts ..................................247

Auto-arranging a chart......................................................................................248

Activity: Customizing a chart...........................................................................248

Quiz: Representing data visually ...........................................................................250

Lesson summary .......................................................................................................251

Lesson 10

Distributing a ReportLesson introduction...................................................................................................253

Exporting a report .....................................................................................................254

Exporting reports ..............................................................................................254

Exporting formats..............................................................................................254

Exporting destinations ......................................................................................255Exporting a report to application formats .....................................................256

Exporting a report to Microsoft Excel .....................................................256

Exporting a report to Microsoft Word ....................................................256

Saving an export option ...................................................................................257

Activity: Exporting a report to Microsoft Excel.............................................258

Activity: Exporting a report to Microsoft Word............................................261

Saving to BusinessObjects Enterprise ....................................................................264

Viewing requirements in BusinessObjects Enterprise .................................264

Saving a report to BusinessObjects Enterprise ..............................................266

Activity: Saving a report to BusinessObjects Enterprise..............................269

Quiz: Distributing a report ......................................................................................270Lesson summary .......................................................................................................271

Answer KeyDebrief: Planning a report .......................................................................................275

Quiz: Creating a report ............................................................................................276

Quiz: Selecting records .............................................................................................277

Quiz: Organizing data on a report .........................................................................278

Quiz: Formatting a report ........................................................................................279

Quiz: Applying section formatting ........................................................................280

Quiz: Applying conditional reporting ...................................................................281Quiz: Representing data visually ...........................................................................282

Quiz: Distributing a report ......................................................................................283

ixTable of Contents—Learner’s Guide

Page 10: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 10/300

Fundamentals of Report Design—Learner’s Guidex

Page 11: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 11/300

A G E N D A

Fundamentals of Report Design

Introductions, Course Overview...........................................30 minutes

Lesson 1

Planning a Report...................................................................... 30 minutes

❒  Defining database concepts

❒ 

Planning and developing a report prototype

Lesson 2

Creating a Report.......................................................................... 1.5 hours

❒ 

Creating a report

❒  Adding tables

❒ 

The design environment

❒  Inserting objects on a report

❒ 

Previewing a report

❒ 

Saving a report

❒ 

Positioning and sizing objects

❒ 

Formatting objects

Lesson 3

Selecting Records........................................................................ 1.5 hours

❒  Defining the Select Expert

❒ 

Determining the criteria for record selection

❒ 

Understanding saved and refreshed data

❒ 

Applying record selection

❒ 

Setting additional criteria

❒  Modifying record selection

❒ 

Applying time-based record selection

Lesson 4

Organizing Data on a Report.....................................................1.5 hours

❒ 

Sorting records

❒ 

Grouping records

❒ 

Summarizing data

xi Agenda—Learner’s Guide

Page 12: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 12/300

Lesson 5

Formatting a Report...........................................................................1 hour 

❒  Adding graphical elements

❒ 

Combining text objects with database fields

❒ 

Applying specialized formatting

❒ 

Inserting fields with pre-built functions

Lesson 6

Applying Section Formatting.......................................................... 1 hour 

❒ 

Formatting sections

❒  Creating summary reports

Lesson 7

Creating Basic Formulas...............................................................3 hours

❒ 

Defining a formula and its purpose

❒ 

Creating formulas

❒  Applying Boolean formulas

❒ 

Applying If-Then-Else formulas

❒  Applying date calculations

❒ 

Applying numeric calculations

❒ 

Applying string manipulation

Lesson 8

Applying Conditional Reporting...........................................45 minutes

❒ 

Determining trends in data❒ 

Formatting data conditionally

Lesson 9

Representing Data Visually.................................................... 45 minutes

❒ 

Creating a chart

Lesson 10

Distributing a Report................................................................ 30 minutes

❒  Exporting a report

❒ 

Saving to BusinessObjects Enterprise

Fundamentals of Report Design—Learner’s Guidexii

Page 13: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 13/300

About this Course

Course introduction

This section explains the conventions used in the course and in this training guide.

xiii About this Course—Learner’s Guide

Page 14: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 14/300

Course description

Crystal Reports 2008® is a powerful, dynamic, actionable reporting solution that helps you

design, explore, visualize, and deliver reports via the web or embedded in enterprise

applications. This two-day instructor led classroom course is designed to give you

comprehensive skills and in-depth knowledge to plan and create reports that will help youanalyze and interpret information.

As a business benefit, you will find that this course is an in-depth approach to the entire report

creation cycle from planning a report prototype to distributing a report.

Course audience

The Report Processing Strategies course builds on knowledge and skills acquired though

experience using Crystal Reports or from previous courses.

Prerequisites

To be successful, learners who attend this course should have the following experience:

• Windows conventions

• Basic database concepts

Additional education

To increase your skill level and knowledge of Crystal Reports, the following courses are

recommended:

• Crystal Reports 2008: Report Design II - Business Reporting Solutions• Crystal Reports 2008: Report Design III - Report Processing Strategies

Level, delivery, and duration

This core instructor-led offering is a two-day course.

Applicable certifications and designations

This is a core course for the Business Objects Certified Professional - Crystal Reports certification

path.

Fundamentals of Report Design—Learner’s Guidexiv

Page 15: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 15/300

Course success factors

Your learning experience will be enhanced by:

• Activities that build on the life experiences of the learner.

• Discussion that connects the training to real working environments.

• Learners and instructor working as a team.

• Active participation by all learners.

Course setup

Refer to the setup guide for details on hardware, software, and course-specific requirements.

Course materials

The materials included with the course materials are:

• Name card

• Learner’s Guide

The Learner’s Guide contains an agenda, learner materials, and practice activities.

The Learner’s Guide is designed to assist students who attend the classroom-based course

and outlines what learners can expect to achieve by participating in this course.

• Evaluation form

At the conclusion of this course, you will receive an electronic feedback form as part of our

evaluation process. Provide feedback on the course content, instructor, and facility. Your

comments will assist us to improve future courses.

xv About this Course—Learner’s Guide

Page 16: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 16/300

Additional resources include:

• Sample files

The sample files can include required files for the course activities and/or supplemental

content to the training guide.

• Online Help

Retrieve information and find answers to questions using the online  Help and/or user’s

guide that are included with the product.

Learning process

Learning is an interactive process between the learners and the instructor. By facilitating a

cooperative environment, the instructor guides the learners through the learning framework.

Introduction

Why am I here? What’s in it for me?

The learners will be clear about what they are getting out of each lesson.

Objectives

How do I achieve the outcome?

The learners will assimilate new concepts and how to apply the ideas presented in the lesson.

This step sets the groundwork for practice.

Practice

How do I do it?

The learners will demonstrate their knowledge as well as their hands-on skills through the

activities.

Review

How did I do?

The learners will have an opportunity to review what they have learned during the lesson.

Review reinforces why it is important to learn particular concepts or skills.

Summary

Where have I been and where am I going?The summary acts as a recap of the learning objectives and as a transition to the next section.

Fundamentals of Report Design—Learner’s Guidexvi

Page 17: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 17/300

Lesson 1

Planning a Report

Lesson introductionYou need to understand the basic concepts of report design, so you can plan what information

to include on your report.

After completing this lesson, you will be able to:

• Define database concepts

• Plan and develop a report prototype

1Planning a Report—Learner’s Guide

Page 18: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 18/300

Defining database concepts

You need to know where your information is stored and in what form before you can work

out your reporting requirements.

After completing this unit, you will be able to:

• Define database terms

Database terms and definitions

By understanding basic database concepts, you will be better prepared to understand what’s

needed when planning a report.

DefinitionTerm

A database is a bank of data that provides the information for a

report. A database is also referred to as a data source.

Database

A table is a container of information that can hold many pieces of

data, such as records. Tables are stored in databases.Table

In a database, a record is a complete unit of related information. Each

record is made up of one or more fields, and each field can hold one

piece of data (known as a value).

Record

A field is the basic building block of a record. A field can be empty

(NULL) or contain a value.Field

A relational database contains tables that can be linked together based

on the relationship between the fields in two or more tables.Relational database

A report is an organized presentation of data. A comprehensive,

customized, and attractive report can provide management with the

information it needs to run an organization effectively.

Report

A link is a field that is common to two or more tables and that servesas a connecting point between those two tables. Linking means that

Link records are matched up from two or more table(s) and ensures that

all the data in each row of multiple tables refers to the same customer

(transaction, invoice, and so on) on a report.

Fundamentals of Report Design—Learner’s Guide2

Page 19: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 19/300

Planning and developing a report prototype

As a starting point in the report design process, you should outline the information you want

the report to provide.

After completing this unit, you will be able to:

• Determine the layout and content of a report

• Develop a prototype of a report

Report prototype layouts

By taking a systems-oriented approach to reporting and developing a prototype, you will

produce clearer and more readable reports.

Tip:  With the paper prototype in hand, you can put your full effort into learning and using theprogram, rather than trying to design and learn at the same time. For more details on the reportplanning process, see the Crystal Reports User’s Guide.

Developing a report prototype

To develop a report prototype, gather the information on which the report will be based. This

stage of the report planning process, referred to as requirements gathering, consists of the

report designer asking the report requestor a series of targeted questions, sometimes in the

form of a checklist.

After determining the outline of the report request, you develop the prototype by:

• Sketching the report on a blank piece of paper, usually the size the report will be printed

on.

• Filling in a form.

Sketching the report helps if you need to see the report visually; however, a form with all the

categories listed enables you to develop the prototype without missing a section. As well, the

form is more professional than a quickly sketched visual and can be used as a sign-off point

in a report request. Having a list of questions (based on the Report Requirements Checklist)

can also help to keep you on track.

Note:  The Report Requirements Checklist is based on Crystal Reportsterminology. Use thischecklistas a starting point for a version specific to your organization’s needs.

Report Requirements ChecklistYou can use these guidelines to jumpstart the planning process.

• Define the overall purpose of the report.

The purpose statement helps you focus on your primary needs, and it gives the report both

a starting point and a goal.

• Define the readers of the report.

3Planning a Report—Learner’s Guide

Page 20: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 20/300

Plan the report so it includes the information each user is looking for.

• Define the data used in the report.

What type of data source will you need to connect to?

• Determine the report title.

Write out a working title for the report. You may decide to change it later, but at least youwill have a title to use when creating the prototype report.

• Define header and footer identifying information.

Header information typically includes a company logo, a print date, and the title of the

report. Page numbers usually appear in footers.

• Define specific data that should appear in the body of the report.

The body should contain all the data needed to fulfill the statement of purpose you wrote

for the report. It should also contain all of the data needed by the various users that you

have identified.

• Determine if the data is organized into groups.How? By customer? By date? By hierarchy? Or by other criteria?

• Determine if the data is sorted based on record or group values.

Data can be sorted based on a specific record or on a group.

• Determine if the data exists or if it needs to be calculated.

Some report information can be drawn directly from data fields; other information will have

to be calculated based on data field values.

• Determine if the report is to contain only specific records or groups.

You can base a report on all records in a given database, or on a limited set of records from

the database.

• Determine if the data needs to be summarized.

Do you want to total, average, count,or determine themaximum or minimumvalue included

in all the values in any column on the report? Do you want to include a grand total at the

bottom of a selected column?

• Define how to identify key information through formatting options.

What formatting options can be used to highlight key data on a report?

Activity: Developing a report prototypeObjective

• Determine the layout and content for a report and then develop a paper prototype.

Fundamentals of Report Design—Learner’s Guide4

Page 21: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 21/300

Instructions

Work through the scenario to determine the basic requirements of a report. Read through the

scenario and then create a report prototype. You can use the Report Requirements Checklist

as an aid in this activity or sketch the report prototype on a piece of paper.

To build a prototype, determine these requirements for the report:• Purpose

• Audience

• Report title

• Database information

• Header and footer information

• Information to be included in the body of the report

• Groups to be set up

• Information to be sorted in a specific order

• Specific records to be displayed

• Calculations or formulas• Summarized data to be included

• Formatting to highlight specific information

Scenario

You are a new report designer for the Sales team in a bike manufacturing company called the

Xtreme Bike Company. Your first assignment is to create a report that will display orders placed

by each customer of your organization.

The database administrator tells you that the customer information and the order information

are stored in two separate tables in the Xtreme company database. She advises you to use an

ODBC connection to the database.The sales manager tells you that the standard is to use the company logo at the top of the

report as well as a title and a print date that’s labeled. He also tells you that a page number

that’s labeled in the bottom of the report  is the corporate standard as well as the  copyright

information. The main section of the report should contain the customer’s name and city. As

well, the order information should include the  date the order was placed, the amount of the

order, and the order ID number.

For this report, the team needs to see  records selected from the country of the USA and for

2004 only. The customers and the cities should be sorted alphabetically, starting with “A.”

While the report should display USA as the only country group, the only regional groups the

team needs to see at this time are the Western Sales Territory and the Eastern Sales Territory.They are not interested in any other specific groups at this time, so you can tag them as

“Unassigned Regions.” They also want to see information  grouped on the dates that orders

were placed with the order dates sorted with the most recent information first .

The team also needs to see such summarized data as the number of orders for each order date

group. Include the subtotal of the order amount for each order date group as well as a report

grand total for the order amount. As well, include a percentage of the order amount based

5Planning a Report—Learner’s Guide

Page 22: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 22/300

on each month’s subtotal compared to the grand total. The team also needs to see the number

of unique customers.

To highlight key information with specialized formatting options, ensure the order date group

as well as the subtotal and grand total is easily found on the report. Format the column

headings, so that navigating the report is easier. Use two different font styles for the report

title for contrast.

Report Prototype Form

Report Prototype Form

Purpose

Report titleAudience

Database information

FooterHeader

Body of report

Groups

Record selectionSorting 

Calculations or formulas

Fundamentals of Report Design—Learner’s Guide6

Page 23: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 23/300

Report Prototype Form

Summarized data

Key information/Formatting 

Signoff:

7Planning a Report—Learner’s Guide

Page 24: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 24/300

Debrief: Planning a report

1. Why is it important to plan a report before creating it?

Fundamentals of Report Design—Learner’s Guide8

Page 25: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 25/300

Lesson summary

After completing this lesson, you are now able to:

• Define database concepts

• Plan and develop a report prototype

9Planning a Report—Learner’s Guide

Page 26: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 26/300

Fundamentals of Report Design—Learner’s Guide10

Page 27: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 27/300

Lesson 2

Creating a Report

Lesson introductionCreating a basic report using Crystal Reports will help you turn data into information.

After completing this lesson, you will be able to:

• Create a report

• Add tables

• Describe the design environment

• Insert objects on a report

• Preview a report

• Save a report

• Position and size objects• Format objects

11Creating a Report—Learner’s Guide

Page 28: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 28/300

Creating a report

In order to create a report, you must first connect to your database that contains the data you

need.

After completing this unit, you will be able to:

• Describe methods of creating a report

• Choose a data source type

Report creation methods

When you launch Crystal Reports, the Start Page appears at the top of the screen.

The Start Page includes links to recent reports you’ve opened, report creation methods, the

Help system, a search functionality, sample reports, and an update service.

You can create a new report with Crystal Reports using these methods:

• Use one of the Report Wizards provided.

A user who is unfamiliar with Crystal Reports, or someone who is familiar but is rushed,

will find it easier to design a report using one of the Wizards, sometimes referred to as

Experts. You step through the report-building process of a specific type of report when

using an Expert.

Fundamentals of Report Design—Learner’s Guide12

Page 29: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 29/300

• Construct the report manually, piece by piece.

You can custom design a report using this method by starting with a blank report and

building the elements of the report from “scratch.”

• Create a report from another report.

Another quick method to build a report is to create it from an existing report. This existingreport can be used as a template since it may already contain much of the information and

formatting you need. After you open the report you want to use as a template, save it to a

new file using the Save As command on the File menu.

The Start Page also contains dynamic content from Business Objects.

After you select the type of report you want to build from the  Start Page, you choose the data

source you will use to create the report.

Specifying the data source

For any new report you want to create, the first step is to specify the data source.

Regardless of which option you select from the START A NEW REPORT list on the Start Page,

the dialog box that displays will be one of several Data dialog boxes that allow you to specify

the data source from either an existing connection or by creating a new connection.

13Creating a Report—Learner’s Guide

Page 30: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 30/300

If you choose to use a blank report as the basis of your new report, the Database Expert opens

automatically.

The options in the Database Expert are:

•   My Connections

Fundamentals of Report Design—Learner’s Guide14

Page 31: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 31/300

This option shows all data sources that you are currently connected to.

•   Create New Connection

This folder contains a number of subfolders of data source options.

The data you use to create reports in your organization is stored in either a client-server database

such as MS SQL Server, or a PC-type database such as Microsoft Access. You access sourcesthrough either an ODBC layer or directly through native drivers. ODBC stands for Open

Database Connectivity. It is an interface that gives applications the ability to retrieve data in

data management systems.

Note:  Salesforce.com is an on-demand customer relationship management (CRM) company.

A salesforce.com driver included with Crystal Reports allows for access to customer data.

Reports that use a salesforce.com driver refresh when deployed to crystalreports.com.

To connect to an ODBC data source

1. From the Database Expert, select Create New Connection.

2.   Expand the Create New Connection list and locate ODBC (RDO).

3. Click ODBC (RDO) .

15Creating a Report—Learner’s Guide

Page 32: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 32/300

The ODBC (RDO) dialog box opens.

4.   Locate and then click the appropriate data source, and then click Next.

The second window of the ODBC (RDO) dialog box appears, displaying the connection

information needed to log onto the selected data source.

5.   In the Connection Information section of the ODBC (RDO) dialog box, enter your user ID

and password, if required, and then click Finish.

Tip:  In your organization the database may be secure, meaning you might be prompted

for a user ID and password. For this course, the sample database has not been secured.

Fundamentals of Report Design—Learner’s Guide16

Page 33: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 33/300

The Database Expert displays with the connection to the data source highlighted.

17Creating a Report—Learner’s Guide

Page 34: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 34/300

Adding tables

After connecting to your data source, you will add the information upon which the report will

be built.

After completing this unit, you will be able to:

• Add tables to a report

• Describe linking

Adding tables to a report

After selecting the data source, you can add one or more tables to base your report on.

To add tables to a report

1.   From the Database Expert, expand your data source, and then expand  Tables.

2. Select the table you want to add to your report.

3.   Click the > arrow to add it to the Selected Tables list.

4. Click OK.

Fundamentals of Report Design—Learner’s Guide18

Page 35: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 35/300

Linking database tables

If your report contains data from two or more database tables, you will need to link the tables

when creating your reports. Linking requires that you use a field that is common to both tables.

You link database tables so records from one table match related records from another. You

define the linking setup in the Links tab of the Database Expert.Auto Link in the Database ExpertLinks tab automatically chooses links for your tables based

on common fields in tables or indexed fields (if your database supports indexed fields).

Note:   The color flags indicate that these fields are indexed. Indexed fields can increase the speedof data access and reduce the time it takes for the program to evaluate data.

The other options in the Links tab include:

•   Links display area

The display area shows all the tables currently in your report along with links and indexes.

•   Auto-Arrange

When you click this button, the program arranges the tables to fit in the most efficient manner

inside the Links display area.

•   Auto-Link

Use this area to choose a method of linking tables. Click By Name to link tables by their

names or By Key to use foreign key information. Click the  Link button to link tables

automatically (by name or foreign key, as selected).

•   Order Links

19Creating a Report—Learner’s Guide

Page 36: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 36/300

To activate this button, you must have more than two tables available for linking. When

you click the button, the Order Links dialog box appears. Establish the link processing order

you want for the available linked tables.

•   Clear Links

This option removes all the links in the tables.

•   Delete Link

This option removes the selected link.

•   Link Options

This option opens the Link Options dialog box when you click a link line to select it.

•   Index Legend

This option opens the Index Legend dialog box so you can see a key to the index indicators

(arrows) used in the Links display area. The numbering of the index indicators reflects the

sequence in which the indexes were created. If a field is part of several indexes, the index

indicator in front of the field shows the colors of the indexes the field is part of.

To link tables

1. Confirm the tables are linked correctly.

2.   Click OK.

Fundamentals of Report Design—Learner’s Guide20

Page 37: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 37/300

The design environment

The Design window is the environment in which you will create the report.

After completing this unit, you will be able to:

•   Describe the Design window area• Describe toolbars

Understanding the Design window

When creating a report, you begin in the  Design  window, also referred to as the  Design   tab.

The Design tab is where you do most of the initial work when creating a report. It designates

and labels the various sections of the report. You can do the initial formatting; place objects in

the sections where you want them to appear; specify sorting, grouping, and totaling needs;

and so forth.

While working in the Design tab you manipulate “representatives” or placeholders of objects,

not the objects themselves. The Design tab offers faster previewing of information and layout

because you are not working with the actual data itself. When a field is placed on the report,

the program uses a frame to identify the field on the tab; it does not retrieve the data. Thus,

you can add and delete fields and other objects, move them around, set up complex formulas,

and more, without tying up the computer or network resources needed to gather the data.

The report created in the Design tab is a kind of virtual report; it has the structure and

instructions for creating the final report, but it is not the report itself. To turn the Design tab

21Creating a Report—Learner’s Guide

Page 38: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 38/300

report into a final report or into a report that you can fine-tune, you add data. Data adding

occurs whenever you preview the report, print it, or output it in any other way. The actual data

appears in the report.

When you begin creating a report, Crystal Reports automatically creates five areas or sections

in the Design window.

•   Report Header

This section is used for the report title and other information you want to appear at the

beginning of the report. It can also be used for charts and cross-tabs that include data for

the entire report. Items placed in the Report Headerprint only on the first page of the report.

Often the name of the report, the print date, company logo, or “title page” information is

included in the Report Header.

•   Page Header

This section is used for information that you want to appear at the top of each page. This

can include such things as chapter names, the name of the document, and other similar

information. This section can also be used to display field titles above the fields on a report.

Objects in the Page Header print at the top of every page of the report. Column headings,

print dates, and page numbers are common entries in the Page Header.

•   Details

This section is used for the body of the report and is printed once per record. The bulk of

the report data appears in this section. Place the data fields on which you want to report in

this area. This information (database fields and text) prints for every record selected on the

report.

•   Report Footer

This section is used for information you want to appear only once at the end of the report(such as grand totals) and for charts and cross-tabs that include data for the entire report.

Items placed here print only on the last page of the report. Grand totals, total number of

pages, and other summary information are often placed here.

•   Page Footer

Fundamentals of Report Design—Learner’s Guide22

Page 39: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 39/300

This section usually contains the page number and any other information you want to appear

on the bottom of each page. Objects placed here print at the bottom of every page. Page

numbers are often placed in the Page Footer.

Note:  The names of the five areas can also be shortened to their abbreviated forms (RH, PH, D, RF,

and PF). You set the Short Section Name option in the Design View area of the Layout tab in the

Options dialog box from the File menu. You can also set this option by right-clicking on one of thesection names and selecting Show Short Section Names from the shortcut menu.

Each section is indicated by a section boundary. These lines indicate the separation of the areas

and do not print to paper.

You can move these bars to change the amount of space reserved for each section. You click

and drag the section divider to the desired position; however, you can drag the bottom line

only to affect the size of the section.

Working with toolbars in the Design window

The Report Designer window includes several toolbars. Crystal Reports groups several

commonly used commands on a toolbar that remains on screen at all times unless you choose

to turn it off using the Toolbar command on the View menu.

The toolbars are:•   Standard

This toolbar contains several commonly used commands.

•   Formatting 

This toolbar contains commands for formatting the selected field.

•   Insert Tools

23Creating a Report—Learner’s Guide

Page 40: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 40/300

This toolbar provides quick access to advanced report enhancing features.

•   Expert Tools

This toolbar provides quick access to many advanced experts.

•   Navigation Tools

This toolbar provides buttons for refreshing a report’s data and for moving around thereport.

•   External Command

This toolbar is where organizations can access custom applications or plug-ins that they

have created for Crystal Reports.

Note:   The ability to customize Crystal Reports by using Add-ins in the Report Designer allowsreport developers to extend the functionality of the application. This customization can includeapplication-specific toolbars, branded billboards, splash screens, and launching of other applications.This flexibility provides opportunities to customize CrystalReports to your company's specifications.

The toolbars are floating toolbars. You can position them on any of the four sides of the screen,or float them on your design area. Each toolbar displays an icon that visually describes the

command it represents. You activate a toolbar command by clicking the appropriate icon.

To move a toolbar, click and hold in an unused part of the toolbar, between groups of buttons,

or on the unused area at the beginning or end of the toolbar. Drag the entire toolbar to the

desired location. As you approach the edge of the screen, the toolbar automatically stretches

to match that side.

The toolbar eliminates some of the steps needed to activate a command, increasing the speed

with which you create reports.

Tip:  If you are not sure about the function of a button on the toolbar, place the pointer over the

icon and hold it there until a tooltip appears.

Fundamentals of Report Design—Learner’s Guide24

Page 41: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 41/300

Inserting objects on a report

To create a report, you need to place information on the report.

After completing this unit, you will be able to:

•   Describe the Field Explorer• Describe the Report Explorer

•   Describe the Repository Explorer

•   Describe the Workbench

• Determine data field type

Working with the Field Explorer 

Database fields, formula fields, lines, and boxes are examples of the types of objects you can

place, move, and resize on your report. You access and insert these objects onto the report from

the Field Explorer.

Use the Field Explorer to insert, modify, or delete fields on the Design and Preview tabs. You’ll

see the Field Explorer after you have:

• Clicked the Field Explorer button on the Standard toolbar.

•   Selected the Field Explorer from the View menu.

The Field Explorer displays a tree view of database fields and special fields that you can add

to your report. It also shows formula fields, SQL expression fields, parameter fields, group

name fields, and running total fields that you have defined for use in your report.

You can dock the Field Explorer dialog box. In free-floating mode, drag the  Field Explorer to

any location. Alternately, dock the Field Explorer as a tab, similar to the  Design tab.

The Field Explorer’s toolbar offers these functions:

•   Insert to Report

25Creating a Report—Learner’s Guide

Page 42: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 42/300

Use this option to add a field to the report. You can insert more than one field at a time by

selecting multiple fields, right-clicking, and choosing Insert to Report.

Alternatively, to insert a field, you can drag and drop it in the Design or Preview tabs.

•   Browse

Use this option to browse data for a database field, formula field, or SQL expression field.•   New

Use this option to create a formula field, SQL expression field, parameter field, or running

total field.

•   Duplicate

Use this option to make a copy of the formula that you have selected in the Field Explorer.

Once the copy is created you can rename and edit it.

•   Edit

Use this option to modify an existing formula field, SQL expression field, parameter field,

or running total field.•   Rename

Use this option to modify the name of an existing formula field, SQL expression field,

parameter field, or running total field.

•   Delete

Use this option to remove a formula field, SQL expression field, parameter field, or running

total field. You can also select multiple fields, right-click, and choose Delete to remove them

all at once.

Tip:   Each button on the Field Explorer’s toolbar has an associated shortcut option that’s displayed

in the tooltip.

To insert fields onto a report

1.  On the Standard toolbar, click Field Explorer.

Fundamentals of Report Design—Learner’s Guide26

Page 43: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 43/300

The Field Explorer dialog box appears. To speed the report building process, this dialog

box remains on screen until you close it. You can move this dialog box wherever you want.

2. Expand the Database Fields folder to see all the tables chosen from the database(s).

3. Expand the individual tables to see all the fields they contain.

4. Select the field you want to appear in the report.

5. Click Insert to Report and then click to place it in the report.

Tip:   You can insert more than one field at a time by selecting multiple fields, right-clicking,

choosing Insert to Report, and then clicking in the report to place them. You can also drag

and drop fields to add them to the report. You can right-click the field in the Field Explorer

to invoke a shortcut menu that displays the Insert to Report option.

After you place a field onto a report, a check mark appears on the field in the Field Explorer.

Working with the Report Explorer 

The Report Explorer appears when you select the  Report Explorer command from the View

menu, or when you click the Report Explorer button on the Standard toolbar. The Report

Explorer displays a tree view of the sections in your report and lists the report objects contained

in each section and works like a “report navigator.” You can work with report objects directly

from the explorer.

The Report Explorer's toolbar provides buttons that let you expand or collapse your report's

tree view and choose the report items to display by type:

•   Expand

Use this option to expand all child nodes of the tree view under the selected node. If you

select this option while the root node is highlighted, all remaining nodes are expanded. If

you select this option while a child node is highlighted, only the nodes that are part of the

child are expanded.

27Creating a Report—Learner’s Guide

Page 44: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 44/300

Note:  This option has no effect if selected while a report object is highlighted, or if the

selected node has no children.

•   Show/Hide Data Fields

Use this option to show or hide data fields in your report. Data fields include formula fields,

summary fields, and text objects.•   Show/Hide Graphical Objects

Use this option to show or hide graphical objects in your report. Graphical objects include

charts, maps, boxes, lines, BLOB fields, and OLE objects.

•   Show/Hide Grids and Subreports

Use this option to show or hide cross-tabs, OLAP grids, and subreports in your report.

You can dock the Report Explorer dialog box. In free-floating mode, drag the Report Explorer

to any location. You can also dock the Report Explorer as a tab, similar to the  Design tab.

The content of the Report Explorer represents the content of the report in a tree view. The root

node is the report itself, while the first-level nodes represent the report's sections.

Within each section, the report's fields and objects are listed. Any item you select in the tree

view will be selected in the report (in either  Design or Preview modes).

You can modify report fields and objects by selecting them in the Report Explorer. When you

right-click the selected item, you see a menu that contains the actions you can carry out on the

item.

For example, if you right-click a text object, the menu contains the options to edit the text, toformat its font or color, and so on. Likewise, if you right-click a section node, the menu contains

the options to hide, suppress, format, and so on.

Fundamentals of Report Design—Learner’s Guide28

Page 45: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 45/300

Note:

• You can select multiple fields for formatting by using Ctrl-click; however, you cannot add

additional fields or report objects when using the Report Explorer, but you can delete them.

• Items connected to a BusinessObjects Enterprise Repository are shown with the repository

icon beside them.

• Items with hyperlinks are shown as blue text with a solid underline. Items with Report Part

hyperlinks are shown as green text with a dashed underline. These indicators are availableif you are using a Microsoft Windows operating system only.

• You can use the openDocument function to create hyperlinks to other types of reports (for

example, Web Intelligence reports).

To use the Report Explorer 

1.   Click the Report Explorer icon on the Standard toolbar.

29Creating a Report—Learner’s Guide

Page 46: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 46/300

The Report Explorer appears.

2. Right-click the field you want to format and select the option you want to apply from theshortcut menu.

3. Apply the changes.

Working with the Repository Explorer 

The repository is the central location for you to store and manage your report objects. These

objects are accessible to users and report developers for use in new reports. Physically, the

repository is a database that stores supported object types:

• Text objects

• Bitmaps• Custom functions

• Commands (queries)

• List of Values

Fundamentals of Report Design—Learner’s Guide30

Page 47: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 47/300

The Repository Explorer’s toolbar provides buttons that let you add new folders, search for

items, and so on:

•   Change view settings

Use this option to open the View Settings dialog box. Use this dialog box to limit the typeof repository items displayed in the Repository Explorer. You can also select options to sort

multiple items by name or by type.

•   Advanced filtering 

Use this option to display filtering options at the bottom of the  Repository Explorer. Use

these filters to find specific items by words from the Name or Author fields in the Add Item

dialog box.

Note:  Text entered in the filtering fields of this option is not case sensitive.

•   Delete the item/folder

Use this option to permanently remove the selected item or folder from the repository. Whenyou delete a folder, you delete all the items it contains.

•   Insert a new folder

Use this option to add a new folder to the repository.

•   Logon/Logoff

Use this option to log on/off the repository in BusinessObjects Enterprise.

Note: If you aren’t logged on, a no server connection message is displayed in the Repository

Explorer.

Tip:  Hover your mouse’s cursor over any object in the Repository Explorer to see a tooltip. Tooltipsfor text objects and bitmaps include Author and Description information as well as the completetext of the SQL statement.

By maintaining a shared repository of report objects, you can modify a particular object and

update all reports containing that object as they are opened for use. A central location for report

objects also helps with the task of managing your data—an important benefit in maximizing

productivity and minimizing costs at your company.

The BusinessObjects Enterprise Repository is contained in BusinessObjects Enterprise.

Depending on the version of Crystal Reports you have, you can install a version of

BusinessObjects Enterprise to access the repository.

You can dock the Repository Explorer dialog box. In free-floating mode, drag the RepositoryExplorer to any location. You can also dock the Repository Explorer as a tab, similar to the

Design tab.

To open the Repository Explorer 

1.   Click the Repository Explorer icon on the Standard toolbar.

31Creating a Report—Learner’s Guide

Page 48: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 48/300

Tip:  Another way to do this is to click the Repository Explorer option under the View

menu.

2.   If you’re not logged onto the repository in BusinessObjects Enterprise, click the Logon button

on the toolbar in the Repository Explorer.

The Log On to BusinessObjects Enterprise dialog box opens.

3.   Enter the appropriate information into the System, User name, Password, and

Authentication text boxes.

4.   Click OK.

The Repository Explorer appears, displaying the contents of the repository.

5. Expand the top node to see the repository contents, if required.

Fundamentals of Report Design—Learner’s Guide32

Page 49: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 49/300

Working with the Workbench

The Workbench is a folder structure that can represent the type of projects you work on. In

the Workbench, you can create projects (folders) that contain one or more reports. For example,

if you are a report designer in the financial department of an organization, you could have

separate folders for Accounts Payable and Accounts Receivable.Use the options on the toolbar to add, remove, or rename folders, reports, and object packages.

You can reorganize the files in a folder or folders by dragging and dropping them where you

want them to appear. You can also drag report files from Windows Explorer and drop them

into the folder of your choice in the Workbench.

The Workbench includes a toolbar:

•   Add

Use this option to add a new object to the Workbench:

○   Add Existing Report or Add Current Report

When you select this option, the Open dialog box appears so that you can search for a Crystalreport that you have previously created.

○   Add New Project

When you select this option, the program adds a new folder under the root node that is

called Workspace. You can add reports to this folder. Project folders offer a way to organize

the reports in the Workbench.

○   Add Object Package

When you select this option, the program prompts you to log onto your BusinessObjects

Enterprise system. When you have connected to your system, you can choose an object

package to add to the  Workbench.

•   Open

Use this option to open the report or report package that you have selected in the Workspace

folders.

•   Check Dependencies

Use this option to initiate the Dependency Checker, a method of checking for errors in a

report. The option is available for individual reports or for folders of reports. Crystal Reports

begins checking the report(s) immediately and displays the results in the Dependency

Checker.

You can right-click any item in the workspace area of the  Workbench to see a shortcut menu.

Many of the options that are available on the shortcut menu are also available on the toolbar.This section describes only the additional options that are not available on the toolbar.

•   Rename

Use this option to rename a folder in the Workspace area.

•   Remove

Use this option to remove a report, report package, or folder from the  Workspace area.

33Creating a Report—Learner’s Guide

Page 50: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 50/300

Note:

• You cannot undo this option.

• When you remove a folder, you remove all of the items in it at the same time.

•   Publish to BusinessObjects Enterprise

Use this option to publish a folder of reports to BusinessObjects Enterprise. You can publishyour reports individually or as an object package. (Object packages can be scheduled in

BusinessObjects Enterprise as a single entity.) When you choose this option, the Publish

Object dialog box appears.

To add a new project to the Workbench

1.   Click the Workbench button on the Standard toolbar.

The Workbench appears.

2.   Right-click Create a new project in the workspace of the  Workbench, point to Add, and

then click Add New Project.

An untitled folder appears.

3. Enter a name for the project, and then click in the white space area of the workspace to set

the project folder.

Fundamentals of Report Design—Learner’s Guide34

Page 51: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 51/300

To add a report to the Workbench

1.   Click the project folder in the Workbench.

2. From the Add menu, click Add Existing Report.

3.   Locate the report you want to add from the Open dialog box, and then click Open.

The report is added to the folder.

Determining data field types

You can take a look at a sample of the actual data in the table before you place the field on your

report in the Browse Field Data dialog box.

To browse field data

1. Select the field.2.   From the Field Explorer, click Browse.

The Browse Data dialog box opens.

3. Scroll through the list.

4. Click Close when finished.

35Creating a Report—Learner’s Guide

Page 52: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 52/300

Note:  The default setting is either to display the first 500 records or to time out at five

seconds, depending on what has been set up. If you have large tables with more than 500

records, you will not see examples of all the data contained in the fields.

Tip:  You can also browse the field data in the database tables after you place the field on

the report by right-clicking the field and selecting Browse Field Data from the shortcut

menu.

Fundamentals of Report Design—Learner’s Guide36

Page 53: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 53/300

Previewing a report

When you create a new report, you begin in the Design tab. You can view the report in the

Preview tab to see the results of your design. Once in the Preview tab, you can evaluate the

formatting and layout of your design.

After completing this unit, you will be able to:

• Describe the methods of previewing a report

• View a report

•   Explain the differences between working in the Design and Preview tabs

• Describe page controls

• Describe the status bar

Previewing reports

Once you have placed data fields on your report, you are ready to preview your design. The

methods to switch to the Preview window are:

• Click the Print Preview button on the Standard toolbar.

•   Click the HTML Preview button on the Standard toolbar to see an HTML rendering of your

Crystal report as it will appear when published to the web.

•   Click the Refresh button to the far right of the Report Designer’s screen.

Tip:   The area at the bottom of the Report Designer environment is called the page controls

area, which shows you the date and time that the data was last refreshed.

The program gathers the data, makes the necessary calculations, and displays the report in the

Preview tab. With the data in place, you can review the spacing and formatting of your report

and see the actual results of all your summaries, formula calculations, and record and groupselections.

The program works with data in this manner:

•   The first time the Preview tab is used, it retrieves data from your underlying data source(s)

and saves it with the report (unless you have set up the program not to save data).

• From that point on, the program uses the saved data whenever you preview the report

unless you specifically refresh it or add a field that requires the program to retrieve new

data.

When you save data with a report, the data is saved in a cache file with the report on the

client machine.

Note:  You retain full design capabilities in the Preview tab.

When you need to make sure that your report design is appropriate and correct over the web

in a zero-client environment, the  HTML Preview option lets you see an instant rendering of

your report to HTML without leaving the Crystal Reports design environment. Unlike the

Preview tab, which shows the true report format, the HTML Preview tab shows a converted

format. By switching between the two tabs, you can make adjustments in your report design

to yield the best results on the web.

37Creating a Report—Learner’s Guide

Page 54: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 54/300

In the case of reports that are published to BusinessObjects Enterprise (managed reports), you

don’t have to do any special configuration to make the  HTML Preview feature work.

For stand-alone reports (unmanaged reports), the program must use a stand-alone ReportApplication Sever (RAS) to generate the preview. In this case, you need to configure the HTML

Preview feature. Do this in the  Servers tab of the Options dialog box in Crystal Reports.

If you open a large report in HTML Preview, a progress indicator displays. Once the report is

open in HTML Preview, you will see a stationary group tree to the left of the report and a

stationary toolbar above the report. You can use the group tree and toolbar to navigate from

one page of the report to another without scrolling up and down. The  HTML Preview also

displays the page margins so you know what the report will look like if it is printed.

Viewing a report

Crystal Reports provides two views for previewing a report:

•   Standard view

•   Preview panel

Standard view

In the standard view, the report is displayed one page at a time.

Fundamentals of Report Design—Learner’s Guide38

Page 55: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 55/300

Using the navigation buttons in the Preview tab, you can move to the beginning or end of the

report, or you can move backward and forward through the report one page at a time.

For shorter reports or reports in which you're primarily interested in seeing the “bottom line”

totals, the standard view provides all of the functionality you need.

Preview panel

You can display or hide the Preview panel using Toggle Preview Panel on the Standard toolbar.

The Preview panel view presents a split screen:

• The right pane displays the report.

• The left pane displays a high-level outline of the report, showing the hierarchy of groups

and subgroups in a familiar tree format.

The Preview panel typically displays the names of the groups and subgroups you created in

your report. You can, however, customize these names using the Options tab of the  Insert

Group or Change Group Options dialog box.

When you click the tree node for the group that interests you, the program jumps immediately

to the part of the report that contains the information for that group. For longer reports or

reports in which you want to jump back and forth between different groups, the navigation

features of the Group Tree view make your work extremely efficient.

39Creating a Report—Learner’s Guide

Page 56: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 56/300

Zooming in and out

Zooming enables you to move from a full-page view to a zoom between 25% and 400% as well

as the Whole Page and Page Width options. Taking a “bird’s-eye view” of your report gives

you an idea of the overall layout of your report, letting you see if graphics are positioned

properly, and so on. Zooming in at a high magnification level lets you focus on the finer details

of your report. Magnification factors can be set to different percentages in the Design and

Preview tabs.

Page controls

Page controls enable you to move forward or backward through the report one page at a time,

to move to the first or last page, to cancel the printing of the report, and to close tabs.

The Data Age indicator indicates the date the data was last refreshed or initially retrieved,

whichever is the most recent. If the data was initially retrieved or refreshed today, it indicates

the time it happened.

The status bar 

The status bar is found at the bottom of the Design tab and displays the selected field name,

its position on the report, and how many records were returned. When you hover your cursor

over a button on the toolbars, the status bar displays a tooltip.

You can show or hide the status bar by using the  Status Bar command on the View menu. By

default, the status bar is shown (a check mark appears beside the command on the menu).

Working in the Design and Preview tabs

Often, you will find it easier to work in the  Design tab when working with multiple sections

and areas. You may sometimes want to work in the Preview tab where you can see the effects

of your changes instantly and how the report will be printed.

You have the same formatting capabilities in the  Preview tab as you do in the Design tab.Menus (both menu bar and shortcut menus) and toolbars remain active, providing essentially

the same functionality you have when working with a report in the  Design tab. However,

when you are making numerous changes, it is quicker to make the changes in the Design tab.

Some additional things to consider are:

• The Design tab and Preview tab are tied together internally. Any changes made in one are

reflected in the other.

Fundamentals of Report Design—Learner’s Guide40

Page 57: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 57/300

•   The Preview tab has a single vertical ruler at the left of the tab rather than the individual

section rulers seen in the  Design tab. The functionality of the ruler is the same.

•   The Preview tab identifies report sections in the shaded area to the left of the data. With a

quick look you can tell which report section the data is printing from. While section names

appear only once in the Design tab, they print each time a section prints in the Preview tab.

• The record counter, the Data Age indicator, and the Page Forward/Page Back controls areall active in the Preview tab.

•   The Preview tab highlights every value when you select a field, whereas, only the field

frame is highlighted in the  Design tab.

Working in the Preview tab has a different feel from working in the  Design tab. Each field in

a database contains dozens, hundreds, or even thousands of values, depending on the number

of records in the database. When you place a field in the Design tab, a single field frame

represents all those values. When you highlight the field, sizing handles appear on the frame

and the frame changes color.

In the Preview tab, however, you are working with the actual data. Instead of a field frame

representing many field values, the values themselves appear. When you highlight a field orformula field value, you are actually selecting every value in the field:

• The program places a sizing frame around the specific value you select.

• It highlights every other value in the field.

Aside from the differences in appearance, the process of building and modifying a report is

the same in both the Design tab and the Preview tab.

Tip:  When working in the Preview tab, remember that each change you make may require extratime to process because you are working with the actual data, not just the placeholders (as in theDesign tab).

41Creating a Report—Learner’s Guide

Page 58: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 58/300

Saving a report

You can add information to better describe the report and then save your report to a number

of options in the Save dialog box.

After completing this unit, you will be able to:

• Add summary information

• Save a report

• Check a report for errors

Adding summary information

You can save summary information with the report. Summary information contains such things

as the report author, report title, and comments.

There may be times when you want to include non-printing comments with a report (a personal

note to the report recipient, a note to explain more thoroughly the data on which the report isbased, a report title, or a comment about some particular data on the report).

Summary information provides a facility for including anything from a short note to hundreds

of lines of text with your report. The comments do not print with the report; they remain in

the Summary tab of the Document Properties dialog box where they can be reviewed on

demand.

To add summary information

1.   Select File ➤ Summary Info.

The Document Properties dialog box appears with the  Summary tab active.

Fundamentals of Report Design—Learner’s Guide42

Page 59: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 59/300

2.   Enter the desired information and click OK when finished to return to your report.

Saving a report

The saving function is the same in Crystal Reports as in many other applications. The Open,

Save,and Save As dialog boxes enable you to open or save a report conveniently to personalizedfolders that are created by your operating system. If one of these folders does not exist on your

machine, the corresponding button will not be displayed.

The personalized folders are:

•   DesktopThis folder contains the contents of your Windows Desktop.

•   My Documents

This folder typically contains the History, My eBooks, and My Pictures folders.

•   Favorites

This folder contains your frequently-accessed files.

•   CR.COM

Crystalreports.com is a report-sharing service that you can use to distribute your reports

over the Web, instead of by email or hard copy.

•   Enterprise

If your company has deployed BusinessObjects Enterprise, a web-based report management

tool, you can log onto the system so you can view the reports stored on the Enterprise system.

•   My Connections

This folder shows a list of data sources to which you are connected.

43Creating a Report—Learner’s Guide

Page 60: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 60/300

Saving a preview of a report

You can save the first page of a report as a preview or “snapshot” of a report so that you can

view the report when opening it. You can also preview a sample of the data.

Some considerations include:

• You must preview the report before a snapshot can be taken.

•   The snapshot is only updated when you preview. If you turn on the feature in the Design

tab, but do not preview, the snapshot will not be taken. Also, if you modify the report in

the Design tab, and save the report but do not preview, the snapshot will not be updated.

• Because the snapshot is saved in the report file, the addition of the preview picture may

increase the size of the file.

To save a snapshot of a report

1. Preview the report.

2.   Select File   ➤ Summary Info.

The Document Properties dialog box opens.

3.   In the Summary tab of the Document Properties dialog box, select the Save Preview Picture

check box, if required.Note:   The Save Preview Picture check box is active by default.

4.   Click OK.

Fundamentals of Report Design—Learner’s Guide44

Page 61: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 61/300

To preview the snapshot

1.   Click File ➤ Open.

2.   Click the Preview button (last button on the toolbar).

3. Click the report you want to preview.

You will see a snapshot of the first page of the report.

Checking a report for errors

The Dependency Checker appears when you check a report or project for errors in the

Workbench, or when you select the command on the  Report menu for a report that you have

open in Crystal Reports. The Dependency Checker registers several types of errors:

• Report part hyperlink errors

• Repository object errors

• Formula compilation errors

You can use the Dependency Checker on an opened report in the Report Designer, or you

can select a report in the Workbench to check for errors.

Errors listed in the Dependency Checker show the following information:

• Error type

MeaningIcon

Success. The Dependency Checker has

verified that there are no errors in the file.

45Creating a Report—Learner’s Guide

Page 62: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 62/300

MeaningIcon

Warning. The Dependency Checker has

found something in the file that might be a

problem. You can verify thewarning, but you

don’t have to fix it to have the report runcorrectly.

Error. The Dependency Checker has found

an error that you must fix so that the report

will run correctly.

• Description of the error

• Location of the file that contains the error

Double-click an error to open the target report and go to the report object so that you can fix

the problem. If the report object cannot be found (because, for example, you’ve deleted part of

the report since checking for errors), you receive a message that recommendsyou run the check

again.

When you right-click a message in the Dependency Checker, a shortcut menu appears with

these options:

•   Go To

Use this option to open the report that contains the error and to go to the object that is

causing the problem. You can also select a message and press Enter or double-click to open

the report.

•   Sort ByUse this option to sort the messages by type, number, description, or location.

•   Clear

Use this option to remove the selected message.

•   Clear All

Use this option to remove all of the messages.

•   Copy

Use this option to copy the message to the clipboard so that you can paste it into another

application.

•   Options

Use this option to open the Dependency Checker tab of the Options dialog box. Use this

tab to select the conditions that you want to check for when you run the  Dependency

Checker.

Fundamentals of Report Design—Learner’s Guide46

Page 63: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 63/300

To check a report for errors using the Dependency Checker 

1.   Select a report or project in the Workbench.

2.   Click the Dependency Checker button on the Workbench toolbar or on the Standard toolbar.

A status message appears in the Dependency Checker.

3.   If an error occurs, right-click the message and select Go To to open the report that contains

the error and to go to the object that is causing the problem.

Tip:  You can also select a message and press Enter or double-click to open the report.

Activity: Creating a report

Objective

• Create a report from a blank report by using the Customer table and Orders table from the

Xtreme Sample Database (via an ODBC data source).

Instructions

1. Create a report by using the Blank Report option on the Start page.

2.   Add the Customer table and the Orders table.

3. Add these database fields in the report:

•   Customer Name

•   City

•   Region

•   Order Amount•   Order ID

•   Order Date

4. Once you have placed your data fields onto your report, preview it.

5. Delete the print date and page number that appear by default.

47Creating a Report—Learner’s Guide

Page 64: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 64/300

6.   Open the Report Explorer. notice the objects listed in the  Report Explorer that appear on

your report.

7.   Change the magnification in the Preview tab with the toobar button.

8.   Click Zoom to further explore the magnification options.

9. Add summary information (Report Author, Comments) and save a snapshot.10.Save the report as Creating a report.rpt to My Documents.

Note:  Save all subsequent activity reports to My Documents.

11.Create a project called Report Design I in the Workbench.

12.Add the newly created report into this project folder.

Note:  Add all subsequent activity reports to this project in the  Workbench.

13.Check the report for errors by using the Dependency Checker.

Your report should look similar to this example in the  Preview window.

Fundamentals of Report Design—Learner’s Guide48

Page 65: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 65/300

Positioning and sizing objects

Once you have placed fields and objects on your report, you may want to reposition or resize

them. You can reposition and resize objects from either the Design or the Preview tab.

Tip:  Positioning and sizing objects is easier in the  Design tab because you are moving only

the placeholder rather than the representative data.

After completing this unit, you will be able to:

• Position objects using a grid

• Position objects using guidelines

• Position objects using free form placement

• Lock an object’s position and size

• Move objects

• Align objects

• Resize objects

• Cut, copy, and paste objects

Positioning objects using a grid

Different reporting needs require different methods of positioning objects on your report. The

default setting in Crystal Reports is  Snap to Grid.

A grid is an imaginary series of vertical and horizontal lines across your working area, much

like graph paper. A series of dots can be displayed on the Design area, each one marking the

intersection of a vertical and horizontal gridline.

49Creating a Report—Learner’s Guide

Page 66: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 66/300

When using Snap to Grid, your objects are placed at a gridline. As you move objects around,

they “snap” from gridline to gridline. This functionality makes it easy to line up objects both

horizontally and vertically.

The Grid display and Snap to Grid on/off options are independent of each other. You also

can choose to see the grid in both the  Design and Preview windows.

To select the grid display option

1.   Click File   ➤ Options   ➤ Layout.

The Options dialog box appears.

2. Select the Grid check box to visually display the grid in the  Design tab.3.   Confirm that Snap to Grid is selected to have objects align automatically.

Tip:  You can also right-click over a blank area of the report window, and then access the

Snap to Grid from the shortcut menu.

4. Click OK.

Fundamentals of Report Design—Learner’s Guide50

Page 67: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 67/300

Positioning objects using guidelines

If you want to line objects up with one another, you can insert a guideline and attach the objects

to it. Then, in one step, you can move the guideline to reposition all the objects attached to the

guideline.

When the Guidelines check box is selected, Crystal Reports automatically places a vertical

marker in the ruler for each field you place in the Details area. These markers or “handles” let

you move the fields and their column headings horizontally on your report at the same time

by moving the guideline arrowhead.

Tip:  Remember that guidelines are visible in both the Design and Preview windows only if youhave the Show Guidelines in Design and Show Guidelines in Preview check boxes selected under

File   ➤ Options   ➤ Layout. The guideline handles will not appear in the Preview tab unless youselect an object on the report.

When you click a field to move or resize the object, tracker guidelines appear, aligning the

object against the horizontal and vertical rulers to let you clearly see the placement.

Caution:  You can have as many guidelines as you want, but beware of “guideline clutter.” If youfind yourself with many guidelines on your report, objects can be attached at both ends. In this case,if you move a guideline, any object attached to it will be stretched because the other side is anchoredby the other guideline.

To select the guidelines option

1.   Click File ➤ Options.

51Creating a Report—Learner’s Guide

Page 68: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 68/300

The Options dialog box appears.

2.   Click the Layout tab, if not visible.

3. Select the Guidelines check box in the Design (or Preview) area, and then click OK.

To create guidelines

1. Click in either the vertical or horizontal ruler.

A small triangle (arrowhead) displays pointing to the  Design window with a dashed line

extending from it to the opposite side of the Design area. Objects dragged to this guideline

“attach” themselves to it, ensuring that all objects are lined up together.

2. Attach all the objects that you want to manipulate then drag the guideline arrowhead to

move all the objects together.Note:  Clearing the Guidelines check box in the Options dialog box causes your guidelines

to disappear within the Design window. However, the arrowheads still show in the ruler

lines so you can still move objects that are attached to the now invisible guideline.

Fundamentals of Report Design—Learner’s Guide52

Page 69: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 69/300

To remove an object from a guideline

1. Drag the object away from the guideline.

To remove a guideline

1. Drag the guideline arrowhead in the ruler away from the Design window.

Removing a guideline is similar to removing a tab from a word processor ruler line.

To remove all guidelines

1.   Right-click the guidelines and select Remove All Vertical Guidelines or Remove All

Horizontal Guidelines from the shortcut menu.

Positioning objects using free-form placement

If you turn the gridlines and Snap to Grid off, you have the freedom to place objects anywhere

on the Design window you want. Objects can even be placed offset from one another.

Tip:  For the examples and activities in this training guide, keep Snap to Grid selected. You canchoose to show the grid or not.

Locking an object’s position and size

You can lock the position of the selected report object so it can’t be moved. When you set this

option, you cannot drag the object in the Report Designer and the Size and Position command

becomes inactive.

To lock an object’s size and position

1. Select the object whose size and position you want to lock.

2.   On the Formatting toolbar, click Lock Size/Position.

Moving objects

You need to select an object before you can move or resize it.

In the Design tab, you can select lines and boxes with other objects such as text, fields, charts,

maps, OLAP grids, cross-tabs, and OLE objects.

In the Design and Preview tabs, you can select multiple objects such as text, fields, charts,

maps, OLAP grids, cross-tabs, and OLE objects.

53Creating a Report—Learner’s Guide

Page 70: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 70/300

Some of the operations deal with the concept of the main object, the last object you select.

Certain limitations apply in certain operations:

• If the new location of a multiple objects selection does not accommodate all the selected

objects, then the main object and those that can be accommodated will be moved. The other

objects will remain in their original locations. However, if the new location does not

accommodate the main object, then no object will be moved.The Move submenu includes these commands:

•   Backward

When youhave multiple objectsin a stack, use the Backward command to move the selected

object backward (down) one layer in your stack. In order to access an object you have moved

backward, you can move objects that are above it out of the way or move those objects

backwards.

•   To Back

When you have multiple objects in a stack, use the To Back command to move the selected

object to the bottom of the stack.

•   Forward

When you have multiple objects in a stack, use the Forward command to move the selected

object forward (up) one layer in the stack.

•   To Front

When you have multiple objects in a stack, use the To Front command to move the selected

object to the front (top) of the stack.

To select a single object

1. Click the object once to activate the handles.

To select multiple objects

1. Ctrl-click each object in succession.

You can also right-click the section and click Select All Section Objects from the shortcut

menu.

To move a single object

1. Click the object once to activate the handles.

2. Move your cursor over the object until the four-way cursor appears.

3. Click and drag the object to a new position.

Fundamentals of Report Design—Learner’s Guide54

Page 71: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 71/300

To move multiple objects with the four-way cursor 

1. Select the objects.

2. Click the first object once to show its handles, then hold down the Ctrl key on your keyboard

and click the other objects.

As you do this, handles appear on all the objects

3. Once you have selected all desired objects, release the Ctrl key, and then click and hold on

any of the selected objects.

The four-way cursor appears as you drag the objects to a new position.

To select multiple objects with a marquee or lasso

Tip:   Clear any selected objects before using the marquee or lasso by clicking in the white section

of the Design tab before you draw the lasso.

1. Using the cursor, click and hold to draw an imaginary box around the objects you wantselected.

When you release the mouse, all objects partially surrounded by the marquee are selected.

2. Once you have selected multiple objects, click and hold on any of the selected objects and

drag the objects to a new position.

3. Once your objects are in their new position, click an unused area of the Design window to

clear your object selections.

To move multiple objects with a guideline

When you placed your database fields into the Details area, the fields were attached toguidelines. You can move all fields attached to a guideline by grabbing the guideline arrowhead

and moving it to a new position.

1. Create a new guideline by clicking in either the horizontal or vertical ruler bar with the

cursor.

2. Drag objects to that guideline to attach them to the line.

3. Once all objects are attached, you can move the guideline arrowhead to move the objects.

This method is handy when you want to move objects or line them up.

To move objects in a stack

1. Right-click an object, point to Move, and then click the appropriate command.

55Creating a Report—Learner’s Guide

Page 72: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 72/300

Aligning objects

The main object is the object that you want to align other objects with. To make an object the

main object, click it last when doing a control-click multiple selection. You can align selected

multiple objects based on the position of the main object:

• Tops, Middles, Bottoms• Baseline

• Lefts, Centers, Rights

• To Grid (Snap to Grid)

You can change the main object by right-clicking a new object.

Some of the operations deal with the concept of the main object, the last object you select.

Certain limitations apply in certain operations:

• You can select multiple objects in the same section or different sections of a report and align

them, with the condition that the alignment will not result in an object being moved to a

different section of the report. For example, if you select an object in the Report Header and

another object in the Page Header, you can align them vertically but not horizontally sincemoving objects horizontally would result in moving one of the objects to a different section.

To align objects

1. Select the objects.

2.   Click Format   ➤ Align  and select the required alignment from the list.

You can also right-click the object and select Align from the shortcut menu.

Resizing objectsYou can resize objects according to:

• Width

• Height

• Size

To resize an object

1. Click the object once to select it.

When the broken line frame and handles appear, the object is selected.

2. Drag one of the handles with the double-arrow sizing cursor to change the size of the object.

This cursor may appear as vertical, horizontal, or diagonal, depending on the handle you

have grabbed.

Fundamentals of Report Design—Learner’s Guide56

Page 73: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 73/300

You can resize multiple objects at the same time by selecting them, then using the

double-arrow sizing cursor to stretch or shrink objects.

To resize objects based on the main object

1. Ctrl-click the objects once to select them.The last object you select is the main object. The size of the main object is used to resize the

other selected objects.

2.   Right-click the main object and select Size from the shortcut menu.

You can also click Format   ➤ Size.

3.   Select Same Width, Same Height, or  Same Size to resize the objects.

Cutting, copying, and pasting objects

To facilitate faster report design, you can copy and paste objects from one section to anotherarea. When you copy an object, you are copying the actual data value of that object, not just

the object definition. This way, you can copy and paste objects with data to other applications

(as text, metafile, bitmap, and so on).

You can copy an object from the Preview tab to the clipboard, retaining the object’s properties.

If you paste the object into other applications, the object retains its data.

Note:  Cut, Copy, and Paste cannot be applied to subreports.

To cut, copy, or paste an object

Several methods can be used:

1. Right-click the object (or the main object in multiple selections) and select the applicable

operation from the shortcut menu.

2.   Click Edit   ➤ Cut/Copy/Paste.

Alternately, you can press Ctrl-X or Shift-Delete for Cut, Ctrl-C or Ctrl-Insert for Copy, or

Ctrl-V or Shift-Insert for Paste.

Tip:  If you select a single object, you can copy it easily by clicking it, holding down the

Control key, and dragging it to the desired location.

57Creating a Report—Learner’s Guide

Page 74: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 74/300

Formatting objects

Once you have placedfields or objects on your report, you may want to change their appearance.

Crystal Reports enables you to change many of the attributes such as font, font size, font color,

border lines, and underline through the  Formatting  toolbar and the Format Editor.

After completing this unit, you will be able to:

•   Format fields using the Formatting  toolbar and the Format Editor

• Lock an object’s format

• Use text objects

Formatting fields using the Formatting toolbar 

The Formatting toolbar includes such options as font formatting, text formatting and alignment,

and highlighting. Database fields can be formatted to print with the colors, fonts, and attributes

that you prefer. These fields can also be formatted to change the way the data displays on your

report. For example, you might prefer your numbers to be printed with two decimal placesand your dates to be in the North American format. These attributes can be combined to make

your reports presentation quality.

To format fields using the Formatting toolbar 

1. Select the object you want to format.

2.   Click the appropriate formatting button on the Formatting  toolbar.

Formatting fields using the Format Editor Using the Format Editor is another, more complex method of formatting. Some of the more

frequently used features of the  Format Editor are the options listed on these tabs:

•   Common

•   Border

•   Font

•   Number

Common tab of the Format Editor 

On the Common tab, you can suppress the field, keep the field together if a record spans more

than one page, control borders of the field, limit the number of lines the field can print, rotateand align text, add tooltip text, and lock the size and position of the selected object.

Fundamentals of Report Design—Learner’s Guide58

Page 75: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 75/300

Border tab of the Format Editor 

On the Border tab, you can select line styles, drop shadows, and the color for the border andthe background. Clicking Background opens a second color selection list for you to choose a

fill color for the text object.

59Creating a Report—Learner’s Guide

Page 76: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 76/300

Font tab of the Format Editor 

On the Font tab, your options include the changing the font, style, size, and color. You can alsoadd a strikeout (a line through text) and underline effects. The sample box shows you the results

of your choices.

Fundamentals of Report Design—Learner’s Guide60

Page 77: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 77/300

Tip:  Many of the attributes you see in the Format Editor have the formula buttons next to

them. These buttons are used for conditional formatting, or applying a condition to a specific

format using a formula.

Number tab of the Format Editor 

If you select a numeric field to format, the Format Editor offers these options on the Number

tab.

61Creating a Report—Learner’s Guide

Page 78: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 78/300

•   System Default Number Format

This option checks the settings in your Windows control panel and uses those settings for

your numeric fields.

•   Currency symbol areaThis option enables you to display a currency symbol and its type, if applicable.

•   Customize

Under the Customize button, you can set various options:

○   Suppress if Zero

This option functions similar to a spreadsheet. If the value to be printed is “0” (zero), then

no value is shown.

○   Decimals

This option enables you to include decimals or not.

○   Rounding 

This option enables you to round a number to the specified number of decimal places or to

the nearest whole number if no number of decimal place is indicated.

○   Negatives

This option offers several different ways to display negative values.

○   Decimal Separator

Fundamentals of Report Design—Learner’s Guide62

Page 79: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 79/300

Page 80: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 80/300

Page 81: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 81/300

Tip:  The place where the ruler line appears depends on the position of the text object. If

the text object is too close to the top of the screen to add a ruler line, it will appear below.

Activity: Positioning, sizing, and formatting objects

Objective

• Position, size, and format different fields and objects on a report.

Instructions

1. Open the previous report, Creating a report.rpt.

Tip:  Remember to make changes in the  Design tab because you’re working with

placeholders, not the actual data, which speeds up the report creation process.

2. Rearrange the columns in this order using the guidelines: Region, City, Customer Name,

Order Date, Order Amount, and Order ID.

3. Resize the fields and column headings to accommodate the data, if required.

4.   Format the Order Amount field to print with no decimal places and with no dollar signs

($).

5.   Format the Region field and column heading to be centered.

6. Use the Report Explorer to format the Order Date to print with no time portion using the

Format Editor.

7.   Change the color of all column headings to print bold and in blue. Use Select All Section

Objects.

8.   Create a text object that will print “Customers & Orders Report” as the title in the Report

Header.

9. Center the title and increase the font size of the text to 20 point.

10.Add a single border and a drop shadow to the title.

11.Change the color of the text inside the text object to Navy.

12.Make sure the title prints in the center of your page.

13.Save the report as Positioning+ objects.rpt.

14.Add this report to the folder in the  Workbench.

65Creating a Report—Learner’s Guide

Page 82: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 82/300

Your report should look similar to this example.

Fundamentals of Report Design—Learner’s Guide66

Page 83: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 83/300

Quiz: Creating a report

1.   What is the difference between using the Design tab and Preview tab?

2.   What is the difference between using Print Preview and Refresh?

3. What objects can be stored in the repository?

4.  What is the Workbench?

5. How do you select multiple report objects?

67Creating a Report—Learner’s Guide

Page 84: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 84/300

Lesson summary

After completing this lesson, you are now able to:

• Create a report

• Add tables

• Describe the design environment

• Insert objects on a report

• Preview a report

• Save a report

• Position and size objects

• Format objects

Fundamentals of Report Design—Learner’s Guide68

Page 85: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 85/300

Lesson 3

Selecting Records

Lesson introductionRarely will you want a listing of every record in your database. Most often you are interested

in only a select set of records, as in sales for a particular region or inventory for a category of

products.

After completing this lesson, you will be able to:

•   Define the Select Expert

• Determine the criteria for record selection

• Understand saved and refreshed data

• Apply record selection

• Apply additional record selection criteria• Modify record selection

• Apply time-based record selection

69Selecting Records—Learner’s Guide

Page 86: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 86/300

Defining the Select Expert

You can filter or select the records you want to see included on your report in the Select Expert.

After completing this unit, you will be able to:

•   Explain the functionality of the Select Expert and its components•   Define the features of the Select Expert

Using the Select Expert

The report you created previously will print all records in your database. Often, however, you

want to restrict the records printed for a particular set. For example, in the Xtreme database

that ships with Crystal Reports, a number of distributors are listed. You may want to report

on only those in North America or only those who sold more than $30,000 last year.

To do this, you set the record selection of your report to include only the data you want in your

report.

To activate the Select Expert

To activate the Select Expert, you can:

1.   Click Select Expert on the Expert Tools toolbar.

2.   Choose Report ➤ Select Expert from the menu.

3. If the field you want to set record selection on is on your report, right-click that field and

choose Select Expert from the shortcut menu.

The Select Expert opens automatically for the field you select. You are not presented with

a pick list of fields.

If you have not selected a field by clicking it to make it active before using one of these

methods, a dialog box opens, displaying the fields.

Fundamentals of Report Design—Learner’s Guide70

Page 87: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 87/300

Tip: Your record selection criterion does not have to be based on a field in your report. You

can choose any field from the database as a basis for record selection.

Once you have indicated the field you want to set the record selection on and have clicked

OK, the Select Expert opens.

The Select Expert’s features

In addition to the New and Delete buttons, the Select Expert contains several function buttons

including:

•   OK: This option accepts any changes you have made and closes the dialog box; the report

is then updated to reflect those changes.

•   Cancel: This option closes the dialog box ignoring any changes you made while in the dialog

box; the report is not affected.

•   Help: This option opens the Crystal Reports online Help.

•   Browse: This option opens a Fields dialog box that shows a sample of values from the

database.

•   Show Formula: This option expands the Select Expert to include a display of the formula

created.

71Selecting Records—Learner’s Guide

Page 88: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 88/300

Determining the criteria for record selection

Setting the filters or options limits the number of records, which are then displayed in the

report.

After completing this unit, you will be able to:

• Describe the options that define record selection criteria

• Change record selection to be case insensitive

Defining record selection

The first step in record selection is to define your criteria for selection. For example, do you

want to focus on one city or state, or are you interested in specific regions. Maybe a date range

or all records below a particular value will work best.

Using the drop-down list, you can build selection criteria that meet your needs. Depending on

the field you select, the available options in the drop-down list are:•   is any value

This option selects all records, meaning no selection at all.

•   is equal to

This option enables you to specify one specific value as the criteria, so that only matching

records are included on the report; for example, only records from California (CA).

•   is one of

This option enables you to specify a series of values as the criteria, so that only records

matching one of these will be included on the report; for example, only records from CA,

BC, or NY.•   is not one of

This option enables you to exclude a series of values as the criteria, so that those matching

records will be excluded on the report; for example, not records from CA, BC, or NY.

•   is greater than or less than

This option enables you to indicate a specific value that records must be above or below to

be included on the report; for example, only records with sales greater than or over $50,000

for the last year.

•   is greater than or equal to or less than or equal to

This option enables you to include all records in which the linked field value is above orbelow (or equal to) to be included on the report; for example, only records with sales that

are the same amount (that is, $50,000) or greater than or over $50,000 for the last year.

•   is between

This option enables you to select records that have a value falling between or matching one

of the two specified values; is inclusive and includes the end values; for example, only

records with last year’s sales between $10,000 and $20,000, including $10,000 and $20,000.

Fundamentals of Report Design—Learner’s Guide72

Page 89: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 89/300

•   is not between

This option enables you to exclude records that have a value falling between or matching

one of the two specified values; is inclusive and excludes the end values; for example,

excludes records with last year’s sales between $10,000 and $20,000, including $10,000 and

$20,000.

•   starts with

This option enables you to indicate character(s) or value(s) that each data field must begin

with in order to pass the selection criteria; for example, only customers whose names begin

with the letter “A.”

•   does not start with

This option enables you to indicate character(s) or value(s) that each data field does not

begin with in order to pass the selection criteria; for example, no customers whose names

begin with the letter “A.”

•   is like

This option permits DOS wildcard characters (? and *) to specify criteria that must be met;for example, crystal, comical, and critical could all be selected using “is like c*.”

•   is not like

This option permits DOS wildcard characters (? and *) to specify criteria that must be

excluded; for example, using “is not like c*” would exclude crystal, comical, and critical.

•   in the period

This option enables you to specify a date range in which records must fall in order to be

included on the report and is only available if a date field is chosen; with this option, a scroll

list of all Crystal Reports date ranges is made available.

•   is not in the period

This option enables you to specify a date range in which records must not fall in order to

be included on the report and is only available if a date field is chosen; with this option, a

scroll list of all Crystal Reports date ranges is made available.

•   formula

This option expands the dialog box where you enter your criteria.

The Select Expert dialog box defaults to “any value.” If you enter a choice other than “any

value” in the drop-down list box, a second drop-down list appears that contains some sample

data from your database. You can choose values directly from the drop-down list or manually

enter the value at the cursor prompt.Note:   If you are familiar with the Crystal formula language, you can enter your formula here.

You can click Show Formula>>> to view the formula(s), if any, used by Crystal Reports. You

can also activate the Formula Editor from this extended window and modify this formula. For

example, you may want only the records in which profits are over a certain percentage. Once

the percentage is calculated, the record selection decides whether or not to allow the record to

pass.

73Selecting Records—Learner’s Guide

Page 90: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 90/300

Changing record selection to be case insensitive

If you are not confident that data entry was consistent and California could have been entered

as “CA,” “ca”, Ca,” or even “cA” in your database, you will want to ensure that your record

selection statement is case insensitive. Otherwise, you would not filter out all the records from

California.

To change record selection to case insensitive in a report

1.   Click File ➤ Report Options.

The Report Options dialog box appears.

2.   Select the Database Server is Case Insensitive check box to control the case sensitivity of

the record selection formula(s) in your report.

3. Click OK.

To change record selection to case insensitive globally

1.   Click File ➤ Options.

Fundamentals of Report Design—Learner’s Guide74

Page 91: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 91/300

2.  On the Database tab, select the Database Server is Case Insensitive check box to control

the case sensitivity of the record selection formula(s) in all reports.

3. Click OK.

75Selecting Records—Learner’s Guide

Page 92: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 92/300

Understanding saved and refreshed data

In Crystal Reports, you have the option to use data that is saved to your local machine or use

data that is directly taken from the data source.

After completing this unit, you will be able to:

• Describe the difference between saved and refreshed data

Saving data with a report

Reports with saved data are useful for dealing with data that isn't continually updated. When

users navigate through reports with saved data, and drill down for details on columns or charts,

they don't access the database server directly; instead, they access the saved data. Consequently,

reports with saved data not only minimize data transfer over the network, but also lighten the

database server's workload.

You can schedule these reports within BusinessObjects Enterprise, so they automatically refresh

from the database on a predetermined basis. For example, if your sales database is only updated

once a day, or once a week, then you can run the report on a similar schedule and save it with

data. Sales representatives then always have access to current sales data, but they aren't hitting

the database every time they open a report. Alternatively, you can refresh reports with saved

data on an as-needed basis.

Saved data is discarded and refreshed when you perform any of these tasks in a report:

•   Select the Refresh command.

• Change your database logon.

• Change the report's parameters.

• Add a new field that doesn't exist in the saved data.

•   Drill down in a report where Perform Grouping On Server is selected and the details section

is suppressed.

• Verify the database—if the database structure has changed substantially.

• Change the linking parameter on a subreport (the subreport is refreshed).

• Change the order of groups (only for reports in the Report Application Server).

To save data with a report

1.   Click File ➤ Save Data with Report.

2. Save the report.

Note:  If the Save Data with Report option is checked, then it’s already active.

Refreshing data in a report

When you refresh a report that doesn't have saved data, Crystal Reports retrieves data from

the database; otherwise, the program discards the report's saved data and retrieves new data.

Fundamentals of Report Design—Learner’s Guide76

Page 93: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 93/300

By design, Crystal Reports only retrieves data when necessary. When you preview your report

in the Preview tab, print the report, or export it to a file, the program runs your report and

retrieves the required data. Once you are working with the data in the Preview tab, the program

runs the report again and retrieves fresh data if you:

• Add fields to the report after the report was run.

• Add a formula that references a field that was not in the report when you ran it the firsttime.

• Expand your record selection criteria to include more records than were needed when you

first ran the report.

Aside from these circumstances, the program will not automatically refresh a report.

However, there may be times when you want to retrieve new data for the report. For example,

you may have created a report several days earlier and you want to see it run with the most

current data. Refreshing report data is intended for times such as this.

To refresh data

1.   Click Refresh on the Navigation Tools toolbar.

Alternately, click Report ➤ Refresh Report Data or press F5 on the keyboard.

The program runs your report and retrieves the required data.

77Selecting Records—Learner’s Guide

Page 94: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 94/300

Applying record selection

When youapply a filter to your report, limiting the number of records returned, you are setting

the selection criteria.

After completing this unit, you will be able to:

• Set selection criteria

Setting selection criteria

Record selection is determined by the selection criteria. Applying record selection to your report

allows you to limit or restrict the records that are displayed.

To apply record selection

1.   Click Select Expert.

The Choose Field dialog box opens.

2. Choose the field you want to use.

3. Click OK.

Clicking OK creates a tab in the  Select Expert for that field.

4. From the drop-down list, choose the criteria method.5. Enter the values to be used by the criteria in the second drop-down list.

You can pick from the list of samples or type in your own choices.

6. Click OK.

Fundamentals of Report Design—Learner’s Guide78

Page 95: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 95/300

Activity: Applying record selection

Objective

• Select only the records you want to see included on your report.

Instructions

1. Open the Positioning+ objects.rpt that you created in the previous lesson.

2. Set record selection so that only companies from British Columbia (BC), Ohio (OH),

Pennsylvania (PA), and California (CA) appear on the report.

3. Save the report as Applying record selection.rpt.

4. Add the report into the folder in the Workbench.

Your report should look similar to this example.

79Selecting Records—Learner’s Guide

Page 96: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 96/300

Setting additional criteria

You can also add multiple criteria to record selection, which produces even more refined results.

After completing this unit, you will be able to:

• Set additional record selection criteria

Setting additional record selection criteria

Often, your report will require more than one selection criteria. For example, you may want

to select from a list of clients in certain regions who sold over $30,000.

To do this, you would create a record selection using the appropriate date and, if needed,

formula fields in the Select Expert. Crystal Reports reads the date from your system and displays

the appropriate data each time the report is refreshed.

For example, you need a report that shows each staff member that had been hired between a

certain period. The easiest method is to use the "is between" option in the Select Expert.

To do this, you need to create a report showing staff names and their hire dates. If you want

to see all the employees hired in a specific year, use the "is between" option and enter the first

day of the first month of the year in the top drop-down list and the last day of the last month

of the year in the bottom drop-down list. This record selection will return the records of all

employees who were hired in that year.

Another method is to use "is in the period." This method provides you with options to select

a predetermined start and finish date for the period of time you request.

To set additional selection criteria

1.   From the report, activate the Select Expert.

Remember that if the field you want to set criteria on is included in the report, you can select

it first then activate the Select Expert.

2.   Click the New tab.

The Choose Field dialog box opens, prompting you to select a field for record selection.

3. Select the desired field.

4.   Click OK.

The Select Expert dialog box opens, ready for you to set the criteria as you did for the firstfield.

5. Set the criteria for the field.

6.   Click OK.

These steps ensure that only the fields that meet all criteria are included on the report.

Fundamentals of Report Design—Learner’s Guide80

Page 97: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 97/300

Activity: Setting additional selection criteria

Objective

• Refine the record selection by adding additional criteria.

Instructions

1. Open the Applying record selection.rpt from the previous activity.

2. Add a new criterion to your record selection to include all companies with Order Amount

over $1000.

Note:   With this step you are narrowing the selection even further. Your report should now

contain only those records that meet both selection criteria.

3. Save the report as Setting additional selection criteria.rpt.

4.   Add the report into the folder in the Workbench.

Your report should look similar to this example.

81Selecting Records—Learner’s Guide

Page 98: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 98/300

Modifying record selection

You can change the record selection filters or modify the record selection’s formula.

After completing this unit, you will be able to:

• Modify existing record selection• Modify a record selection formula

Modifying existing record selection

Sometimes you may need to modify the record selection in order to produce the results you

intended.

To modify existing record selection criteria

1.   From the Design or Preview tab, make sure no fields are selected, and then click  Select

Expert.

The Select Expert opens.

2. Modify the selection.

3.   Click OK to apply the changes.

Note:  You can remove the record selection by clicking the Delete button in the Select Expert.

Remember that you are only removing the record selection, not the records.

Modifying a record selection formula

You can set up different types of record selection requests without any previous knowledge

of the formula language using the values listed in the  Select Expert. However, there may be

times when you want to modify the actual formula of the record selection request.

By default, Crystal Reports links multiple selection criteria with an “and” statement. For

example, selecting the state equal to CA or BC and company sales over $30,000 would result

in Californian or British Columbian companies that sold over $30,000.

For example, using the record selection formula that shows only BC and CA companies with

no other selection criteria, the formula in the Select Expert would look like this:

Fundamentals of Report Design—Learner’s Guide82

Page 99: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 99/300

Using the record selection formula that shows only BC and CA companies with no other

selection criteria, the result set would look like this:

If you wanted to show BC and CA companies with sales over $30,000, the record selection

formula with “and” would look like this:

83Selecting Records—Learner’s Guide

Page 100: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 100/300

This record selection would result in:

If you wanted to show BC and CA companies or companies with sales over $30,000, the record

selection formula with “or” would look like this:

Fundamentals of Report Design—Learner’s Guide84

Page 101: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 101/300

The selection formula with “or” would result in:

Because you are asking for companies in BC and CA or companies with sales over $30,000, the

formula gives back all companies in the regions regardless of their last year’s sales.

To change the formula to modify record selection

1.   Open the Select Expert and click Show Formula.

85Selecting Records—Learner’s Guide

Page 102: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 102/300

The formula is shown in the lower panel.

2. Remove the word “and” and replace it with “or.”

3.   Click OK when done.

The record selection in this example will result in a listing of companies that sold over$30,000 or companies in British Columbia (BC) or California (CA).

Activity: Refining the record selection

Objective

• Modify the record selection to further refine the record selection.

Instructions

1. Open the Setting additional selection criteria.rpt from the previous activity.2. Select the region to be only BC and CA.

3. Change your record selection criteria from “and” to “or.”

4. Refresh the report to see the difference in the data displayed.

5. Change your record selection criteria back to “and.”

6. Refresh the report to see the difference in the data displayed.

7. Save the report as Refining the record selection.rpt.

8. Add the report into the folder in the Workbench.

Fundamentals of Report Design—Learner’s Guide86

Page 103: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 103/300

Your report should look similar to this example.

87Selecting Records—Learner’s Guide

Page 104: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 104/300

Applying time-based record selection

Setting a time-based record selection is useful when you want to determine results based on a

certain date or time range. For example, you may want to find out which customers bought

over $10,000 in product from you in Q1 of your fiscal year.

After completing this unit, you will be able to:

• Set record selection criteria based on a date

Setting record selection based on a date

Often, you will want to select records based on a date field. You may want to see all accounts

that have not been accessed in the past year, or to show all sales reps that have placed five or

more orders in the past month.

To do this, you would create a record selection using the appropriate date and, if needed,

formula fields in the Select Expert. Crystal Reports reads thedate from your system anddisplays

the appropriate data each time the report is refreshed.

For example, you need a report that shows each staff member that had been hired between a

certain period. The easiest method is to use the “is between” option in the  Select Expert.

Tip:  Watch out for “is between” and “is less than” when entering dates. If no time is entered, theprogram assumes you meant “midnight” and you might miss an entire day’s results.

To do this, you need to create a report showing staff names and their hire dates. If you want

to see all the employees hired in a specific year, use the “is between” option and enter the first

day of the first month of the year in the top drop-down list and the last day of the last month

of the year in the bottom drop-down list. This record selection will return the records of all

employees who were hired in that year.

Another method is to use “is in the period.” This method provides you with options to selecta predetermined start and finish date for the period of time you request.

Fundamentals of Report Design—Learner’s Guide88

Page 105: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 105/300

To apply time-based record selection

1.   Right-click the date field and select the Select Expert from the shortcut menu.

The Select Expert opens.

2.  In the Select Expert, click the option you want to use from the first drop-down list.

3. Depending on the option selected, enter the appropriate dates.

4.   Click OK when you are finished.

Activity: Applying a time-based record selection

Objective

• Create a record selection based on a date.

Instructions

1. Open the Refining the record selection.rpt from the previous activity.

2. Create a record selection based on the Order Date to show records for orders placed in 2004

only.

3. Preview the report. (Use saved data.)

Note the number of records returned with the record selection applied.

4. Save the report as Applying time-based record selection.rpt.

5.   Add the report into the folder in the Workbench.

89Selecting Records—Learner’s Guide

Page 106: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 106/300

Your report should look similar to this example.

Fundamentals of Report Design—Learner’s Guide90

Page 107: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 107/300

Quiz: Selecting records

1. What tool is used for filtering or selecting records in Crystal Reports?

2. When you want to see new data from the database after modifying the record selection,

what option would you use?

3. Why would you want to ensure your record selection is case insensitive?

4. When would you use a time-based record selection?

5. When you want to refresh the data on your report, what are the three methods you can use?

91Selecting Records—Learner’s Guide

Page 108: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 108/300

Lesson summary

After completing this lesson, you are now able to:

•   Define the Select Expert

• Determine the criteria for record selection

• Understand saved and refreshed data

• Apply record selection

• Apply additional record selection criteria

• Modify record selection

• Apply time-based record selection

Fundamentals of Report Design—Learner’s Guide92

Page 109: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 109/300

Lesson 4

Organizing Data on a Report

Lesson introductionOnce you have selected the fields on which you want to report from your database and have

placed them on the report, you can now organize those records in a meaningful way and

perform basic calculations.

After completing this lesson, you will be able to:

• Sort records

• Group records

• Summarize data

93Organizing Data on a Report—Learner’s Guide

Page 110: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 110/300

Sorting records

Using a record sort order enables you to list the records in a particular order, making the report

more meaningful.

After completing this unit, you will be able to:

• Apply a sort order to records

Applying a sort order to records

Once you have selected the records to print and positioned them on your report, you will likely

want to sort them in a meaningful sequence. For example, you may want to sort in alphabetical

order or from highest to lowest sales. If you do not specify a sort order, Crystal Reports displays

the records in their natural order, that is, the order in which they appear in your database.

Each field in the Sort Fields list can be assigned a sort direction in ascending or descending

order independently. For example, you could sort your list by Region in alphabetical order,

then by company in descending order of Last Year Sales.

To apply a sort order to records

1.   Click the Record Sort Expert button on the Expert Tools toolbar.

You can also click Report   ➤ Record Sort Expert .

The Record Sort Order dialog box opens.

All fields currently on your report are listed in the  Report Fields list on the left.

2.   Add the fields from the Report Fields list to the Sort Fields list on the right using > (Add).

3.   Assign an Ascending  or Descending  order individually in the Sort Direction area.

Fundamentals of Report Design—Learner’s Guide94

Page 111: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 111/300

The selection is indicated with an A (ascending) or D (descending), depending on which

sort order was selected. In a multiple-level sort, not all sorts have to be the same (ascending

or descending).

4. Click OK, and then preview your report.

Tip:  The default is Ascending  for each field as it is added to the Sort Fields list. ClickDescending  to change the sort direction.

To remove a field from the Sort Fields list

1.   Select the field and click < (Remove).

You can also double-click the field.

To reorder fields from the Sort Fields list

1.   Select the field and click the Up or Down arrow above the Sort Fields area.

Tip:  You can also click a field and drag it into the sort position you require.

Using sort controls

You may want to design your report so that users can modify a sort field or sort direction

without refreshing information from the database. You can do this using a  Sort Control.

A Sort Control is useful for several reasons:

• It allows users to sort report data for further analysis without leaving the canvas of the

report.

• It eliminates processing demand on the database.

• It reduces the time users spend waiting for data to be sorted.

• It allows users to sort fields in the report even if they do not have a connection or rights to

access the database at the time of viewing.

When planning to include a Sort Control in your report, it is important to consider the following

points:

• Sort controls apply across an entire record set; you cannot sort only one group.

• Sort controls cannot be used in sub-reports.

• Sort controls cannot be created within a cross-tab or an OLAP grid.

• The use of sort controls causes any open drill-down tabs to close (a warning prompt alertsusers).

To create a sort control

1.   Once the data is grouped, on the Report menu, click Record Sort Expert.

The Record Sort Expert appears.

95Organizing Data on a Report—Learner’s Guide

Page 112: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 112/300

Note: Sort fields that begin with "Group" specify that the sort was done automatically when

the data was grouped.

2.   Highlight the fields that you want to sort by and click the > arrow to add them to the  Sort

Fields list.

The order of the fields in the Sort Fields list is the initial order by which data is sorted.

Note:   To enable a Sort Control on a field, that field must be included in the Sort Fields list.

3.   Click OK when finished.

4.   Create your Sort Control:

• If you want to use an existing text object:

1.   On your report, right-click the text object that you would like to use as a Sort Control.

2.   Click Bind Sort Control.

The Sort Control dialog box appears.

3.   Select a sort field and click OK.

• If you want to add a new text object:

1. On the Insert menu, click Sort Control.

2.   Select a sort field and click OK.

3. Click and drag your cursor to the report location where you would like to insert the

Sort Control.

4.   Enter a name for the new Sort Control, and click outside the text object to complete

the process.

5. Repeat Step 4 for any other sort controls you want to create.

Users can sort the fields you have selected by clicking the sort arrows that appear beside the

text object. The report promotes the selected field temporarily to the top of the sort order. When

Fundamentals of Report Design—Learner’s Guide96

Page 113: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 113/300

a second Sort Control is used, the first is returned to its original position in the sort order and

the second is promoted to the top sort.

Note:  Grouping hierarchy is not affected by Sort Control.

To remove a sort control

1.   Right-click the text object that contains the existing Sort Control.

2.   Click Bind Sort Control.

The Sort Control dialog box appears.

3.   Click < Not Interactive >.

4.   Click OK to return to your report.

The Sort Control is removed from the report.

Activity: Applying sorting optionsObjective

• Sort records to list the records in a particular order, making the report more meaningful.

Instructions

1. Open the Applying time-based record selection.rpt from the previous lesson.

2. Sort the records in your report to print in ascending order by Region and City then

descending order by Order Date.

3. Preview the report.

4. Create a sort control on Region.

Notice how the regions change based on the sort direction chosen.

5. Remove the sort control on Region.

6. Save the report as Applying sorting options.rpt.

7. Add the report into the folder in the Workbench.

97Organizing Data on a Report—Learner’s Guide

Page 114: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 114/300

Your report should look similar to this example.

Fundamentals of Report Design—Learner’s Guide98

Page 115: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 115/300

Grouping records

By grouping records into meaningful sequences, you create a more readable and usable report.

After completing this unit, you will be able to:

• Create groups• Modify groups

• Create nested and multiple groups

• Reorder groups

• Add a specified order group

• Group on time-based data

Creating groups

Even though your records are now sorted, you may want to break data into meaningful groups.

For example, you may want all the customers from one region together in one group: allCalifornia customers together, all BC customers together, and so on.

Crystal Reports can then summarizethe information in each group. You can group information

based on report fields, on database fields that are not in the report, and on formula fields. This

grouping cannot be achieved with multi-level sorts since it is one long list; there can only be

one summary using multi-level sorts.

When you group records, you add new areas to your report. These new areas are visible in the

left margin of the Design window. Once you have created a group, a Group Header and Group

Footer surround the Details area. Each group you create has its own header and footer. Also,

when you insert a group, the Group #n Name field is automatically created in the Group

Header.

Navigating using the Preview Panel

The Preview Panel appears in the left margin of the  Preview window. It functions like a

directory tree with a heading for each group in your report, with the ability to expand the

group to see further levels of grouping.

To expand a group in the Preview Panel

1.   Select the Toggle Preview Panel icon in the Standard toolbar.

2.   Click the plus sign (+) icon next to the group name.

Clicking the minus sign (-) collapses the group.

If your report has only one level of grouping, no plus or minus icons will appear beside the

group names.

99Organizing Data on a Report—Learner’s Guide

Page 116: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 116/300

Navigating in the report using drill-down

In the Preview window, you can also drill down on the various groups to obtain information

for the specific group.

To drill down on group headers

1. Double-click a group on the actual report.

An extra tab opens beside the Design and Preview tabs, displaying the information for that

group.

2.   Click the Close View button beside the page controls to close the drill-down group tab.

Applying sort order options when grouping

You apply sort order options when grouping in the Insert Group dialog box.

The options for sorting your groups are:

• in ascending order

A to Z, 1 to 9, lowest to highest, and so on.

• in descending order

Z to A, 9 to 1, highest to lowest, and so on.

• in specified order

You can create your own group based on data other than the fields in the database. For

example, you could create groups based on geographical areas or sales territories and name

them accordingly such as Western Region, Eastern Region, Central Region, and so on.

• in original order

Fundamentals of Report Design—Learner’s Guide100

Page 117: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 117/300

This option leaves the records in the same order as they were stored in the database.

• Use a Formula as Group Sort Order

This option enables you to use a formula to specify the sort order of groups.

The Options tab in the Insert Group dialog box lists the other types of grouping options

available.

These options include:

• Customize Group Name Field

The name of the group can be customized to suit your needs. You can choose from an existing

field or build a formula that displays a different group name.• Keep Group Together

This option prevents a group from being split across pages and forces groups to stay together.

If there is enough room to print all records from a group on the current page, then all the

records will print on that page. If not, they will be printed on the next page.

• Repeat Group Header On Each New Page

The name of the group in the Group Header using the Group Name Field is printed on the

report. If, for example, you had grouped your report by region, the region name would

print just above the first record of that region.

If the group contains so many records that the group needs to span over more than one page,this option forces the Group Name Field to repeat on each new page for a particular group.

Each group generated by the report prints a group header before printing the Details area

information. Group names are commonly found in the group header. After the last record of

the group has printed, the group footer prints. Summary information about the group is

commonly found in the group footer.

101Organizing Data on a Report—Learner’s Guide

Page 118: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 118/300

Note: If you do not want to include the group name with the group, you can clear the Insert GroupName with Group option on the Layout tab in the Options dialog box under the File menu.

Tip:   Grouping overrides record sort, so check your grouping and sorting options after refreshinga report to ensure the results returned are still appropriate.

To insert a group

1.   Click Insert   ➤ Group.

You can also click the Insert Group button on the Insert Tools toolbar.

The Insert Group dialog box opens.

2. In the first drop-down list, select the field you want to group on.

You have a new group for every change in this value.

3. Select a sorting option from the second drop-down list.

4.   When you have finished defining your group(s), click OK.

The dialog box closes and returns to the report.

5. Preview your report.

To format a group

1.   Right-click the group name and select Format Field from the shortcut menu.

A dialog box opens, showing the options associated with the group. For example, if you

clicked a date field group name to format, you would see all the formatting options for

dates. Options exist for number/currency and text fields as well.

2. Format the field.

Fundamentals of Report Design—Learner’s Guide102

Page 119: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 119/300

3.   Click OK.

Tip:  Hover your cursor over a group in the grey area to display the name of the group.

Modifying groups

Once you have created groups on your report, you may find it necessary to modify them. For

example, perhaps you grouped by region and would now like to group by country. You could

delete the region group and add a new group, or you could redefine the existing group. Or

perhaps you want to add a second level of grouping to have your records grouped by country

then by region.

Tip:  You will find it easier to work with your groups from the Design tab where you can see thegroup names and boundaries.

Changing the definition of a group

You may create a group that later you want to remove because of changing circumstances orchanging information needs. If your needs change, you can modify the group. For example,

you created a report that was grouped by region, but now prefer to have the information

grouped by country. You do not need to remove the existing group and replace it with a new

one; you can redefine the existing group.

103Organizing Data on a Report—Learner’s Guide

Page 120: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 120/300

To change the definition of a group

1.  In the Design window, right-click the gray area of the Group Header or Group Footer and

select Change Group from the shortcut menu.

The Change Group Options dialog box opens.

You can change the field the group is based on, the order of the group, or the Keep Group

Together and Repeat Group Header On Each New Page  options.

2.   Make your changes on the Common or Options tabs.

3.   Click OK.

Deleting groups

You may create a group that later you want to remove because of changing circumstances or

changing information needs.

Fundamentals of Report Design—Learner’s Guide104

Page 121: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 121/300

To delete a group

1. Right-click in the gray area over the Group Header or Group Footer of the group you want

to delete, and then select  Delete Group from the shortcut menu.

The group section is deleted from the report.

Activity: Creating and modifying groups

Objective

• Create and modify groups based on specific selection criteria.

Instructions

1. Open the Applying sorting options.rpt from the previous activity.

2. Remove the selection criteria for records with Order Amount being greater than $1000.

3. Refresh the report to view the results.4. Group the records on your report by City and set the group sort order to be ascending in

alphabetical order.

5. Modify the existing group to be based on Region not City.

6. Remove the Region field and column heading from your report and reposition fields if

needed.

105Organizing Data on a Report—Learner’s Guide

Page 122: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 122/300

7. Preview the report to view the results.

8. Save the report as Creating groups.rpt.

9.   Add the report into the folder in the Workbench.

Your report should look similar to this example.

Creating nested and multiple groups

You are not limited to one level of grouping within Crystal Reports. You can have groups

within groups.

For example, you can have a report of all customers, broken down by country, and each country

in turn broken down by region. You could even go further and have a third level, by city.

To create nested or multiple groups

To create nested groups, follow the same steps that you did when you created the first group

on your report.

1.  For each group, click Insert   ➤ Group.

2.   Select the group you want from the options in the Insert Group dialog box.

Note:  As you add more groups, they are automatically added to the list in the  Sort Fields

area of the Record Sort Order Expert.

Fundamentals of Report Design—Learner’s Guide106

Page 123: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 123/300

Reordering groups

You can have very sophisticated reports with groups nested within other groups. For example,

your company may have many distributors in many countries. You want to group by country,

then within each country, you want to group by geographic region like Northwest, Central,

and so on. Then, you may need to group within each of those regions by state.You can create groups in any particular order. Groups can be reordered at any time, unlike the

sort order of records.

To reorder groups

1.   Left-click in the gray area to the left of the Design window and hold the mouse button

down.

The cursor changes to a “hand” to indicate you are reordering or moving a group.

2. Drag the Group Header or Group Footer of the group you want to move and drop it in its

new location.

To reorder groups using the Group Expert

1.   Click Group Expert from the Expert Tools toolbar.

The Group Expert dialog box appears.

107Organizing Data on a Report—Learner’s Guide

Page 124: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 124/300

2. Use the arrows to rearrange the order of the groups.

3. Click OK.

Activity: Creating and reordering multiple groups

Objective

• Create multiple groups and then reorder them in hierarchal order.

Instructions

1. Open the Creating groups.rpt from the previous activity.

2. Add country as a group in ascending order.

3. Reorder the groups in your report so that the records are grouped by country and then by

region.

4. Preview the report to see that the groups have been placed in the correct hierarchical order

by country then by region.

5. Save the report as Creating and reordering multiple groups.rpt.

6.   Add the report into the folder in the Workbench.

Fundamentals of Report Design—Learner’s Guide108

Page 125: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 125/300

Your report should look similar to this example.

Adding a specified order group

You want to group your data in ways that are not reflected by your database fields. For example,

instead of grouping your regions alphabetically, or from the best-selling region to the lowest,

you want to sort them geographically.

Specified order grouping enables you to create both the customized groups that will appear

on your report and the records that each group will contain.

To specify the order of the grouping, select the field to which you want to apply the specified

order grouping and then select in specified order.

109Organizing Data on a Report—Learner’s Guide

Page 126: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 126/300

The Specified Order tab appears at the top of the Insert Group dialog box.

On this tab, you can create custom group names and specify criteria for each. For example, you

might want to have two groups on your report, one for the Western Region and one for the

Eastern Region. You could create these two groups by clicking the New button, then specify

which states, provinces, or districts belong to each.

The order of the group names in this window is the order they are printed on your report. You

can reorder these groups by selecting the name and clicking the Up or Down buttons.

After creating a custom group, you need to define which records belong to which group. You

define this criteria in the  Define Named Group dialog box. This dialog box functions exactly

like the Select Expert.

Fundamentals of Report Design—Learner’s Guide110

Page 127: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 127/300

Once you have created at least one custom group, a third tab appears on the  Insert Group

dialog box. This tab deals with the records that do not fall into any of the custom group

categories. By default these records are included in a group called  Others. You specify what

to do with all the remaining records that do not meet any of the selection criteria of the custom

groups in the Others tab.

The other options include:

•   Discard all others

This option removes all other records from memory and does not show them on the report.

•   Put all others together, with the name:

This option enables you to specify a customized name for the “Others” group.

•   Leave in their own groups

This option groups all remaining records based on the group criteria. For example, if TX

did not fall into either Western or Eastern, all records for Texas would be put into a group

called "TX."

111Organizing Data on a Report—Learner’s Guide

Page 128: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 128/300

You can create groups from either the Design or Preview windows. If you are in the  Design

window, you will see the new Group Header and Group Footer areas surrounding the Details

area. For each group you define, a new Group Header and Group Footer is created.

Tip:  When you add a grand total, the grand total displays for all records selected by the Select

Expert, not only for those showing on the report after creating specified groups. However, if you

apply a specified order grouping and choose to discard others, your grand totals will be correct,calculating only the fields shown on the report.

To create groups in specified order 

1.   Click Insert ➤ Group.

The Insert Group dialog box appears.

2. Select the field you want the data grouped by from the top drop-down list.

3.   Select in specified order as your sort option from the second drop-down list.

4. On the Specified Order tab, enter the name of the group in the Named Group field.5.   Click New.

6. In the Define Named Group dialog box, use the drop-down lists to select the data to be

part of the group.

7. Click the <New> tab to add more selection criteria to your specified group, if necessary.

8.   Click OK.

9.   Click New to create more custom groups as necessary.

10.Click the Others tab to specify how you want to organize the data that is not part of the

group(s) you defined.

11.Click OK.

Activity: Adding a specified order group

Objective

• Add a specified order group to create customized groups to better reflect the way you want

the information on the report to appear.

Instructions

1. Open the Creating and reordering multiple groups.rpt from the previous activity.

2. Delete the Region selection criteria.

3. Add new selection criteria for Country to include USA and Canada.

4. Modify the region group to include a “Western Sales Territory” and add California (CA),

Idaho (ID), Nevada (NV), and British Columbia (BC) to this group.

Fundamentals of Report Design—Learner’s Guide112

Page 129: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 129/300

5. Include a second territory named “Eastern Sales Territory” and add Florida (FL), Ohio (OH),

Ontario (ON), and Pennsylvania (PA).

6. Include all other regions to “Unassigned Regions.”

7. Save the report as Adding a specified order group.rpt.

8.   Add the report into the folder in the Workbench.Your report should look similar to this example.

Grouping on time-based data

Suppose you wanted a report that showed all employees’ names and their birth dates, but you

wanted that report grouped by month. You would then have a list of those employees who

have their birthdays in each month of the year. Or, you might need a report that shows all the

orders placed, broken down by yearly quarters. You can group records by Date fields. When

you apply grouping on a Date field, a second level of sorting options becomes available.

113Organizing Data on a Report—Learner’s Guide

Page 130: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 130/300

The first list gives you the option to select on which field you want to base the groupings. You

can pick the sort order in the second list. If you choose to base your groups on a date field, a

third option will appear. In this third list, you can specify the frequency of the groups.

Tip:  The options forformatting date, time, and date/timefields are extensive. Youcan also customizethe settings to display a field based on your needs.

To insert a group based on a date field

1.   Click Insert ➤ Group.

The Insert Group dialog box opens.

2. Select the date field on which you want to base the groups in the first drop-down list.

3. Select a sort order.

4. In the third drop-down list, choose the date interval you want to group by.

5.   Click OK.

Activity: Grouping on a date field

Objective

• Apply a group that is built on time-based criteria.

Instructions

1. Open the Adding a specified order group.rpt from the previous activity.

2. Insert a group on order date.

3. Set grouping so the records are grouped by year.

Fundamentals of Report Design—Learner’s Guide114

Page 131: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 131/300

4. Change this grouping to group the records by month.

5. Format the Group Name to display the full month name and year of the group.

6. Remove the thousands separator from the Order ID.

7. Indent the Region and Order Date groups.

8. Preview the report to view the results.

9. Save the report as Grouping on a date field.rpt.

10.Add the report into the folder in the  Workbench.

Your report should look similar to this example.

115Organizing Data on a Report—Learner’s Guide

Page 132: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 132/300

Summarizing data

One of the primary purposes for breaking data into groups is to run calculations on each group

of records instead of all records in the report. When the program summarizes data, it sorts the

data, breaks it into groups, and then summarizes the values in each group automatically.

After completing this unit, you will be able to:

• Insert a summary

• Insert a group and summary at the same time

• Create a group selection based on summary data

• Create a grand total

Inserting a summary

Crystal Reports includes a number of subtotaling or summarizing options. A subtotal is the

sum of all values from a single field, from all the records in a group. In a sales report, for

example, if you subtotal the amount ordered by sales representative, Crystal Reports gathers

all the records that belong to the sales representative and totals the amounts ordered from all

the records.

When the program summarizes data, it sorts the data, breaks it into meaningful groups, and

then summarizes the values in each group automatically.

Depending on the data type of the field you plan to summarize, you can:

• Sum the values in each group.

• Count all the values or only those values that are distinct from one another.

• Determine the maximum, minimum, average, or Nth largest value.

• Calculate up to two kinds of standard deviations and variances.For example:

• Customer list reports determine the number of customers in each state. The summary would

count the distinct customers in each state group.

• Orderreports determine the average order placed each month. The summary would calculate

the size of the average order for each month group.

• Sales reports determine the total sales per sales representative. The summary would sum

or subtotal the order amounts for each sales representative group.

You can show a field as a percentage based on one group that is a fraction of another

broader-based group. For example, you can show the percentage of orders in each region of a

country as compared to the entire country. Or you can show the sales in each city of a countryover the total sales of the entire country. Percentage summary fields support the sum, average,

maximum, minimum, count, and distinct count operations.

You apply the percentage summary first by specifying the total value for the second-level group

(numerator), then the total value for the broader-based group (denominator).

Fundamentals of Report Design—Learner’s Guide116

Page 133: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 133/300

In this example, the figure $147,906 shows a subtotal of the last year’s sales for BC. The number

five (5) shows a summary or count of how many companies are in the group. The percentage

summary of 41.16% is shown as well.

When you insert a summary in your report, the summary is displayed as the summary operation

plus what is being summarized.

In this example, “Count of” is the summary operation and the “Customers” field is being

summarized.

When you select the summary, you see its full name in the Status bar at the bottom of the

Design window.

The summary field automatically lines up with and attaches to the same guideline as the field

it was based on.

You can also insert a simple text object as a label beside your summary field as an explanationto make it meaningful for the user. Adding a text object as an explanatory label in front of the

summary or subtotal helps to further describe the context of the new summary or subtotal. For

example, a subtotal that sums the sales of a particular region could read “Subtotal of Last Year’s

Sales by Region.”

You can insert summary information in either the Design or Preview tabs. The options available

when inserting a summary field vary depending on the type of data you are summarizing.

Tip:  You do not need to select the field you want to summarize (or subtotal) before any of thesemenu options are made available. You can choose this field in the Insert Summary dialog box.

To insert a summary

1.   Click Insert ➤ Summary.

You can also click the Insert Summary button on the Insert Tools toolbar.

117Organizing Data on a Report—Learner’s Guide

Page 134: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 134/300

The Insert Summary dialog box opens.

2.   Select the desired field to summarize from the Choose the field to summarize list.

3. Select a summary operation from the Calculate this summary list.

4.   Select a location in which to place the summary from the Summary location list.

To subtotal, choose the group which will determine the subtotaledamount from the Summary

location list. For example, if you select a sales amount, you could choose to subtotal by

region, which would give you a subtotaled sales amount for each region.

5.   Click OK when finished.

Inserting a group and summary at the same time

If there are currently no groups on the report, you can group and summarize all in one step.

To insert a group and a summary

1.  Click

 Insert   ➤ Summary.

Fundamentals of Report Design—Learner’s Guide118

Page 135: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 135/300

The Insert Summary dialog box opens.

2. Choose the field to summarize.

3. Select the calculation.

4. Select a location in which to place the summary from the Summary location list.

Tip:

•   You can create a new group for your report by clicking the Insert Group button.• You can add your summary to all group levels by clicking the Add to all group levels

check box.

The Insert Group dialog box opens.

119Organizing Data on a Report—Learner’s Guide

Page 136: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 136/300

5.  On the Common tab, select the group from the first list, and then select the sort order.

6.   Click OK to close the Insert Group dialog box.

7. Click OK to close the Insert Summary dialog box.

The group is created at the same time as the summary.

You can group on any field used on the report or in the table(s) selected for that particular

report. You can sort on any field that is used on the report or in the database tables selected

for that report.

Activity: Inserting summaries

Objective

• Create summaries for the grouped data and label the totals.

Instructions

1. Open the Grouping on a date field.rpt from the previous activity.

2. Insert a count of the Order ID for each month (Order Date group).

3. Insert a subtotal on Order Amount for each month (Order Date group).

4. Add a percentage summary for each month (Order Date group) for Order Amount basedon the entire report.

5. Rearrange the percentage summary to be under the subtotal summary.

6. Add the appropriate text objects beside each summary as labels.

7. Preview the report to view the results.

8. Save the report as Inserting summaries.rpt.

Fundamentals of Report Design—Learner’s Guide120

Page 137: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 137/300

9.   Add the report into the folder in the Workbench.

Your report should look similar to this example.

Creating a group selection based on summary data

When you group or summarize data, all the groups in the report are included by default. There

may be times, however, when you do not want to include all groups:

• You might want to see only those groups whose summarizedvalues meet a certain condition.

• You might want to see only the groups with the highest summary values, or the lowest.

For example, if you have a mailing list grouped by region and your record selection formula

specifies only California customers ({Customer.Region} = “CA”), your report will have only

the single group of California.

The Select Expert can be used to select groups of records in the same way that you select

individual records.

When you are setting up group selection criteria, instead of basing the selection criteria on

standard fields, as you do for record selection, you base the criteria on group name fields orsummary fields.

121Organizing Data on a Report—Learner’s Guide

Page 138: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 138/300

• If you have grouped your data but have not summarized it, you can only set up group

selection based on the group name field. For example, you may want to select only those

groups whose Region is Massachusetts:

GroupName ({Customer.REGION}) = “MA”

• If you have summarized your data, youcan set up group selection based on either the group

name field or the summary field. For example:Sum({Customer.LAST YEAR’S SALES}, {Customer.REGION}) > 10000

The Select Expert can be used to set up record selection and group selection requests. When a

group name or summary field is selected, the program knows that the selection criteria you

set up is intended for group selection. In all other cases, the program knows that you are setting

up record selection.

Tip:   Group selection is not so much selection as it is suppression. All of the groups are still in thereport. However, only the selected groups are showing. The group tree and any grand totals areprocessed prior to group selection. For this reason, the group tree and grand totals will continue toreflect all groups, including those that are excluded by the group selection criteria.

To create a group selection based on summary information

1. Right-click the summary field on which you want to base group selection and choose Select

Expert from the shortcut menu.

The Select Expert dialog box appears.

Note:  If you click the Select Expert button without first highlighting a summary field in

your report, the Choose Field dialog box appears.

2. Use the drop-down list to enter your selection criteria for the indicated field.

3.   To base the group selection on more than one field, click the New tab and choose the next

field from the Choose Field dialog box.

Note:  If you have not already previewed the report or refreshed the data, there will not be

any data saved with the report. Without the data, the program cannot calculate group values;

thus, no values appear when you click the arrow in the right drop-down list. In this situation,

you will have to type in the values you want. If you want real values to work with, you will

need to preview your report first. This will calculate the actual summary values available

for you to work with.

Fundamentals of Report Design—Learner’s Guide122

Page 139: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 139/300

4.   When you are finished, click OK in the Select Expert to return to the report.

Activity: Grouping on summary data

Objective

• Create a group on data that has been summarized.

Instructions

1. Open the Inserting summaries.rpt from the previous activity.

2. Change the report to show only months that had more than 10 orders.

3. Preview the report to view the results.

4. Save the report as Grouping on summary data.rpt.

5.   Add the report into the folder in the Workbench.

Your report should look similar to this example.

Creating a grand total

Once you have produced summary information for each group, you may also want to have a

summary for the whole report. Known as a grand total, this total displays at the end of the

report in the Report Footer.

123Organizing Data on a Report—Learner’s Guide

Page 140: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 140/300

Because a grand total serves as a summary for an entire report as opposed to a group, it can

perform the same types of calculations that summary fields can. Again, the options available

depend on the data type on which you are basing the calculation.

To insert a grand total

1.   Click Insert   ➤ Summary.

The Insert Summary dialog box opens.

2.   Select the desired field to summarize from the Choose the field to summarize list.

3.   Select a summary operation from the Calculate this summary list.

4. Select a location in which to place the summary from the Summary location list.

The Grand Totals option is placed in the Report Footer.

5.   Click OK when you are finished.

When you select the Grand Total field in the report, you see its full name in the Status bar.

The Grand Total field automatically lines up with and attaches to the same guideline as the

data field it was based upon.

Activity: Inserting a grand total

Objective

• Add a summary for the entire report called a grand total.

Fundamentals of Report Design—Learner’s Guide124

Page 141: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 141/300

Instructions

1. Open the Grouping on summary data.rpt from the previous activity.

2. Remove the group selection for months that had more than 10 orders.

3. Change the record selection to show all customers in the USA. (1051 records)

4. Add a field to the report that counts how many customers in total are included in this report.

5. Change the count to a distinct count. (90 records)

6. Add another field that shows the total Order Amount for the entire report and delete the

decimals.

7. Add text objects beside each summary to describe them.

8. Format the labels and the grand total field to stand out on your report.

9. Preview the report to view the results.

10.Save the report as Inserting a grand total.rpt.

11.Add the report into the folder in the Workbench.

Your report should look similar to this example.

125Organizing Data on a Report—Learner’s Guide

Page 142: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 142/300

Quiz: Organizing data on a report

1. Can each field in the Sort Fields list be assigned a sort direction in ascending or descending

order independently?

2. What is the function of the Group Tree?

3. How would you create groups that are not reflected by the fields in your database?

4. Why would you want to have the group header repeat on every page?

5. What is the difference between a subtotal and a summary?

Fundamentals of Report Design—Learner’s Guide126

Page 143: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 143/300

Lesson summary

After completing this lesson, you are now able to:

• Sort records

• Group records

• Summarize data

127Organizing Data on a Report—Learner’s Guide

Page 144: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 144/300

Fundamentals of Report Design—Learner’s Guide128

Page 145: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 145/300

Lesson 5

Formatting a Report

Lesson introductionPresentation quality reports are easy to create in Crystal Reports. Many different formatting

options exist to make the information in your report not only stand out, but be more

understandable.

After completing this lesson, you will be able to:

• Add graphical elements

• Combine text objects with database fields

• Apply specialized formatting

• Insert fields with pre-built functions

129Formatting a Report—Learner’s Guide

Page 146: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 146/300

Adding graphical elements

If you want to make specific data or summaries stand out from the rest of the report or just

want to improve the overall appearance, you can use graphic elements to enhance your report.

When working with graphic elements, you may prefer to work in the Design window; it is

easier to see in which area you are working, and easier to ensure that graphic elements suchas lines, boxes, and pictures are positioned correctly.

After completing this unit, you will be able to:

• Add a line to a report

• Add a box to a report

• Add a graphic to a report

• Add a dynamic image object

Adding a line to a report

You can add lines to your report to make information stand out from the rest of the report. For

example, a line in the Group Header section will print once for every group, differentiating

each separate group.

To draw a line

1. Click the Insert Line button on the Insert Tools toolbar.

You can also click Insert   ➤ Line.

A pencil cursor appears on the screen.

2. Position the pencil to the place where you want to begin drawing the line and drag yourmouse to where the line should end.

3. Release the mouse button.

To format a line

1.   Right-click the line and click Format Line from the shortcut menu.

Fundamentals of Report Design—Learner’s Guide130

Page 147: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 147/300

The Format Editor opens, displaying the Line tab.

2. Make changes to the line.

The Format Line dialog box options include line style (solid, small dash, long dash), width

(thickness), and color.

3.   Click OK.

Tip:  To avoid the line being dragged out of position, select the Lock Position and Size

check box.

Note:  You can also use the  Format Painter.

To move a line

1. Click the line to activate the handles on each end.

2. Use the four-way cursor to move your line to a new position.

To resize a line

1. Click the line to activate the sizing handles that appear on each end of the line.

2. If you click one of the handles and hold the left mouse button down, you can resize your

line.

You can draw only straight horizontal or vertical lines using this feature in Crystal Reports.

131Formatting a Report—Learner’s Guide

Page 148: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 148/300

Adding a box to a report

You can insert square or rectangular boxes into your report as well as ellipses, circles, and boxes

with varying degrees of rounded corners. These shapes are useful if you are creating forms.

Pay close attention to where you are placing your box. A box spanning the group header, details

area, and group footer prints once for every group of records. A box in the Details section printsonce for every record. You can put a box around groups or each individual record in the report.

To draw a box

1. Click the Insert Box button on the Insert Tools toolbar.

You can also click Insert   ➤ Box.

A pencil cursor appears on the screen.

2. Use the tip of the pencil to draw with. Position the pencil where you want one corner of the

box and drag your mouse to the opposite corner of the desired box.3. Release the mouse button.

To format a box

1.   Right-click the box and choose Format Box from the shortcut menu.

The Format Editor opens.

2. Make any changes to the box.

The format border options include line style, width, and color. You can also assign a fill

color and a drop shadow.

Fundamentals of Report Design—Learner’s Guide132

Page 149: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 149/300

3.   Select the Rounding tab to adjust the corners of the box to the curve you want for the edges

of the box.

4.   Use the slider to adjust the curve, or enter a percentage in the Rounding  edit box.

Note:  If you have specified rounding for a box, you cannot use the  Drop Shadow option

that is usually available on the Box tab of the Format Editor.

5.   Click OK when you are finished.

To move and size a box

1. Click the box.

Handles appear around the box.

2. Move the cursor over the box and use the four-way cursor to move your box to a new

position.

3. Click and drag one of the center handles to stretch the box either horizontally or vertically.

You can also size your box vertically and horizontally at the same time by clicking and

dragging one of the four corner handles.

Adding a graphic to a report

Often, when developing your reports, you will want to include a picture or graphic. For example,

you might want to put a graphic of your product or the corporate logo at the top of a report.

133Formatting a Report—Learner’s Guide

Page 150: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 150/300

You will find it easier to work in the  Design window when placing a picture on a report so

you can ensure it appears within the section you want.

To insert a graphic

1.   Click the Insert Picture button on the Insert Tools toolbar.

You can also click Insert   ➤ Picture.

The Open dialog box appears.

2. Locate the graphic file you want to use on the report and click Open.

A picture field object attaches to the cursor.

3. Place the upper left corner of the graphic on your report where you want that corner to be

and click the mouse button to release.

The area or section in which you are placing the graphic automatically expands to

accommodate the graphic.Tip:  When placing an object onto your report, ensure the top edge of the object is placed

in the section in which you want to insert the object. If necessary, the height of the section

is automatically increased to display the object.

To format a graphic

1.   Right-click the graphic and choose Format Graphic from the shortcut menu.

Fundamentals of Report Design—Learner’s Guide134

Page 151: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 151/300

The Format Editor opens.

2. Make any changes to the box.You will be able to:

•   Suppress the printing of the picture and other properties from the Common tab.

•   Crop, scale, and size the picture from the Picture tab.

• Add a border, change the color of the border or fill, and add a drop shadow from the

Border tab.

3.   Click OK when you are finished.

Adding a dynamic image object

Objects can be inserted into Crystal Reports using OLE (Object Linking and Embedding), which

enables you to add objects from other applications and then use those applications from within

Crystal Reports to edit the objects if necessary. These objects are often referred to as OLE objects.

You can now place pictures and graphics in a report through a link stored in a database, so

that it is no longer necessary to store images within the database. This new feature supports

the common practice of storing images on a web server and storing references to those images

in a database.

135Formatting a Report—Learner’s Guide

Page 152: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 152/300

A dynamic image object is a picture or metafile (PNG, JPG, WMF, BMP, TIF) that you access

in Crystal Reports by use of a file path or URL. Typically, you use this option when you have

the path to your pictures or metafiles stored as a string field in a database (that is, you do not

have the actual objects stored in the database). You can also use this option when you have

pictures or metafiles stored on a network share, and you know these objects change occasionally.

The functionality of these dynamic image objects is created in Crystal Reports through the use

of a conditional formatting formula that allows you to link to static OLE objects by reference.

Reports that use an absolute or a relative path for a dynamic image object are not supported

in a BusinessObjects Enterprise environment for this release. If you plan to publish reports that

contain dynamic image objects to BusinessObjects Enterprise, it is recommended that you use

URL links for your OLE objects.

Note:   This feature is activated when you refresh your report data. You may not notice a change inthe static OLE object until you click the Refresh button in Crystal Reports. Dynamic images aresaved in the report with saved data.

To add a dynamic image object1. Right-click the image that you inserted and choose Format Graphic from the shortcut menu.

Note:   You begin the process of making an image dynamic by inserting the object into your

report as usual. This object becomes the default object. If Crystal Reports cannot find the

dynamic reference to the object, it uses the default object instead.

2.   In the Format Editor, click the Picture tab, and then click the conditional formatting button

adjacent to the Graphic Location label.

3.   In the Formula Workshop, create the path to your static image object.

4.   Click Save and close to return to the Format Editor.

5. Click OK to return to your report.

6.   Click Refresh to update the reference link to the image object.

Activity: Adding graphical elements

Objective

• Add graphical elements to your report to make the information stand out.

Instructions

1. Open the Inserting a grand total.rpt from the previous lesson.

2. Ensure you are logged on to the Repository Explorer. Locate the Xtreme company logo.

Place the logo onto the report in the  Report Header. Close the Repository Explorer.

For this activity, you can find the Xtreme company logo in these locations:

• In the Images folder in the repository (under the Repository Items folder).

• In the Company Logo folder in the Lesson 5 folder in the course resources.

Fundamentals of Report Design—Learner’s Guide136

Page 153: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 153/300

Note:  This option is available if there is no access to BusinessObjects Enterprise or if no

logo is found on BusinessObjects Enterprise.

3. Adjust the report title to accommodate the logo.

4. Delete the thin blue lines under the column headings.

5. Place a thick blue line under all of the column headings.

6. Draw a thick blue box bordering the Order Date group.

7. Move the Order Date group name to be more readable, if required.

8.   From the Field Explorer insert the Region and Order Date group name into the appropriate

Group Footers.

9. Create a folder called My Pictures in My Documents, if one doesn't exist.

10.From the Original Copyright folder in the Lesson 5 folder in the course resources, copy

the copyright.jpg into the My Pictures folder in My Documents.

11.Insert the copyright image into the Page Footer from the My Pictures folder inMy Documents.

12.Make this image object dynamic by creating a path to the My Pictures folder in My

Documents.

Remember to include quotation marks.

13.Refresh the report and view the results.

Your report should look similar to this example.

137Formatting a Report—Learner’s Guide

Page 154: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 154/300

Page 155: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 155/300

Your report should look similar to this example.

Note:  The path specified for the dynamic graphic location in the solution report may be

different than the one created on the local machine, resulting in the copyright not updating

in the solution report. If you want the copyright to update on your local machine, open the

formula for the graphic location and change the path to reflect what is being used on the

local machine.

139Formatting a Report—Learner’s Guide

Page 156: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 156/300

Page 157: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 157/300

4. Move the cursor to place the insertion point where you want it to appear in the text object.

If you place the database field correctly, it will look like this:

Tip:  Select the Show Field Names option in FileOptions to read the database field names

as you insert them into your text objects.

Note:  Embedding a text object within another text object is not possible.

Preventing truncation of text objects

Sometimes it is difficult to predict how long or tall you should make your text objects if the

data fields that have been embedded contain varying lengths of data.

You can use the Can Grow option to prevent truncation of text objects, that is, to allow the text

box to expand vertically, if necessary, to fit all text and data from the embedded fields, like

word wrap in a word processing application.

Remember to size your text objects with the printed result in mind. Do not worry if the full

names of the database or special fields are not visible in the  Design tab. The printed result iswhat matters.

To prevent truncation of text objects

1.   Right-click the text object and select Format Text from the shortcut menu.

The Format Editor opens.

141Formatting a Report—Learner’s Guide

Page 158: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 158/300

2.   Select the Can Grow check box on the Common tab and enter the maximum number of

lines that you want the field to expand.

Note:   The Can Grow option does not expand horizontally.

Formatting individual elements of text objects

You can format the individual elements of a text object independently. An element is any single

item that is contained in a text object. The word “report” is made up of six elements, since each

letter could be selected and formatted individually. Each field that is inserted into a text object

is an element.

This text object is made up of eight elements: Four, for each of the letters in the word “Dear,”

one for each of the database fields, and two for the spaces between the words.

Once you select elements, you can format them in much the same way you format the text

object as a whole.

Fundamentals of Report Design—Learner’s Guide142

Page 159: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 159/300

To format text or fields individually within a text object

1. Double-click the text object to put it into edit mode.

The broken line frame and ruler bar appear.

2. Select the element(s) you want to format.

Elements can be a selection of text or a field.

3. Right-click the selected element(s) and select the formatting option from the shortcut menu.

The appropriate dialog box appears.

For example, if you selected text to format, the  Text Format dialog box opens:

4. Make the changes you require.

5.   Click OK.

Setting tabs in a text object

Each text object can have its own tab setting.

To set tabs

1. Click in the text object to put it into edit mode.

The ruler line appears.

143Formatting a Report—Learner’s Guide

Page 160: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 160/300

2. Click the ruler line where you want to place the tab.

To move a tab

1. Drag it to a new position on the ruler.

To remove a tab

1. Drag it off of the ruler line and let go.

Tip: Editing text objects is like using a mini word processor. You can add tabs, set paragraph

alignments, and create indentations.

Fundamentals of Report Design—Learner’s Guide144

Page 161: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 161/300

Applying specialized formatting

You can customize your report to be presentation quality using several options.

After completing this unit, you will be able to:

• Format multiple objects• Apply a predefined template

• Apply text rotation

• Apply accounting conventions

• Apply numeric, currency, date, time, and date/time formatting

Formatting multiple objects

Use the Format Painter to copy formatting properties from one report object to one or more

target objects. The Format Painter button displays on the  Standard toolbar when you select a

source object in your report. If you apply formatting to a target field that is not the same as

your source field, only the common properties are applied.

Some things to keep in mind about the Format Painter:

•   The Format Painter does not copy hyperlink information to a target object or field.

•   The Format Painter does not copy formatting that is applied through use of the Highlighting 

Expert.

•   The Format Painter does not copy formatting from text/template objects to database fields.

• When using a Date and Time field as your source, a target field’s date or time properties

are changed; the reverse is also true (that is, a Date field or a Time field used as your source

also affects the date and time properties of a Date and Time field).

This tables lists the source report objects and fields and the applicable targets you can use withthe Format Painter.

Target object or fieldSource object or field

Report field (not in a cross-tab)Report field (not in a cross-tab)

Report field in a cross-tabReport field in a cross-tab

Template fieldTemplate field

Text object (not in a cross-tab)Text object (not in a cross-tab)

Text object in a cross-tabText object in a cross-tab

Object in an OLAP grid headerObject in an OLAP grid header

145Formatting a Report—Learner’s Guide

Page 162: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 162/300

Target object or fieldSource object or field

Line objectLine object

Box objectBox object

OLE or BLOB fieldOLE or BLOB field

SubreportSubreport

Chart, map, OLAP grid, or cross-tabChart, map, OLAP grid, or cross-tab

To copy and apply formatting

1.   Select a source object or field in your report and click Format Painter.

Tip:  You can also select Format Painter from the shortcut menu.

Note:

•   The Format Painter button is not available until you select an object or field.

•   Click the button a second time, or press Esc, to exit the Format Painter.

• You cannot apply formatting to read-only objects or fields.

•   Hold the Alt key down if you want to apply formatting to more than one object or field.

2. Click the target object or field.When you move your mouse over your report, the cursor changes to a Stop cursor if the

object or field cannot be used as a target.

Applying predefined templates

A template is an existing report file whose formatting can be added to a new or existing report.

You can use the templates found in the Template Expert to give any number of reports a

consistent look without having to format each report individually.

Use the Template Expert command to apply one of several professionally-designed styles to

your report. When you choose the Template Expert command, the Template Expert appears.

Use this dialog box to select a report style and apply it to your report.

Fundamentals of Report Design—Learner’s Guide146

Page 163: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 163/300

To apply a predefined template

1.   Click Report ➤ Template Expert.

You can also click the Template Expert button on the Expert Tools toolbar.

The Template Expert appears.

147Formatting a Report—Learner’s Guide

Page 164: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 164/300

2. Choose a template.

3.   Click OK.

Note:   If a template has already been applied, you can undo the current template or reapply

the last template in the Template Expert. If you want to have the headings print verticallyto save space on your report, use text rotation,sometimes referred to as vertical text. Designed

primarily to support formatting in foreign languages (for example, Japanese), you can format

string fields, memo fields, and text objects vertically.

Applying text rotation

You can export a report with vertical text to various formats; a report with vertical text can also

be exported to the web and viewed in a report viewer, a type of specialized web browser for

Crystal Reports.

Note:  You can only rotate text in a True Type font or printer font.

To apply text rotation

1. Right-click the object and choose the appropriate formatting option from the shortcut menu.

Fundamentals of Report Design—Learner’s Guide148

Page 165: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 165/300

The Format Editor opens, displaying the Common tab.

2. Select the degree of rotation you want from the Text Rotation list.• 0 degrees: default setting

• 90 degrees: direction of text is bottom to top, left to right

• 270 degrees: direction of text is top to bottom, right to left

3.   Click OK.

The text rotation is applied to the object you selected.

Applying accounting conventions

To support conventions used in accounting, you can control how the negative symbol, currency

symbol, and zero value are displayed. You can also reverse the sign when displaying numbers

in accounting reports and determine whether overflow field representation is enabled for the

selected field(s), commonly referred to as field clipping.

149Formatting a Report—Learner’s Guide

Page 166: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 166/300

To apply accounting formatting

1.   Right-click the currency or number field and click Format Field from the shortcut menu.

The Format Editor opens, displaying the appropriate options for the number or currency

field selected.

2. Click the Number tab to make it active, if it is not displayed.

3.   Click the Customize button.

Fundamentals of Report Design—Learner’s Guide150

Page 167: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 167/300

The Custom Style dialog box opens.

4. Select the Use Accounting Format check box.

5. Choose the formatting style you want to apply for decimals, negatives, separators, and

rounding.

You can also select the Reverse Sign for Display check box to have the signs of numbers

(plus or minus) reverse their sign when displaying debit or credit amounts in financialreports.

6.   Click OK to apply the formatting and close the Custom Style dialog box.

7. Click OK to close the Format Editor.

Applying numeric, currency, date, time, and date/time formatting

You can fine tune the formatting of number, currency, date, time, and date/time fields.

Number field

Use the options on the Number tab of the Format Editor.

151Formatting a Report—Learner’s Guide

Page 168: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 168/300

You can choose from a list of sample styles, including the system default settings, or you can

customize the style of the number display:

• System Default

Whatever you have specified through your machine’s Control Panel is the designated systemdefault.

• Sample styles

Click one of the sample styles to apply that type of formatting.

•   Customize

If you do not choose the system default number format or any of the sample number formats

but want to customize one of these styles further, you make alterations to these styles by

clicking the Customize button.

Currency

You change the formatting of a currency field in the same way as you do a number field in the

Number tab of the Format Editor. Because you select a currency field, the options that appear

in the Style area of the Number tab change to currency formatting examples.

The currency options are listed in the Format Editor.

Fundamentals of Report Design—Learner’s Guide152

Page 169: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 169/300

The options are:

•   Display currency symbol

Select Display currency symbol to have the symbol appear on the report. Set whether the

symbol is fixed in one position or whether the symbol “floats” with the currency numbers

by clicking the option buttons.

• System Default

This choice reflects the default format that is set up in your machine’s Control Panel.

• Sample styles

Choose a style that meets your formatting requirements.

•   Customize

You can further customize the way your currency formats display on your report.

Date, time, and date/time fields

Use the options in the Date and Time tab of the Format Editor to customize the display of your

date and time fields. Depending on the type of field you have selected to format, the Date and

Time tab of the  Format Editor displays the appropriate system default formats and sample

styles for that type of field.

153Formatting a Report—Learner’s Guide

Page 170: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 170/300

The options are:

• System Default

The choices System Default Long Format and System Default Short Format are the default

formats that have been defined through your machine’s Control Panel.• Sample styles

Use the sample style format to customize the formatting of your date, time, or date/time

fields quickly.

•   Customize

If you do not choose any of the system default formats or sample formats, you can further

customize your formatting through the Custom Style dialog box.

To customize a sample style

1. Choose the system default format or one of the sample styles that you think looks closest

in format to the one you want to create for either a number or currency field.

2.   Click Customize.

The Custom Style dialog box opens.

Fundamentals of Report Design—Learner’s Guide154

Page 171: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 171/300

If the field is a number, you make the modifications in the Number tab of the Custom Style

dialog box.

If your selection is a currency field, you make the modifications in the Currency Symbol

tab of the Custom Style dialog box.

155Formatting a Report—Learner’s Guide

Page 172: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 172/300

3. Make the modifications, as necessary.

4.   Click OK.

To customize a date, time, or date/time field

1. Choose a system default format or one of the sample format styles that you think is closeto your requirements.

2.   Click Customize.

The Custom Style dialog box opens.

3. Use the appropriate Date, Time, or  Date and Time tabs of the Custom Style dialog box to

further customize the field.

After you have defined a customized format, a new item called Custom Style appears in

the Style area of the Date and Time tab in the Format Editor.

Caution:  The Custom Style item only appears in the list of styles if you have defined and

selected it as the style to use for that type of field. If you choose the system default or asample style after using the custom style, the custom style will be discarded. This action

applies to a number, currency, date, time, or date/time field.

Fundamentals of Report Design—Learner’s Guide156

Page 173: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 173/300

Activity: Applying formatting elements

Objective

• Apply formatting elements by embedding database fields into text objects, preventing the

truncation of text, and changing the font and color of a text object.

Instructions

1. Open the Adding graphical elements.rpt you created in the previous activity.

2. Insert all of the subtotals and grand total values into their respective text objects.

3.   Prevent the truncation of the subtotal and grand total values by selecting the Can Grow

option.

4. Preview the report to ensure that the subtotals and grand total value appear correctly.

Remember that the Can Grow option doesn’t work horizontally.

5. Adjust the grand total value to display correctly.

6. Align the subtotal and grand total value to the right in the Order Amount column.

7. Select the words “Customers & Orders” within the report title text object and change the

font color to Maroon and font style to bold.

8. Save the report as Adding formatting elements.rpt.

9. Add the report into the folder in the Workbench.

Your report should look similar to this example for the report title.

157Formatting a Report—Learner’s Guide

Page 174: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 174/300

Your report should look similar to this example for the grand total.

Fundamentals of Report Design—Learner’s Guide158

Page 175: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 175/300

Inserting fields with pre-built functions

Creating reports that are presentation quality can sometimes take a lot of time. Many factors

can influence how long it takes to create a report: length of the report, volume of data, or the

format in which you want the report presented. You can reduce the amount of time spent

formatting reports by using special fields, which are fields that contain pre-built functions.After completing this unit, you will be able to:

• Insert special fields

• Format special fields

• Embed a special field into a text object

Inserting special fields

Special fields contain information that is not included in the database, but is useful to the overall

presentation quality of the report, making your report more readable.

Some of the more commonly used special fields are:

•   Current CE User ID: displays the ID number of the current BusinessObjects Enterprise user

(if one exists).

•   Current CE User Name: displays the name of the current BusinessObjects Enterprise user

(if one exists).

•   Data Date: prints the date the data was last refreshed on a report with saved data.

159Formatting a Report—Learner’s Guide

Page 176: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 176/300

•   Data Time: prints the time the data was last refreshed on a report with saved data.

•   File Creation Date: prints the date the file was first created.

•   File Path and Name: prints the directory path of the file.

•   Modification Date: prints the date the report was last modified.

•   Modification Time: prints the time the report was last modified.

•   Page N of M: prints the current page number of the total number of pages.

Note: Page N of M uses page on demand, meaning that Crystal Reports will not format a

page until it is requested by the user, or until it is required for the total page count.

•   Page Number: prints the current page number.

•   Print Date: prints the current date as per your computer’s clock.

•   Print Time: prints the current time as per your computer’s clock.

•   Report Comments: prints the contents of the Comments area in the Document Properties

in the File   ➤ Summary Info   menu.

•   Report Title: prints the contents of the Title area in the Document Properties dialog box

in the File   ➤ Summary Info

  menu.•   Total Page Count: prints the total number of pages in the report.

Tip:  If you have created and saved a report and then months later could not remember the file

name or location, put the file name and location into the  Title area in the Document Properties

dialog box in the File ➤ Summary Info menu. Then, place the Report Title special fields in theReport Footer. You can also use the File Path and Name special field to perform the same function.

Fundamentals of Report Design—Learner’s Guide160

Page 177: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 177/300

To insert a special field

1.   From the Field Explorer, locate and expand the Special Fields list.

2. Scroll through the list to locate the special field you want to use.

Once you select the field, a box is attached to the cursor.

3. Drag the field in the desired location and click to drop it onto the report.

Formatting special fields

The formatting options for each of the special fields varies depending on the data type the

special field creates.

To format a special field

1.   Right-click the special field and choose Format Field from the shortcut menu.

The Format Editor opens with the appropriate tab for the data type you are formatting.

2. Make the desired changes.

3. Click the other tabs to make any other changes.

4.   Click OK.

161Formatting a Report—Learner’s Guide

Page 178: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 178/300

Page 179: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 179/300

4. Insert the print date special field inside of the text object.

5. Insert a text object that says Printed: in front of the print date and bold the Printed: text

object.

6. Insert a text object that displays Page Number: in the Page Footer.

7. Insert the page number special field into the text object.8. Change the font color of the City column heading to Maroon.

9.  Use the Format Painter to apply the new formatting of the City column heading to all the

column headings.

10.Save the report as Adding special fields.rpt.

11.Check the report for errors using the Dependency Checker.

12.Add the report into the folder in the  Workbench.

Your report should look similar to this example for the Print date.

163Formatting a Report—Learner’s Guide

Page 180: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 180/300

Your report should look similar to this example for the Page number.

Debrief: Validating the report design

Objective

• Ensure that the completed report looks similar to the report prototype.

Instructions

1. Map each item on the report prototype form to the completed report:

• The report reflects the purpose of the report.

• The header includes thecompany logo,a report title, print date with label, and a copyright.

• The body of the report includes the customers’ names, their location, the date they placed

the order, the amount of their orders, and the locator order number (ID).

• The report displays only the Western Sales Territory and Eastern Sales Territory, with

the other groups not assigned to any specific groups.

• The report contains USA data only and for the year 2004.

• The report displays summarized data:

○ The number of orders by date.

○ A subtotal and a grand total.

○ A percentage of order amount compared to the grand total.

○ The number of unique or distinct customers.

Fundamentals of Report Design—Learner’s Guide164

Page 181: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 181/300

• The key information has been highlighted in some manner.

165Formatting a Report—Learner’s Guide

Page 182: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 182/300

Page 183: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 183/300

Lesson summary

After completing this lesson, you are now able to:

• Add graphical elements

• Combine text objects with database fields

• Apply specialized formatting

• Insert fields with pre-built functions

167Formatting a Report—Learner’s Guide

Page 184: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 184/300

Fundamentals of Report Design—Learner’s Guide168

Page 185: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 185/300

Lesson 6

Applying Section Formatting

Lesson introductionAdditional formatting options can be applied to entire sections of a report.

After completing this lesson, you will be able to:

• Format sections

• Create a summary report

169 Applying Section Formatting—Learner’s Guide

Page 186: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 186/300

Formatting sections

You can create multiple sections within an area on the report.

After completing this unit, you will be able to:

•   Define the Section Expert• Format sections

Defining the Section Expert

The Section Expert offers flexibility when formatting different sections of a report.

The three tabs that always appear in the Section Expert are:

•   Common tab

•   Paging  tab

•   Color tab

A fourth tab, the Layout tab, appears when you select the details section and the Format with

Multiple Columns option on the Common tab.

To open the Section Expert

1.   Click Section Expert on the Expert Tools toolbar.

You can also right-click on the report and click Section Expert from the shortcut menu.

Exploring the Common tab

Use the Common tab to set properties such as: visible, keep together, formatting with multiple

columns, and so on for a desired section.

The active options on the Common tab vary, depending on which section is selected in the

Sections list. Only options applicable to the selected section are available.

Note:  The Conditional Formatting button enables you to add a formula that applies a condition

to the selected feature. The formula is processed when the condition is met in the report data.

Fundamentals of Report Design—Learner’s Guide170

Page 187: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 187/300

The options in the Common tab are:

•   Hide (Drill-Down OK)

Hide in the Common tab functions the same way as Hide (Drill-Down OK) on the shortcut

menu. It prevents the area/section from printing, but still allows the user to double-click a

summary field to open a new display tab to show the underlying data that constitutes that

summary value.

•   Suppress (No Drill-Down)

This option has the same effect as Hide. You may not want to let your viewers drill down

on the summary fields to see the information behind them. Or perhaps you do not want

people to inadvertently drill down. Choosing Suppress (No Drill-Down) still hides the

section, but does not allow anyone to see the underlying data. If a user double-clicks when

the magnifying glass appears, the program produces a new tab, but the details do not show.

Only the summary field is duplicated. You can also make this feature conditional by clicking

the formula button then entering a Boolean formula.

•   Print at Bottom of Page

This option forces whatever is in that section to be printed as low on the page as possible.

In a report that generates invoices, for example, you would want each invoice to have the

total printed at the bottom of the page. That way, all invoices have the total printed in thesame place, no matter how many entries are on the invoice. This command can be made

conditional by clicking the formula button then entering a Boolean formula.

•   Keep Together

This option prevents page breaks from spreading data from a single record over two pages.

Therefore, if you have multiple lines in the Detail section, all the information for each detail

171 Applying Section Formatting—Learner’s Guide

Page 188: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 188/300

line would stay together on one page if you turn the Keep Together option on. This command

can be made conditional by clicking the formula button then entering a Boolean formula.

•   Suppress Blank Section

This command suppresses or prevents printing of the section if all fields in that section are

blank. A typical use is in the creation of a mailing label report where there is no second

address line and you do not want a gap to print. This command can be made conditionalby clicking the formula button then entering a Boolean formula.

•   Underlay Following Sections

Underlay allows any objects that are in the section to flow into the next while allowing

objects from the next section to print on top of the first. This command can be made

conditional by clicking the formula button then entering a Boolean formula.

You might place the company logo in the  Page Header and turn on Underlay Following 

Sections for the Page Header to create a watermark effect. This command is often used with

sections containing charts.

•   Format with Multiple ColumnsThis option is activated only when the Details section is chosen. This option enables you to

create a report that shows the details in columnar format rather than having the details all

show one under the other. An example is address labels.

•   Clamp Page Footer

When this check box is selected, the program removes any extra white space at the bottom

of a report. This minimizes unnecessary scrolling for reports viewed online.

Note:  This option appears only when you have selected Page Footer in the Sections list.

•   Reserve Minimum Page Footer

This option enables you to minimize the space reserved for your Page Footer sections,thereby maximizing the space available for valuable report information on each page. This

option only affects a Page Footer area with multiple sections.

By default, Crystal Reports reserves space at the bottom of each page for your  Page Footer

sections. This space is reserved whether or not the Page Footer sections are conditionally

suppressed. Normally, the space reserved is equivalent to the combined height of all Page

Footer sections that are shown or conditionally suppressed.

You can, however, minimize the space reserved. To do so, first conditionally suppress

individual Page Footers as desired. Then select  Page Footer in the Sections area of the

Section Expert, and select the Reserve Minimum Page Footer option on the Expert’s

Common tab. When you do this, Crystal Reports will only reserve space on each page forthe tallest of your Page Footer sections.

Note:  This option appears only when you select Page Footer in the Sections list.

•   Read-only

This option makes a section read-only and locks the formatting and position of all the report

objects it contains so they can’t be formatted or moved. When you select this option, all

Fundamentals of Report Design—Learner’s Guide172

Page 189: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 189/300

other choices in the Section Expert become inactive. The formatting options that are usually

available on the toolbars or shortcut menus are also suppressed for that section.

•   Relative Positions

This option allows you to lock the relative position of a report object next to a grid object

within a section.

○ Only horizontal locking is possible. If you need to preserve relative vertical positioning,

you should create a new report section.

○ Once Relative Positions is selected for a section, you can no longer drag objects to new

positions within that section. To change an object's position, use the Object Size and

Position dialog box.

○ Relative positioning applies only to objects placed to the right of grid objects (that is,

objects that can grow horizontally).

Note:

• Only horizontal locking is possible. If you need to preserve relative vertical positioning,

you should create a new report section.

• Once Relative Positions is selected for a section, you can no longer drag objects to newpositions within that section. To change an object's position, use the Object Size and

Position dialog box.

• Relative positioning applies only to objects placed to the right of grid objects (that is,

objects that can grow horizontally).

The Conditional Formatting  button enables you to add a formula that applies a condition

to the selected feature. The formula is processed when the condition is met in the report

data.

Exploring the Paging tab

Use the Paging  tab to set properties such as: page breaks, page numbers, orientation, and so

on for a desired section.

The options in the Paging  tab are:

173 Applying Section Formatting—Learner’s Guide

Page 190: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 190/300

Page 191: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 191/300

Page 192: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 192/300

Exploring the Layout tab

Use the Layout tab to set up your report in a multi-column format. That is, instead of having

the data print straight down the page, you can set up multiple columns and have the data flow

from column to column. You can also have your data print across then down the page, printing

one record in each column, then printing a second record in each column, then a third, and so

on. The dialog box is divided into four smaller boxes.

The options in the Layout tab are:

•   Detail Size

This box enables you to specify the dimensions (height and width) of one detail. Determine

how wide you want each detail to be (based on number of characters, font size, and so on)

and enter that value in the Width edit box.

Determine how high you want each detail to be (based on number of lines in the detail, font

size, and so on) and enter that value in the Height edit box.

•   Gap between details

This box enables you to specify the empty area (gap, gutter, and so on) you want to allow

between details. Horizontal = the gaps between details going across the page, Vertical = the

gaps between details going down the page.

Determine the gaps you want to allow. Enter the horizontal gap in the Horizontal edit box

and enter the vertical gap in the Vertical edit box.

•   Printing direction

The Printing direction box enables you to specify the path the program follows when printing

the details on a report page. Your options are:

○   Across then Down

Fundamentals of Report Design—Learner’s Guide176

Page 193: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 193/300

Prints details across the columns, one detail in the first column, one in the next, one in

the next, and so on. Then, when all the columns have a detail, the program moves down

the page and prints a second detail in the first column, then in the second, and so on.

○   Down then Across

Prints details down the first column, then down the second column, and so on.

•   Format groups with multiple column

Select this check box if you want the program to format groups with multiple columns using

the Width, Gap between Details, and Printing Directions specified for the selected section.

Formatting a section

When would you use multiple sections in your report? Perhaps you want to display a standard

set of details and additional details if there is an outstanding invoice. You can place the standard

data in Details a and leave it at the default to always print. Then you can place the invoicing

data in Details b and format Details b to print only when there is an outstanding invoice.

Or you may have a report grouped by region that includes some international groups. You can

create a second Group Header section and use Group Header a to display group values for

US customers by conditionally formatting it. Then, you could conditionally format Group

Header b to display only the international customers.

To insert a new section

1.  In the Section Expert, select the section or area you want to insert a section after.

2.   Click Insert.

The program adds a new section immediately below the selected section.

3.   Click OK.

To move sections

1. In the Section Expert, select the section you want to work with.

2.   Click the Up arrow or Down arrow.

You can only move a section up or down within an area.

3. Click OK.

To merge sections

1.  In the Section Expert, move the sections so the two sections follow each other in the list.

2. Select the top section.

3.   Click the Merge button.

177 Applying Section Formatting—Learner’s Guide

Page 194: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 194/300

The program merges the selected section with the section below. Any data in the section

below is combined with the section above; you do not lose any data.

4.   Click OK.

You may need to rearrange the objects in the newly merged section.

To delete a section

1.  In the Section Expert, select the section you want to delete.

2. Click Delete.

The selected section is deleted.

3.   Click OK.

Tip:  When you want to delete a section and its contents, use the Delete section option.

When a section contains objects and you want to combine the data with data in another

section, use the Merge section option.Tip:  When you want to delete a section and its contents, use the Delete section   option.

When a section contains objects and you want to combine the data with data in another

section, use the Merge section option.

To select a background color 

1. In the Section Expert, select the Background Color check box on the Color tab.

The color list is activated.

2.   Click the arrow on the color list to display the available colors.

Fundamentals of Report Design—Learner’s Guide178

Page 195: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 195/300

Page 196: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 196/300

Page 197: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 197/300

Viewing the summary report in the Preview window

When you view a summary report in the Preview window, the cursor changes to a magnifying

glass whenever it moves across a part of the report that represents a summary.

When you double-click with this magnifying glass, a new report window preview tab opens

and the details behind that summary are displayed.

You can double-click as many summaries as you need, and each one opens its own preview

tab. You can close any of these drill-down tabs at any time by viewing that tab, and then clicking

the close tab button.

To create a summary report

1.   Click Section Expert on the Expert Tools toolbar.

2.   Select the Details section and check Hide (Drill-Down OK) or Suppress (No Drill-Down)

option, depending on the requirements of the report.

Both options prevent the Details section from printing when viewing the report.

3. Click OK when you are finished to create the summary report.

4. Preview your report.

You now have only summary information displayed.

Tip:   After you hide the Details section to create a summary report, you may want to format

the report so that the column headings labeling detailed information are displayed in the

drill-down tab rather than in the  Preview tab. To do so:

•   Move the Group Name field from the Group Header section into the Group Footer

section.

•   Move the column headings from the Page Header section into the Group Header section.

•   Hide the Group Header section.

Activity: Creating a summary report

Objective

• Display only the summary information in a report.

Instructions

1. Use Formatting sections.rpt from the previous activity.

2.   Remove the New Page Before or New Page After setting before creating the summary

report so you can see multiple groups on each page.

3.   Delete the Customer Name, Address1, and Phone Page Header column headings.

4. Resize the Group Header and Footer to allow for more space, if needed.

181 Applying Section Formatting—Learner’s Guide

Page 198: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 198/300

5.   Change the format option in the Details section so drill-down is not available.

6. Preview the report to test the suppression of the detail information.

7. Change the format option in the Details section so drill-down is available.

8. Preview the report to test that detail information is still available when you drill down.

9. Save the report as Creating a summary report.rpt.

10.Add the report into the folder in the Workbench.

Your report should look similar to this example.

Fundamentals of Report Design—Learner’s Guide182

Page 199: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 199/300

Quiz: Applying section formatting

Exercise one

1.  True or False: The New Page Before and the New Page After option is usually used with

Group Headers and Group Footers.2. What option prevents page breaks from spreading data from a single record over two pages?

3. If you want to lock the formatting and position of all report objects in a section, what option

do you use in the Section Expert?

Exercise two

Answer these questions using Creating a summary report.rpt.

1. Who are the customers in the New South Wales region of Australia?

2. What is the street address for the Offroad Bike Verlieh in Berlin?

3. What is the phone number for the Picadilly Cycle in Greater London?

183 Applying Section Formatting—Learner’s Guide

Page 200: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 200/300

Fundamentals of Report Design—Learner’s Guide184

Page 201: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 201/300

Lesson 7

Creating Basic Formulas

Lesson introductionIf you want to display data that is a calculated value, you must create a formula field and place

that formula field on your report.

After completing this lesson, you will be able to:

• Define a formula and its purpose

• Create formulas

• Apply Boolean formulas

• Apply If-Then-Else formulas

• Apply date calculations

• Apply numeric calculations• Apply string manipulation

185Creating Basic Formulas—Learner’s Guide

Page 202: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 202/300

Defining a formula and its purpose

In many cases, the data you want to appear on your report already exists in the database.

Sometimes, however, your report requires data that is derived by manipulating data in an

existing field in the database. In this case, you would use a formula to manipulate the data,

and a formula field to contain the manipulated data.After completing this unit, you will be able to:

• Describe a formula

• Describe the components of a formula

• Explain Crystal syntax

• Describe Crystal Reports data types

•   Work with formulas in the Field Explorer

Formulas

A formula is used to manipulate data in your report. For example, a formula can perform a

calculation or change the field’s formatting. You can think of a formula as a small piece of

computer programming code that processes and prints its result on your report, just like a

database field. It will print the result wherever you place the formula field.

You can write formulas that are as simple or complex as you need them to be. Understanding

the formula language helps you develop powerful and flexible formulas.

Typical uses for a formula include:

• Calculating a percentage of a number.

• Extracting a single character from a string field.

• Combining a text string with a number or date field.• Finding the difference between two date fields.

• Performing conditional logic.

The components of a formula

Formulas contain two critical parts: the components and the syntax (or syntax rules). The

components are the pieces that you combine to create a formula. The syntax rules are used to

organize the components. You can use any of the components listed in your formula.

ExampleComponent

{Customer.Customer Last Name}, {Customer.Last Year’s Sales}Fields

1, 2, 3.1416Numbers

"Quantity", ":", "your text"Text

Fundamentals of Report Design—Learner’s Guide186

Page 203: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 203/300

ExampleComponent

+ (add), / (divide), -x (negate)

Operators are special symbols or words that describe an operation

or an action to take place between two or more values. OperatorsOperators

are used in formulas. The program reads the operators in a formulaand performs the actions specified.

ToText(x), ToNumber(x)

Functions are built-in procedures or subroutines used to evaluate,

make calculations on, or transform data. Functions perform

Functions

calculations such as average, sum, and count. All functions available

are listed with their arguments and are arranged by their use.

When you specify a function, the program performs the set of

operations built into the function without you having to specify

each operation separately. In this way, a function is a kind of

shorthand that makes it easier and less time consuming for you to

create reports.

cdFirstDayof Month, cdStatutoryHolidays

Custom functions provide a way to share and reuse formula logic.

They can be stored in the BusinessObjects Enterprise RepositoryCustom functionsand then added to a report. Once in the report, custom functions

can be used in the Formula Expert when creating formulas.

"If" and "Select", "For" loops

Control structures control the flow of logic in a formula. You canuse them to build formula setting conditions, that, if met, triggerControl structuresspecific consequences or repeat a sequence of actions under certain

conditions.

Average (fld, condFld), Sum (fld, condFld, "condition")

Group field values summarize a group. For example, you could use

group field values to find the percentage of the grand total

contributed by each group.

Group field values

{@GrossProfit}, {@QUOTA}Other formulas

Tip:   When you select a function or operator in the appropriate tree, or when you select a functionor operator that is used in the body of your formula, you can press  F1 to see help specific to thatfunction or operator.

187Creating Basic Formulas—Learner’s Guide

Page 204: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 204/300

Crystal syntax

You write formulas according to a specific set of rules called syntax. The Formula Editor checks

the syntax and helps identify problems so you can fix them before you add the formula to the

report.

Syntax rules are used to create a correct formula. Some basic rules are:• Enclose text strings in quotation marks.

• Enclose arguments in parentheses (where applicable).

• Referenced formulas are identified with a leading @ sign.

When creating formulas, you have the option of using either Crystal syntax or Basic syntax.

Almost any formula written with one syntax can be written with the other.

Note:  You cannot use both Crystal syntax and Basic syntax in the same formula; however, you canuse multiple formulas written in either syntax within the same report.

If you are already familiar with Crystal syntax, you can continue to use it and benefit from the

wide range of functions, operators, and control structures.If you are familiar with Microsoft Visual Basic or other versions of Basic, then working in the

Basic syntax in Crystal Reports may be more comfortable for you. In general,  Basic syntax is

modeled on Visual Basic except that it has specific extensions to handle reporting.

Report processing is not slowed down by using  Basic syntax. Reports using Basic syntax

formulas can run on any machine that Crystal Reports runs on. Also, using  Basic syntax

formulas does not require distributing any additional files with your reports.

Changing the syntax from Crystal syntax to Basic syntax or going from Basic syntax to Crystal

syntax changes the list of functions in the Functions window as well as the list of operators in

the Operators window. However, the available report fields remain the same since the report

fields are available to both syntaxes.

To set the default syntax type for your report

1.  On the File  menu, select the Options command.

2.   From the Formula Editor tab, use the Formula Language drop-down arrow to select either

Crystal Syntax or Basic Syntax from the list.

Note:  For the purposes of this lesson, the  Crystal syntax will be used throughout the

examples.

Fundamentals of Report Design—Learner’s Guide188

Page 205: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 205/300

Special characters used in Crystal syntax

DescriptionCharacter 

Denotes everything following is a comment and is ignored by the

Formula Editor. You must repeat the // for each line you want tobe “commented out.”

//

Denotes the arguments that follow a function. Manyfunctions require

more than one argument separated by a comma within the round( )

brackets. Can also denote precedence, forcing parts of your formula

between the() to evaluate first.

Denotes fields. All types of fields, database, other formulas, special,

and so on are enclosed in French braces.{ }

Denotes subscript or arrays. Square brackets before a function denote

an array, whereas square brackets after a function indicate a subscript

(pulling specific characters from a string).

[ ]

Denotes literals. Any text between the quotes is printed as it appears

between the quotes. This functionality is useful when you want" "

punctuation, text, or special characters to appear as part of the result.

Single quotation marks (‘ ’) can also be used for this purpose.

Upper or lower case is ignored by the Formula Editor. You can enter

your functions in all caps, all lower, or any mix you prefer.Upper/Lower case

Carriage returns are ignored in the Formula Editor. You can have

line breaks and blank lines almost anywhere in the formula. It isCarriage returns

common practice to break up long formulas into chunks to make

them easier to read and edit.

Data typesWhen writing formulas in Crystal Reports, it is important to know the data types of the fields

you are working with:

• Boolean

• String

• Date

• Time

189Creating Basic Formulas—Learner’s Guide

Page 206: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 206/300

• DateTime

• Number

• Currency

All fields will be recognized as one of these data types. You must always be aware of the field

data type since this can affect which functions can be used with the field.

Note:  A field that is larger than 254 characters will be recognized as a memo field. Formulas canwork with memo fields, and they can process strings up to 64K in length.

Working with formulas in the Field Explorer 

From the Field Explorer dialog box, you can:

• Create a new formula.

• Edit an existing formula.

• Rename an existing formula.

• Delete a formula.

To create a new formula

1.   From the View menu, select Field Explorer.

The Field Explorer dialog box appears.

2.   Right-click the Formula Fields tree and select New from the shortcut menu.

3. Type the name of the formula, and then click OK.

Note:  The formula name is used as the column heading and is limited to 254 characters.

To edit an existing formula

1.   From the View menu, select Field Explorer.

The Field Explorer dialog box appears.

2.   Right-click the formula you want to edit and choose Edit.

The Formula Workshop appears.

3. In the Formula Editor area, edit the formula.

4.   Click the Check toolbar button to identify any errors in the formula.

5. Fix any syntax errors the Formula Checker identifies.

6.   When the formula has the correct syntax, click Save and Close on the Formula Workshop

toolbar.

You return to the Field Explorer dialog box.

Fundamentals of Report Design—Learner’s Guide190

Page 207: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 207/300

To rename an existing formula

1.   From the View menu, click Field Explorer.

The Field Explorer dialog box appears.

2.   Right-click the formula you want to edit and select Rename from the shortcut menu.

3.   Type the new name for the formula, and then press Enter or click off the field.

The formula has been renamed.

Deleting a formula

When a formula is created and added to a report, the Report Designer:

• Stores the specification for creating the formula, using the name you assigned to it.

• Places a working copy of that formula at the point you specify in the report. A working

copy is any occurrence of the formula in the report.

In order to completely delete a formula, you must delete the specification and all workingcopies of the formula. You cannot delete the specification without deleting all working copies

of the formula.

Even after the working copies of a formula have been deleted from the report, the formula

specification remains unchanged. The specification is listed in the  Field Explorer dialog box.

It is available if you want to enter the formula in the report again. A formula cannot be deleted

from this list if it is referenced by another formula on the report.

To delete a formula

1.  In the Report Designer, right-click the formula field you want to delete and select Deletefrom the shortcut menu.

To delete the formula specification

1.   Choose View from the main menu and select Field Explorer.

The Field Explorer dialog box appears.

2.   In the Field Explorer, right-click the formula you want to delete and choose Delete.

Note:  A dialog box appears if this formula is currently in use in a report. If you delete this

formula, you will delete all references of it in reports. Click  Yes to delete.

191Creating Basic Formulas—Learner’s Guide

Page 208: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 208/300

Creating formulas

Creating basic formulas to include in your report will enhance its usefulness. You can create

formulas in Crystal Reports using either Crystal syntax or Basic syntax.

Note:  This course uses Crystal syntax exclusively.

After completing this unit, you will be able to:

• Define the methods to create formulas

•   Create a formula using the Formula Workshop

•   Create a formula using the Formula Editor

Formula creation methods

You can create a formula using these methods:

•   Formula Workshop

You can create most kinds of formulas in the Formula Workshop. The workshop consists

of a toolbar, a tree that lists the types of formulas you can create or modify, and an area for

defining the formula itself.

•   Formula Editor

The Formula Editor is a component of the Formula Workshop. Use the Formula Editor to

create and modify the content of formulas.

•   Formula Expert

The Formula Expert is a component of the Formula Workshop. Use the Formula Expert to

create and modify formulas based on custom functions.

Note:  Only the Formula Workshop and the Formula Editor will be discussed in this course.

Adding comments to a formula

When you create a formula, always include comments in the formula itself. Formula comments

are notes included with a formula to explain its design and operation. Comments do not print

and they do not affect the formula, but they appear in the  Formula Workshop. You can use

comments to explain the purpose of a formula or explain the steps involved in writing it. These

explanations or descriptions of your formulas will help you or others if, after a period of time,

the formula needs to be modified.

Comments begin with two forward slashes (//) and are followed by the text of the comment.Everything that follows the slashes on the same line is treated as being part of the comment.

Creating a formula in the Formula Workshop

There are many ways to access the Formula Workshop. You see it when you add new formula

fields, when you define selection formulas, when you work with custom functions, and so on.

Fundamentals of Report Design—Learner’s Guide192

Page 209: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 209/300

You can open the Formula Workshop by itself before you begin adding specific kinds of

formulas.

Workshop Tree

The Workshop Tree contains folders for each type of formula you can create in Crystal Reports.

It also contains folders for custom functions and SQL Expressions. If the workshop appears asthe result of using a specific command (for example, you’ve selected the Record command on

the Selection Formulas submenu), the appropriate folder in the tree is selected, and the

appropriate version of the Formula Editor appears.

Expand any folder in the tree to see the formulas that already exist. New formulas can be added,

and existing formulas can be edited or deleted as needed.

Tip:   The Workshop Tree can be docked. By default, it appears docked on the left-hand side

ofthe Formula Workshop, but youcan manually dock it on the right-hand side.In free-floating

mode, the Workshop Tree can be dragged to any location in the workshop.

Formula Workshop buttons

The main toolbar in the Formula Workshop is made up of three smaller toolbars. Each of these

toolbars contains a set of buttons that is relevant to specific actions: working with the Formula

 Workshop as a whole, working with the Workshop Tree, or working with an editor. Individual

buttons are available or unavailable based on the task you are undertaking. Each toolbar can

be moved and docked as you require.

The buttons for the General toolbar of the Formula Workshop perform the following functions:

Save and Close: Closes the Formula Workshop after prompting you to save thechanges. If you save changes, your formula is checked for errors.

Save: Saves the formula, SQL Expression, or custom function.

New: Creates a new formula of the typeselectedfromthe list. Also usedto createa new custom function or SQL Expression.

Hide/Show workshop tree: Shows or hides the Workshop Tree.

Toggle properties display: Toggles display between Custom Function Editor

and Custom Function Properties dialog box. Custom functions and formulas(where possible) are displayed in the selected mode until the button is clickedagain.

Use Expert/Editor:

Opens the Formula Expert.Usethe Formula Expert to help you create

a formula based on a custom function.

Note:  This button is not available when creating a custom function.

Help: Opens online Help for the Formula Workshop dialog box.

193Creating Basic Formulas—Learner’s Guide

Page 210: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 210/300

The buttons for the Workshop Tree toolbar of the Formula Workshop perform the following

functions:

Duplicate: Makes a copy of the formula that you have selected. When the copyis created, you can rename it and edit it.

Rename: Lets you rename the selected formula, custom function, or SQLExpression.

Delete: Deletes the selected formula, custom function, or SQL Expression.

Expand Node: Expands or collapses the selected node in the  Workshop Tree.

Also works with multiple node selections.

Show Formatting Formula Nodes Only: Shows or hides report object nodes in

the Formatting Formulas folder if the objects do not have formulas associatedwith them.

Add to Repository: Opens the Add Custom Function to Repository dialog boxso you can select a repository to add the custom function to.

Add to Report: Adds the selected repository custom function to the report.

The buttons for the Expressions Editor toolbar of the Formula Workshop perform the following

functions:

Check: Tests the syntax of the formula or custom function and identifies syntaxerrors if they are found.

Undo: Undoes the last action performed.

Redo: Redoes the last action.

Browse Data: Whenyou selecta field from the Report Fields window and clickthe Browse Data button, a dialog box appears with a list of the values for the

selected field.

View values for the selected field and select individual values to

insert into your formula.

Note:  This button is not available for custom functions.

Find or Replace: Searches the Formula Editor for a specified word, number, orformula string.

Toggle Bookmark: Inserts a bookmark at the beginning of a selected formulaline. Click the button again to remove the bookmark.

Next Bookmark: Jumps to the next bookmark.

Fundamentals of Report Design—Learner’s Guide194

Page 211: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 211/300

Previous Bookmark: Jumps to the previous bookmark.

Clear All Bookmarks: Deletes all bookmarks in the current formula.

Sort trees: Arranges all Report Fields, Functions, and Operators trees inalphabetical order.

Field tree:

Hides or views the Report Fields tree.

Note:  This button is not available for custom functions.

Function tree: Hides or views the  Functions tree.

Operator tree: Hides or views the Operators tree.

Find results: Hides or views the result set of a global formula search.

Syntax: Allows you to select Crystal syntax or Basic syntax as your formulasyntax.

Allows you to select Exceptions For Nulls or Default Values For Nulls  as amethod for dealing with null values in your data.

Comment/Uncomment: Comments out the highlighted selection of a formula.Commented lines are not evaluated as part of the formula.

When writing formulas, remember these considerations:

•   The online Help file contains explanations and examples of all functions within Crystal

Reports. This file can be accessed from the menu as well as the Help icon on the toolbar in

the Formula Editor. Within the online Help, you can select the Index tab and enter the name

of a function. The program returns an explanation of the function you entered.

• If you need the search and replace functionality within the Formula Editor, you can click

the Find or Replace icon on the toolbar in the  Formula Editor. Select the Edit Text search

option to access the search and replace functionality.

• You can create new formulas quickly within the Formula Workshop by clicking the New

button on the Formula Workshop toolbar.

•   You can switch between formulas by navigatingthrough the Workshop Tree on the left-handside of the Formula Workshop.

• You can change the default syntax type for Crystal Reports formulas when you select the

formula language syntax from the list in the Reporting tab of the Options dialog box under

the File menu. This setting is a global option; however, you can still change the formula

syntax for your formulas on an individual basis in the  Formula Workshop.

195Creating Basic Formulas—Learner’s Guide

Page 212: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 212/300

To access the Formula Workshop

1.  On the Report menu, click Formula Workshop.

Alternately, you can click the Formula Workshop button on the Expert Tools toolbar.

The Formula Workshop appears.

2.   Click the drop-down arrow on the New button and select the type of formula you want to

create.

The appropriate editor or dialog box appears.

Creating a formula in the Formula Editor 

The Formula Editor is a component of the Formula Workshop. Using the Formula Editor,you

combine fields, operators, and functions together to create a working formula. The Formula

Editor enables you to type the components of the formula directly.

Select the various functions, operators, group field values, and other formulas from the available

lists. By double-clicking the item, Crystal Reports inserts it into the formula for you. In the

Formula Editor, you can customize your settings with dockable and resizable frame windows,

bookmarks, drag anddrop, and search and replace. The Formula Editor has four main windows:

Description of contentsWindow

Report fields contain all database fields accessible for your report.

They also contain any formulas or groups already created for the

report.

Report Fields

Functions are prebuilt procedures that return values. They

perform calculations such as average, sum, count, sin, trim, anduppercase. Custom functions are also listed in this window.

Functions

Operators are the "action verbs" you use in formulas. They

describe an operation or an action to take place between two or

more values. Examples: add, subtract, less than, and greater than.

Operators

Fundamentals of Report Design—Learner’s Guide196

Page 213: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 213/300

Description of contentsWindow

Area where you create a formula.Formula text window

Note:   Use File   ➤ Options ➤ Formula Editor tab to set the default text font and font size.

To create a formula using the Formula Editor 

1.  In the Formula Workshop, click New ➤ Formula.

2.   In the Formula Name dialog box, enter the name you want to identify the formula, and then

click OK.

The Formula Editor appears inside the Formula Workshop.

3. Enter the formula by typing in the components or selecting them from the component trees.

Tip:

• Ctrl + Space brings up a list of available functions. If you have already started typing, it

brings up a list of keywords that are possible matches for what you have already typed.

• A list of available fields automatically appears when you enter an open brace bracket.

Ctrl + Space brings up the list again if you previously pressed  Esc to clear it.

4.   Click Check to identify any errors in the formula.

5.   Fix any syntax errors the Formula Checker identifies.

6.   When the formula has the correct syntax, click Save and Close  on the Formula Workshop

toolbar.

7.   In the Field Explorer, select (single-click) the formula, click  Insert to Report, and thenposition the cursor where you want the formula to appear on your report.

8. Click once to set the field in the desired position on the report.

A formula that is placed on a report is indicated by @ (for example, @ProcessTime) on the

Design tab.

Note:  You can also use drag-and-drop to add a formula to your report.

197Creating Basic Formulas—Learner’s Guide

Page 214: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 214/300

Applying Boolean formulas

Boolean formulas incorporate the operators and, or, and not and are used when you want to

signal a condition of true or false.

After completing this unit, you will be able to:

• Describe a Boolean formula

• Create a Boolean formula

Boolean formulas

A Boolean formula always returns a value of True or False. The result of a Boolean formula

can be displayed as:

• True or False

• T or F

• Yes or No• Y or N

• 1 or 0

You can change how a Boolean value displays in your report by right-clicking the value and

selecting the Format option. You then have the option to display it as 1 or 0, Y or N, Yes or No,

True or False, or T or F.

You can use Booleans to check for conditions within a field. For example, to determine whether

an order amount matches a certain condition, you would write a formula like this:

{Orders.Order Amount} > 5000

Creating a Boolean formula

Boolean operators are used to create conditions that require a logical relationship between two

or more values. Conditions that use Boolean operators are called Boolean expressions.

• A and B means that both A and B must be true for the condition to be satisfied (to return a

True value).

• A or B means that either A or B (or both) must be true for the condition to be satisfied (to

return a True value).

Several useful examples of Boolean operators are:

• And

• Or

• Not

 And 

The And operator joins the value of x and y. The And operator takes two expressions that evaluate

to a Boolean. The expression evaluates True only if both x and y are true. All other combinations

result in a value of False.

Fundamentals of Report Design—Learner’s Guide198

Page 215: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 215/300

x and yValue of yValue of x

TrueTrueTrue

FalseFalseTrue

FalseTrueFalse

FalseFalseFalse

Some examples include:

DescriptionCode

Returns True, where A = 10, B = 6, and C = 3 (bothconditions are true). Returns False, where A=10, B=6,

and C=7 (only one of the two conditions are true).

A > B and B > C

Returns True, where A = 7, B = 5, C = 3, D = 2, E = 10 (all

three of the conditions are true).

(A>B) and (A * C - D > E)and (E / D <= B)

Or

The Or operator takes two expressions that evaluate to a Boolean. If either expression evaluates

True, the operator returns True. If both expressions evaluate False, the operator returns Falsex and yValue of yValue of x

TrueTrueTrue

TrueFalseTrue

TrueTrueFalse

FalseFalseFalse

199Creating Basic Formulas—Learner’s Guide

Page 216: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 216/300

Some examples include:

DescriptionCode

True, where A = 10, B = 6, and C = 3 (both conditions true).A > B or B > C

True, where A=10, B=6, and C=7 (either one of the two

conditions true).A > B or B > C

False, where A=5, B=6, and C=7 (neither of the two conditions

true).A > B or B > C

Tr u e,w h e r eA= 5 ,B= 5 ,C = 3 ,D = 2 ,E= 1 2 [ a tl e a s ton eof th e

three conditionsis true. In thiscase only(A * C - D > E)is true].

(A > B) or(A * C - D > E) or(E / D<= B)

 Not

The Not operator reverses the True or False value of x.

Not xValue of x

FalseTrue

TrueFalse

• Not (Not(False)) = False

• Not (Not(True)) = True

Some examples include:

DescriptionCode

If A=5, B = 4, C = 3, the expression (A>B and B>C) is True.

Both conditions tied together by the Boolean operator Andnot (A > B and B > C)

are True; thus, the entire statement has a value of True. The

Not operator changes the value of the expression to False.

If A=3, B = 4, C = 3, the expression (A>B and B>C) is False.

One of the two conditions tied together by the Booleannot (A > B and B > C) operator And is False; thus, the entire statement has a value

of False. The Not operator changes the value of the

expression to True.

Fundamentals of Report Design—Learner’s Guide200

Page 217: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 217/300

Activity: Applying a Boolean formula

Objective

• Create a Boolean formula.

Instructions

1. Open Basic Formulas-1.rpt as the starting point report for this activity.

2.   If you want to see the entire report in a horizontal view, click File   ➤ Page Setup, and then

select Landscape.

3. Add a Boolean formula named Check for USA, that evaluates the data in the Country field

and determines if it is equal to USA.

4. Preview the report.

5.   Either True or False should be displayed in the Check for USA field.

6.   Format the Check for USA formula to display Yes or No rather than True or False.7.  Use the Format Painter to format the column heading to be vertical text, that is, rotate the

text.

8. Save the report as Applying a Boolean formula.rpt.

9.   Add the report into the folder in the Workbench.

Your report should look similar to this example.

201Creating Basic Formulas—Learner’s Guide

Page 218: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 218/300

Applying If-Then-Else formulas

The If-Then-Else type formula is a conditional formula. That is, if a condition is met, then a

certain action will be taken. If the condition is not met, then some different action takes place.

After completing this unit, you will be able to:

• Describe an If-Then-Else formula

• Create an If-Then-Else formula

If-Then-Else formulas

If-Then-Else formulas can check for as many conditions as required in order for you to achieve

the results you need.

If-Then-Else formulas have three parts:

• If sets the condition or test.

• Then sets the action to be taken if the condition is met, that is, if the test returns a true value.• Else is optional. It sets the action to be taken if the condition is not met, that is, if the test

returns a false value.

Creating an If-Then-Else formula

Suppose you want to display a rating beside each customer’s order figures in an orders report

depending on the level achieved: high orders or low orders. You can accomplish a task such

as this by using an If-Then-Else formula.

If {Orders.Orders Amount}>40000Then

"high orders"Else "low orders"

Tip:  The data type must be the same for the Then and Else parts of the formula (text, numeric,date). For example, if the Then part of the formula prints a text string, the Else part of the formulamust also print a text string.

Activity: Applying an If-Then-Else formula

Objective

• Create an If-Then-Else formula.Instructions

1. Use the Applying a Boolean formula.rpt.

2. Add the formula, Domestic or International, which displays “Domestic” beside Country

equal to USA and “International” beside all others.

3. Format the column heading to be vertical text, that is, rotate the text.

Fundamentals of Report Design—Learner’s Guide202

Page 219: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 219/300

4. Save the report as Applying an If-Then-Else formula.rpt.

5.   Add the report into the folder in the Workbench.

Your report should look similar to this example.

203Creating Basic Formulas—Learner’s Guide

Page 220: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 220/300

Applying date calculations

A database field can contain a date value, which is recognized as date only, time only, or

date-time.

After completing this unit, you will be able to:

• Describe a date calculation

• Create a date calculation

Date calculation

Date functions allow you to convert numbers to dates, which you then can format to display

as appropriate, and to convert dates to numbers.

Creating a date calculation

Examples of calculations using date or date/time fields are:

• Current date function

• Addition and subtraction

• Year, month, and day functions

Current date function

To have today’s date appear on a report, use the current date function. For example, to display

today’s date in your report, you would write this formula:

CurrentDate

Addition and subtraction

You can add days to date fields by adding a number. For example, if you know an order should

be shipped five days after the order was placed, you would find the expected ship date with

this formula:

{Orders.Order Date} + 5

If the Orders.Order Date was January 10, then this formula would return January 15.

You can also subtract days from date fields by subtracting a number. For example, if you want

to find the number of days it took to ship an order, if the order date was five days prior to the

ship date, you would use the formula:

{Orders.Order Date} - 5

If the Orders.Order Date was January 10, then this formula would return January 5.

The most useful application of these concepts is finding the difference in days between two

date fields. For example, if you want to find the number of days it took to ship an order, you

would use this formula:

{Orders.Ship Date} - {Orders.Order Date}

Fundamentals of Report Design—Learner’s Guide204

Page 221: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 221/300

If the Orders.Ship Date was January 20 and the Orders.Order Date was January 10, then this

formula would return 10 days.

 Year, month, and day functions

At times, you may need to extract the year, month, or day portions from a date field. To

accomplish this task, you would use theYear ( ), Month ( ), or Day ( ) function. For example,if you were looking for monthly trends in your ordering cycle, you could use the Month ( )

function to extract the month portion of your order date fields using this formula:

Month ({Orders.Order Date})

If the Orders.Order Date was January 10, then this formula would return 1.00.

Tip:  Commas and decimal places are the default display for numbers in Crystal Reports.

Activity: Applying date calculations

Objective

• Create date calculation formulas.

Instructions

1. Use the Applying an If-Then-Else formula.rpt.

2.  Add a formula named Order Process Time that displays the number of days to process

each order from the time it was ordered to the time it was shipped.

3.   Format the Order Process Time to display with no decimal places.

4.  Add the formula, Month Ordered, which displays the month in the form of a number 1 to

12. This formula is useful if you want to establish trends of the busiest order months over

several years.

5.   Format Month Ordered to display with no decimal places.

6.  Add the formula, Days Since Shipped, which displays the number of days between the

ship date and today. The values returned by this formula will change due to the current

date on the actual computer being used.

7. Format Days Since Shipped to display with no decimal places.

8.   Remove the Country group.

9. Save the report as Applying date calculations.rpt.

10.Add the report into the folder in the  Workbench.

205Creating Basic Formulas—Learner’s Guide

Page 222: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 222/300

Your report should look similar to this example.

Fundamentals of Report Design—Learner’s Guide206

Page 223: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 223/300

Applying numeric calculations

Some fields contain numeric data that can be used in calculations.

After completing this unit, you will be able to:

• Describe a numeric calculation• Create a numeric calculation

Numeric calculations

Formulas using numeric fields perform mathematical computations on your data.

Creating a numeric calculation

Numeric calculations can include:

• Arithmetic• Sum

• Count

• Distinct count

Arithmetic

Some arithmetic operators available for use in a formula are:

• addition (+)

• subtraction (-)

• multiplication (*)

• division (/)

For example, youcan use the multiplication symbol to find the sales tax charged on a particular

order. If you wanted a sales tax amount of 7% on order amount field, the formula would look

like this:

{Orders.Order Amount} * .07

Sum(number, field)

Summary fields are normally created using the Insert Summary dialog box. They then appear

in the Available Fields tree, and can be used in a formula by double-clicking there. However,

they do not need to be created in this way. You can create a summary field exclusively for use

by your formula by appropriately filling in the argumentsto oneof thefunctions in theSummary

functions section. However, any groups in the report that the summary field refers to must

already exist in the report.

For example, two variations of the Sum functions are:

• Sum ({Orders.Order Amount})

Returns a total of all order amounts for the entire report.

• Sum ({Orders.Order Amount}, {Customer.Region})

207Creating Basic Formulas—Learner’s Guide

Page 224: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 224/300

Returns a total of the order amounts for each region.

Tip:  A number of options exist for summarizing your data. Sum( ), Count ( ), and Average

( ) are the most common. Refer to Summary Functions in the online Help for moreinformation.

Count

This function enables you to count the values that appear in your report (for a specified field).

Some examples include these scenarios:

• If a sales report includes all orders made and the amount of each order, you can compute

the total number of orders that appear on the report (a grand total count).

• If you break orders into groups (for example, orders grouped by the region that they come

from), you can compute the number of orders per group (in this example, per region).

• If you break orders into date or Boolean groups (for example, orders grouped by the month

in which they were placed), you can compute the number of orders per group based on a

particular change in the date or Boolean field (in this case, per month).

DistinctCount

This function enables you to get a distinct count of the values that appear in your report. A

distinct count means that duplicate records are not used in the calculation.

Some examples include:

• If a sales report includes all orders made by customers, you can compute the total count of

distinct customers in the report (as grand total distinct count), excluding any duplicate

records. If a customer made more than one order, the duplicate occurrences of that customer

are ignored.

• If you break orders into groups (for example, orders grouped by the region that they come

from), you can compute the count of distinct customers per group (in this case, per region).

Any customers that made more than one order and appear more than once in a group areonly counted once.

• If you break orders into date or Boolean groups (for example, orders grouped by the month

in which they were placed), you can compute count of distinct customers in each group

based on a particular change in the date or Boolean fields (in this case, the count of customers

that placed orders each month). If a customer placed more than one order within the month,

duplicate instances of that customer are ignored.

Activity: Applying numeric calculations

Objective

• Create numeric calculation formulas.

Instructions

1. Use the Applying date calculations.rpt.

2.  Group on the Customer Name, that is, {Customer.Customer Name}.

Fundamentals of Report Design—Learner’s Guide208

Page 225: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 225/300

Page 226: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 226/300

Page 227: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 227/300

Concatenation

When you want to join two or more components together to form a singular continuous string,

you would use one of the these concatenation symbols:

• &

Enables you to join fields of different data types.

• +

Enables you to join string fields.

For example, if you want to add descriptive text to your data field, you would write the formula:

"This product was shipped on" & {Orders.Ship Date}

Uppercase(string) and Lowercase(string)

When you want to convert all letters in a string field to a specific case, you use the Uppercase

( )or Lowercase ( ) functions. For example, to convert all customer names to uppercase, you

would write the formula:Uppercase ({Customer.Customer Name})

This example would return EDWARD SMITH, where the customer name is Edward Smith.

Left (str, length)

The Left function consists of a text string (str) and length (length) and obtains a certain

number of characters from the left end of a text string. For instance, you could use the Left

function to obtain just the area code from the values in a field containing phone numbers. You

would write the formula:

Left ({Customer.Phone}, 3)

This formula would retrieve the first three numbers from the phone number, which is typicallythe area code.

 Mid (str, start) or Mid (str, start, length)

The Mid function returns a specified number of characters from a string. The second argument

is the character position where the part to be taken begins. The optional third argument is the

length of the string you want to be taken out. If the third argument is not specified, everything

from the start position to the end of the string is extracted. Use this function when you need

to extract a set of characters from somewhere in the middle of a text string. For example, you

may need to extract the middle two characters of a field as an identifier for customers.

Mid({Customer.CustomerName}, 3, 2)

This formula returns a two-character substring from the inside of the string starting with the

third character position. In the case of Alley Cat Bikes, the identifier is “le”.

Right (str, length)

The Right function extracts the given number of text characters from the right side of the

specified string. Use this function to obtain just the right part of the string. For example, you

211Creating Basic Formulas—Learner’s Guide

Page 228: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 228/300

Page 229: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 229/300

Your report should look similar to this example.

213Creating Basic Formulas—Learner’s Guide

Page 230: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 230/300

Debrief: Creating basic formulas

Review the formulas created in this lesson.

SyntaxName

{Customer.Country}="USA"Check for USA

if {Customer.Country}="USA" then "Domestic" else

"International"Domestic or International

{Order.Ship Date} - {Orders.Order Date}Order Process Time

month({Orders.Order Date})Month Ordered

currentdate - {Orders.Ship Date}Days Since Shipped

{Orders.Order Amount} * 1.07Order Plus Tax

Sum({Orders.Order Amount})GT Order Amount

Sum({@Order Plus Tax})GT Order Amount Plus Tax

Sum({Orders.Order Amount}, {Customer.CustomerName})ST Order Amount

Sum({@Order Plus Tax}, {Customer.CustomerName})ST Order Amount Plus Tax

{Customer.CustomerName} [1]1st Customer Letter

UpperCase ({Customer.CustomerName})Uppercase Customer Name

"The subtotal for " & {Customer.CustomerName} & " is

"& {@ST Order Amount} & "."Display Subtotal

Fundamentals of Report Design—Learner’s Guide214

Page 231: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 231/300

Lesson 8

Applying Conditional Reporting

Lesson introductionYou can easily apply absolute or conditional formatting, which is applied only under certain

conditions.

After completing this lesson, you will be able to:

• Determine trends in data

• Format data conditionally

215 Applying Conditional Reporting—Learner’s Guide

Page 232: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 232/300

Determining trends in data

When you want to highlight certain information in a report in order to perform an analysis of

the data, you can quickly establish trends in the data by using the Highlighting Expert.

After completing this unit, you will be able to:

• Use the Highlighting Expert

Using the Highlighting Expert

The Highlighting Expert enables you to apply conditional formatting to all types of report

fields (Number, Currency, String, Boolean, Date, Time, and Date and Time fields). With the

expert, you format the selected field either by specifying a condition based on that field’svalue,

or by specifying a condition based on the value of a different report field.

When used for conditional formatting, the Highlighting Expert allows you to:

• Modify several attributes at once, without writing a formula.• Highlight all field types used in the report.

• Format font style, background color, font color, and border style.

• Format a field based on its own values or the values of another field.

Conditionally formatting fields using the Highlighting Expert

When you need to conditionally format report fields, the Highlighting Expert is quicker and

easier to use than the Formula Workshop. The Highlighting Expert is most commonly used

to highlight field values that are in some way distinguished from other values in the report.

You might, for example, highlight your key customers by printing the{Customer.Last Year’s

Sales} field with a red background whenever the sales value exceeds $50,000. Alternatively,

to draw attention to outstanding orders, you might bold the {Product.Product Name} field

whenever the {Orders.Shipped} value is False.

Tip:  You can undo highlighting with the Undo button on the Standard toolbar to cancel theformatting.

Think of the Highlighting Expert as an advanced formula editor that runs the following

equation: If condition is True, then apply these formatting specifications. For this purpose, the

dialog box is divided into two sections, the Item list section, which displays the formula, and

the Item editor, which enables you to set the formula. The Item editor includes a Sample view

to illustrate the formatting specifications applied.

Fundamentals of Report Design—Learner’s Guide216

Page 233: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 233/300

You can create formulas with this dialog box. Each formula appears in the Item list. You can

use the Remove and Remove All buttons to delete formulas as well as use the  Priority arrow

buttons to specify the order of priority for each formula.

Tip:  The changes in the formatting are seen in the  Preview window only.

Setting highlighting priorities

The Priority buttons in the Item list area of the Highlighting Expert allow you to set priorities

for your formulas. This is useful when youhave two or more formulas that could offer conflictingresults in some situations.

For example, suppose that you highlight the Unit Price field on the report. You assign to this

field a highlighting formula that shows a yellow background when a unit price is greater than

$100. Then, on this same report, you create another highlighting formula that shows a red

background when a unit price is greater than $200. Considering that 100 is a subset of 200, you

could have Unit Price fields with yellow backgrounds when, in fact, those fields should have

red backgrounds. In other words, a unit price of $300 could receive either a red or a yellow

background, depending on which formula has been assigned priority.

To use the Highlighting Expert

1.   Right-click the field you want to format and select Highlighting Expert from the shortcut

menu.

You can also start the expert by clicking the Highlighting button on the Expert Tools toolbar,

or by clicking Highlighting Expert on the Format menu.

When opened, the expert is set to format the field that is currently selected on the report.

217 Applying Conditional Reporting—Learner’s Guide

Page 234: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 234/300

2.  In the Highlighting Expert, click New to create a new conditional formula with default

settings.

3.  In the Item editor area, click the Value of list drop-down arrow and select the field that

you want to base your condition on.

The field chosen here is the field upon which your condition is based; this field need not be

the field that is being formatted. To create a condition based on the values of the field that

is being formatted, select the desired field from the list. To base your condition on a different

report field, select it from the list of available fields. The  Value of list displays only those

fields that you have added to the report.4. Select a comparison from the second list (is equal to, is less than, and so on).

This comparative statement works as the operator in the conditional formula created by the

expert.

5. Complete the condition by entering the desired value in the box.

Note:  If the field selected in the  Value of  list is not numeric, the text box turns into a list

of available values, from which you must select one.

6.   In the Font style, Font color, Background, and Border lists, specify the formatting changes

that you want to apply to the selected field when your condition is met.7. Repeat steps 3 and 4 if you want to apply multiple highlighting conditions to the selected

field.

Note:  You can use the expert’s Remove button to delete highlighting formulas from the

list.

Fundamentals of Report Design—Learner’s Guide218

Page 235: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 235/300

8.  Use the Priority arrows to specify the order in which you want Crystal Reports to apply

your conditions.

Note:  A formula has priority over another formula when it is higher in the Items list area.

9. Click OK to return to your report.

Activity: Using the Highlighting Expert

Objective

• Use the Highlighting Expert to determine trends in data.

Instructions

1. Use the Conditional Reporting-1.rpt starting point report.

2. Add highlighting that displays the order amount in red if the order amount is $100.00 or

less and blue if it is greater than or equal to $5,000.00.3. Add purple highlighting for the order amount that is greater than or equal to $10,000.00.

Note:  There should be three colors when done; however, you won't see all three colors until

you change the priority of the highlighting. Move to the second page to view the results for

all three colors.

4. Save the report as Using the Highlighting Expert.rpt.

5.   Add the report into the folder in the Workbench.

219 Applying Conditional Reporting—Learner’s Guide

Page 236: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 236/300

Your report should look similar to this example.

Fundamentals of Report Design—Learner’s Guide220

Page 237: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 237/300

Formatting data conditionally

Conditional formatting is formatting that applies only under certain conditions that you set.

After completing this unit, you will be able to:

• Describe conditional formatting• Apply on or off properties

• Apply attribute properties

• Apply conditional formatting functions

Conditional formatting

Absolute formatting is formatting that applies under any condition and is used when you want

the same result in all situations. When you need to format objects only in certain cases or apply

the formatting differently for different situations, you use conditional formatting.

With absolute formatting, you follow a “select then apply” procedure. You select the field andapply the formatting. For conditional formatting you follow the same general procedure, but

you go a step further and set conditions that determine whether or not the formatting will be

applied. You specify those conditions using simple formulas. You can apply formatting based

on a condition any time the conditional button appears beside an option. For example,

conditional formatting can be used to display negative amounts in red or to suppress a field

only in a certain situation.

Conditional formatting takes precedence over fixed settings. For example,you may have applied

absolute formatting to the font color of the sales field to appear in blue. If you then conditionally

change the color of the sales field to red if negative and black in all other cases, this change

overrides the original setting. The sales field will appear in red or black in the Preview window

only.

Tip:  Each time you see the formula button next to a property or attribute, that property or attributecan be conditionally formatted.

A conditional property tests to see which of two or more conditions was met and applies the

formatting appropriate to the condition. How you conditionally format an attribute differs

between on or off properties and attribute properties.

Applying on or off properties

An on or off property uses a check box. When the check box is turned on, the property isalways

applied. When the check box is turned off, the property is never applied. The  Drop Shadowproperty for a Border is an example of an on or off property. When you conditionally apply

an on or off property, the program applies the attribute when the condition is met and does

not apply the attribute when the condition is not met. Therefore, to set an on or off property,

you must create a Boolean formula that returns yes for every value to which you want to apply

the attribute. Whenever the result of the formula is no, the attribute is set to off.

221 Applying Conditional Reporting—Learner’s Guide

Page 238: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 238/300

To apply on or off properties

1. In the report, right-click the field you want to format.

2.   On the shortcut menu, click Format Field.

The Format Editor dialog box opens.

3. Click the appropriate tab.

4. Click the conditional formatting button beside the option you want to change.

5. Type a formula as the condition.

6.   Click Save and Close.

The condition button changes color from blue to maroon, indicating a condition has been

set.

7. Click OK.

Applying attribute properties

A conditional attribute property tests to see which of two or more conditions is met. The

program then applies the formatting appropriate to the condition. For example, assume that

you want values under quota printed in red and all other values printed in black. The program

tests to see whether the value is under quota or not. If it is under quota, then it applies the red

attribute; if it is not, then it applies the black attribute.

Use an If-Then-Else formula for this kind of conditional formatting.

When conditional attribute properties are set up, Crystal Reports loads a selection of attributes

into the Functions list in the Formula Workshop. Double-click any of these attributes to add

them to a formula. For example, if you are setting horizontal alignment conditionally, the

Functions list contains attributes such as DefaultHorAligned, LeftAligned, and Justified. If

you are setting borders conditionally, the  Functions list contains attributes such as NoLine,

SingleLine, and DashedLine.

Note:  Always include theElse keyword in conditional formulas; otherwise, values that don’t meetthe If condition may not retain their original format. To retain the original format of values thatdon’t meet your If condition, use the DefaultAttribute function.

The program tests each record to see which of two or more conditions was met and applies the

formatting appropriate to the condition. All attribute property options are listed within the

Format Formula Editor for your use.

The ability to conditionally format fields and objects gives you more control over the presentation

of your data in the report.

Fundamentals of Report Design—Learner’s Guide222

Page 239: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 239/300

Applying conditional formatting functions

Conditional formatting functions are found at the top of the Functions tree in the Formula

 Workshop whenever appropriate. You can create morecomplex conditional formatting formulas

in the Formula Workshop using these built-in procedures or subroutines.

Two useful examples of conditional formatting functions are:• CurrentFieldValue

This function is available only when entering field formatting formulas. The field can be

any type (string, number, Boolean, date, and so on). CurrentFieldValue returns the current

value of the field about to be printed and is especially useful when conditionally formatting

cross-tabs. For example, the formula if CurrentFieldValue = 0 then Red can be used to

format the font color in a cross-tab. This function depends on context (that is, if formatting

a string field, then CurrentFieldValue is a string type; if formatting a date field, then

CurrentFieldValue is a date type, and so on).

• DefaultAttribute

This function is available when entering formatting formulas including section formatting

formulas,text object formatting formulas,and so on. The value returned byDefaultAttributedepends on the value selected for the attribute being formatted. For example, if you create

a formatting formula for the font color, and the font color combination box is set to blue,

then DefaultAttribute is blue. If you create a formatting formula for a Boolean attribute

such as Suppress,andif Suppress is checked, then theDefaultAttribute is true. If Suppress

is not checked, then the DefaultAttribute is false. This function depends on context (that

is, it may be a Boolean type, a string type, and so on).

To apply an attribute property

1. In the report, right-click the field to format and select Format Field  from the shortcut menu.

2. Click the appropriate tab and add a formula by clicking the conditional formatting button

next to the option you want to change.

Note:  You can also use summary values as conditions. For example, you could change the

font color to red if the value is less than the average for the group:

 if {Customer.Last Year’s Sales} <Average({Customer.Last Year’s Sales},{Customer.Region}) then Red Else DefaultAttribute

3.   Click OK to return to the report.

Activity: Formatting data conditionally

Objective

• Apply conditional formatting to a report.

223 Applying Conditional Reporting—Learner’s Guide

Page 240: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 240/300

Page 241: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 241/300

Quiz: Applying conditional reporting

1. When you need to format objects only in certain cases or apply formatting differently for

different situations, you use .

2. What type of formula do you need to create when you set an on or off property?

3. What type of formula do you need to create when you apply an attribute property?

4. When would you use a conditional formatting function?

225 Applying Conditional Reporting—Learner’s Guide

Page 242: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 242/300

Page 243: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 243/300

Page 244: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 244/300

Creating a chart

Many people find it easier to understand information if it is presented graphically.

After completing this unit, you will be able to:

• Choose a chart location and type•   Create a chart using the Chart Expert

• Chart on summary data

• Chart on details or formula information

• Customize a chart

Choosing a chart location and type

Crystal Reports enables you to include sophisticated, colorful charts in your reports. You can

use charts any time to improve the usefulness of a report.

You can chart on:• Summary and subtotal fields

• Details, formula, and Running Total fields

• Cross-Tab summaries

• OLAP data

You will typically chart on summary and subtotal information at the group level. Each chart

becomes an object on your report, and therefore can be moved, resized, and so on.

Not all chart styles work with all data. For example, a report that shows the total sales for each

state would make a good pie chart but a meaningless stacked bar chart, since only one series

of data exists. On the other hand, if you had a report that showed inventory levels of certain

items for each quarter of the year, that information would make an excellent stacked bar chart,but not work in a single pie chart.

Where you place your chart determines what data is displayed and where it is printed. For

example, if you place a chart in the Report Header section, the chart includes data for the entire

report. If you place it in a Group Header or Group Footer section, the chart displays

group-specific data.

Inserting a chart using the Chart Expert

The Chart Expert dialog box allows you to choose the type of chart to display, select the data

on which the chart is based, apply conditional color highlighting, as well as customize theoptions and formatting for the chart.

Using the Chart Expert

The Chart Expert is a tabbed dialog box. As you work through each tab, be aware that some

options are not for use with some types of chart.

The tabs in the Chart Expert are:

Fundamentals of Report Design—Learner’s Guide228

Page 245: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 245/300

•   Type

•   Data

•   Axes

•   Options

•   Color Highlight

•   Text

To insert a chart using the Chart Expert

1.  On the Insert menu, click Chart.

Another way to do this is to click the Insert Chart button on the Insert Tools toolbar.

An insertion frame appears.

2. Position the top-left corner of the frame in the target location for the new chart. Click once

to insert the chart.

Depending on where you place the chart, the Chart Expert opens automatically or you mayneed to right-click the chart once it is placed and select the  Chart Expert from the shortcut

menu.

You can customize the chart according to your needs.

3. Click OK after you have finished customizing the chart.

Exploring the Type tab

The first tab in the Chart Expert offers different predefined chart styles to choose from. To

select a particular style, double-click the icon for the desired report.

229Representing Data Visually—Learner’s Guide

Page 246: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 246/300

The most common chart types are:

•   Bar

A side-by-side bar chart displays a series of vertical bars and is best suited for showing data

for several years over a period of time. A stacked bar chart also displays data as a series of

vertical bars and is best suited for representing three series of data with each series displayed

as a different color stacked in a single bar.•   Pie

A pie chart displays data as a pie, split and filled with color or patterns, and can only be

used with one group of data.

Other chart types include:

•   Line

A line chart displays data as a series of points connected by a line and is best suited for

showing data for a large number of groups.

•   Area

An area chart displays data as areas filled with color or patterns and is best suited for

showing data for a limited number of groups.

•   Doughnut

A doughnut chart is similar to a pie chart, displaying data as sections of a circle or doughnut.

If, for example, you charted sales by region on a particular report, you would see the total

number of sales (the figure) in the center of the doughnut and theregions as colored sections

Fundamentals of Report Design—Learner’s Guide230

Page 247: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 247/300

of the doughnut. As with the pie chart, you have the option to choose multiple doughnut

charts for multiple groups of data.

•   3D Riser

A 3D riser chart displays data in a series of three-dimensional objects, lined up side by side

in a three-dimensional plane. The 3D riser chart shows the extremes in your report data.

For example, the difference in sales between countries is visually dynamic when presentedin this chart.

•   3D Surface

A 3D surface chart presents a topographic view of multiple sets of data. If, for example, you

need a chart to show the number of sales by customer by country in a visually dynamic and

relational format, you would use a 3D surface chart.

•   XY Scatter

An XY scatter chart is a collective of plotted points that represent specific data in a pool of

information. The XY scatter chart enables you to consider a larger scope of data for the

purpose of determining trends. For example, if you input customer information, includingsales, products, countries, months, and years, you would have a collective of plotted points

that represents the pool of customer information. Viewing all of this data on an XY scatter

chart would enable you to speculate why certain products were selling better than others

or why certain regions were purchasing more than others.

•   Radar

A radar chart positions group data, such as customers or countries, at the perimeter of the

radar. The radar chart then places numeric values, increasing in value, from the center of

the radar to the perimeter. In this way, you can determine, at a glance, how specific group

data relates to the whole of the group data.

•   BubbleA bubble chart displays data as a series of bubbles, where the size of the bubble is

proportional to the amount of data. A bubble chart is effective with the number of products

sold in a certain region; the larger the bubble, the greater number of products sold in that

region.

•   Stock

A stock chart presents high and low values for data. With this ability, the stock chart is

useful for monitoring financial or sales activities.

•   Numeric Axis

A numeric axis chart is a bar, line, or area chart that uses a numeric field or a date/time

field as its “On change of” field (instead of a string field). Numeric axis charts provide a

way of scaling your X-axis values, thus creating a true numeric X-axis or a true date/time

X-axis.

•   Gauge

A gauge chart presents values graphically as points on a gauge. Gauge charts, like pie charts,

are typically used for one group of data (for example, the percentage of sales for the entire

inventory).

231Representing Data Visually—Learner’s Guide

Page 248: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 248/300

•   Gantt

A Gantt chart is a horizontal bar chart often used to provide a graphical illustration of a

schedule. The horizontal axis shows a time span, while the vertical axis shows a series of

tasks or events. Horizontal bars on the chart represent event sequences and time spans for

each item on the vertical axis.

•   Funnel

Funnel charts are often used to represent stages in a sales process, for example, the amount

of potential revenue shown for each stage. This type of chart can also be useful in identifying

potential problem areas in an organization’s sales processes. A funnel chart is similar to a

stacked bar in that it represents 100% of the summary values for the groups included in the

chart.

•   Histogram

A histogram chart shows the frequency of occurrence of data elements in a data set. The X

axis is divided into intervals that denote ranges of data values. Each histogram bar shows

the number of data elements whose value falls into that interval.

Tip:  Not all data ranges work with all chart styles. A summary report showing the total sales foreach region would make a good pie chart. The same report showing the same regions over severalyears would make a good multiple pie chart.

Exploring the Data tab

In the Data tab, you select the chart layout type you want to use.

Fundamentals of Report Design—Learner’s Guide232

Page 249: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 249/300

The charting layout types are:

•   Advanced

Use the Advanced layout when you have multiple chart values or when you do not have

any group or summary fields in the report.

The Advanced chart layout supports one or two condition fields; with these condition fields,you can create a 2D or 3D chart. Other specific functions with the Advanced layout include:

○ Values can be grouped in ascending, descending, or specified order, as well as by Top

N or Sort totals.

○ Values can be plotted for each record.

○ Values can be plotted as a grand total for all records.

○ Charts can be based on formula and Running Total fields.

Note:  You cannot drill down on an advanced chart because the chart is already displaying

all the data for that field.

•   Group

With this option, you can create charts based on any group summary or subtotal values.

Note:  In order to create a chart using the Group layout, you must have at least one group

and at least one summary field in the report.

•   Cross-Tab

The Cross-Tab option is available when a report contains a cross-tab object and enables you

to present the data in the cross-tab graphically. A Cross-Tab chart uses the fields in the

cross-tab for its condition and summary fields.

•   OLAP

On-Line Analytical Processing (OLAP) is a business intelligence tool with the ability toperform “slice and dice” operations for multi-dimensional viewing and manipulation of

data. Use the OLAP layout to chart on an OLAP grid.

Note:  In this training guide, you will learn how to create an advanced chart and a group chart.

Once you have selected your chart type, the appropriate choices are presented within the Data

tab. If you have running totals in your report, you can select running totals fields to display

them in the chart. Also, if you want to chart on all records so that the grand totals display, then

select For all records from the drop-down list on the right side of the dialog box and specify a

chart placement of Once per report. You also select the placement and data in the  Data tab.

Exploring the Axes tab

In the Axes tab, you can specify properties that control the occurrence and frequency of data

that divides axes on your chart.

233Representing Data Visually—Learner’s Guide

Page 250: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 250/300

By default, the data axis is not scaled automatically and always starts at zero. If you turn the

Auto scale check box on, the data axis scales automatically. However, depending on the data,

the data axis may not start at zero.

Exploring the Options tab

On the Options tab, you can set the color of the chart, data points, customize settings, and

choose whether or not to include a legend. If you do include a legend in a pie or doughnut

chart, you can choose to display the data in percentages or in amounts.

Fundamentals of Report Design—Learner’s Guide234

Page 251: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 251/300

Exploring the Color Highlight tab

The Color Highlight tab lets you conditionally apply color based on chart value fields. You

apply a color to the selected item by specifying a condition.

The tab is divided into two areas: The Item list area displays the formula conditions and theItem editor area is where you create the formula conditions.

Note:  If your chart type is line, the chart must have data markers before you can see conditionalformatting. An area chart must have two On change of values for conditional formatting to appear.

235Representing Data Visually—Learner’s Guide

Page 252: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 252/300

Exploring the Text tab

The Text tab lets you specify different titles to be placed on your report explaining the various

components. This tab always presents all options, even though some charts may not use them.

For example, a pie chart would not have a group title or data title as available text options.

Fundamentals of Report Design—Learner’s Guide236

Page 253: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 253/300

If you accidentally exit the Chart Expert, you can return at any time by right-clicking the chart

in your report and selecting Chart Expert from the shortcut menu.

The chart you see inthe Design window is a placeholder that prints the actual chart information

when you switch to the Preview window. Therefore, the chart in the  Design window will

probably be different from what you were expecting based on your data. You can always return

to the Chart Expert to redesign your chart.If you place the cursor over the chart while in the Preview tab,a tooltip with detailed information

appears. For example, a chart that shows sales for different countries would read “USA: Sum

of Customer.1997 Sales: 3410088.85.”

No matter what type of chart you choose, the basic steps to produce a chart are the same.

Charting on summary data

Charting summary and subtotal information (Group layout) is the most common type of chart.

Before you can create a chart, you must have at least one group and one summary or subtotal

in your report. A chart built on summary data offers the benefit of drill-down capability, theability to access multiple summaries with the double-click of a mouse button.

To create a summary chart

1.  On the Insert menu, click Chart.

The Chart Expert appears.

237Representing Data Visually—Learner’s Guide

Page 254: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 254/300

Tip:  Another way to do this is to click the  Insert Chart button on the Insert Tools toolbar.

An insertion frame appears.

2. Position the top-left corner of the frame in the target location for the new chart. Click once

to insert the chart.

Depending on where you place the chart, the Chart Expert opens automatically or you mayneed to right-click the chart once it is placed and select the  Chart Expert from the shortcut

menu.

3. On the Type tab, in the Chart type list, select a chart type and then click the chart subtype

that best illustrates your data.

4. Click the Data tab.

5.  In the Layout area, click Group, if it is not already selected.

6.   In the Data area, in the On change of list, click the group field you want to base your chart

on; then, in the Show list, click the summary field you want to display on your chart.

7.   If the Axes and Options tabs appear, you can customize some of the chart’s properties, suchas the scaling of the axes, the legend, and the data points.

8.   Click the Text tab.

9. Accept the default title information or add new titles to your chart.

10.Click OK.

Your chart is placed in the Header or Footer section of the report, depending on your selection

in Step 6. You may have to refresh your report to preview the finished chart.

When your chart is inserted, it may cover a portion of the report. Move and resize the chart

so that it fits properly within the report.

Drilling down on a chart

Drill-down is a process where the details behind summary information can be revealed by

clicking the summary information contained in a report.

A chart that is based upon summary fields is a candidate for drill-down. For each level of

grouping and summarizing that make up the chart, you can drill down into the data to see the

underlying information that constitutes those totals.

If a chart consists of one or more group fields and you have included a legend, you can drill

down on individual groups through the chart legend. Double-click the cursor on the markers

and text in the legend to view the details about that section of the chart.

For example, on a report showing total sales for each region with a pie chart based on those

subtotals, double-clicking a pie slice opens a drill-down tab showing the individual entries that

make up that subtotal.

When viewing a chart in the Preview window, the cursor changes to a magnifying glass. When

you double-click with this magnifying glass, a new Preview tab opens up and the details behind

that summary are displayed.

Fundamentals of Report Design—Learner’s Guide238

Page 255: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 255/300

You can double-click as many summaries as you want as each one opens its own drill-down

tab.

Note:  You cannot drill down on an advanced chart because the chart is already displaying all thedata for that field.

To drill down on chart information

1.  In the Preview window, scroll your report so you can see your chart.

2. Move the cursor over the body of the chart until the magnifying glass appears.

You should get a magnifying glass over each piece of a pie chart.

3. When you are positioned over the summary information on which you want to drill-down,

double-click with the magnifying glass.

A new drill-down tab is created for the information you clicked.

Tip:  Closing the drill-down tabs does not close the report. However, closing the  Preview

tab closes all drill-down tabs. If you made any changes since the last save and you close thereport, you will be prompted to save those changes.

Activity: Charting on summary data

Objective

• Create a chart that is based on summarized data.

Instructions

1. Create a new report from the Customer and Orders table.

2. Place the Customer Name, Order ID, and Order Amount into the Details section.

3. Insert a group based on the order date and set the group options to be displayed by year.

4. Insert a summary on the order amount per the order date group.

5. Create a bar chart in the report header using the group layout to compare order amount

per year.

6. Give your chart a title of “Order Amounts Per Year.”

7. Preview your report.

8. Drill down to view the 2004 information.

9. Save the report as Charting on summary data.rpt.

10.Add the report into the folder in the  Workbench.

Your report should look similar to this example.

239Representing Data Visually—Learner’s Guide

Page 256: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 256/300

Charting on details or formula information

The Advanced layout enables you to create a chart based on specific values (details or formula

data). Charts are often based on a summary field in your report in which the values plotted in

the chart depend on the values in the summary field. However, you can also create a chart that

does not have a summary field to chart on. Instead, these types of charts use values that appearin the Details section of your report.

To create a details or formula chart, you need to specify:

• Condition

The condition is used to indicate when to plot the point. Each time a point is plotted, it is

plotted at the point representing the corresponding value. For example, a chart showing

last year’s sales for your customers uses the Customer Name field as the condition. Each

time the condition changes (that is, the customer name changes), a point is plotted. You also

have the option of plotting a point for each record, or plotting one point for all records.

• Value

The value is used to indicate what is plotted as the points on your chart. Each time a point

is plotted, it is plotted at the point representing the corresponding value.

To chart on details information

1.  On the Insert menu, click Chart.

Fundamentals of Report Design—Learner’s Guide240

Page 257: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 257/300

Tip:  Another way to do this is to click the Insert Chart button on the Insert Tools toolbar.

An Insertion frame appears.

2. Position the top-left corner of the frame in the target location for the new chart. Click once

to insert the chart and open the Chart Expert dialog box, if the Chart Expert doesn’t

automatically open.3.  On the Type tab, in the Choose your chart type list, select a chart type.

4. Select the chart subtype that best illustrates your data.

5.   Select Vertical or Horizontal depending on the Axes that most clearly illustrates your data.

Note:  If you want to make any chart 3D, select Use depth effect.

6. Click the Data tab.

7. In the Layout area, click Advanced, if it is not already selected.

8.  In the Data area, specify the database fields you want to use as conditions.

You can select On change of from the list, then add up to two database fields in the box

underneath the list.

The arrow buttons on the Chart Expert dialog box allow you to move fields from one list

to the other. Single arrows move only the selected field; double arrows move all fields at

the same time.

9. Add the database fields you want to use as values to the Show value(s) list.

241Representing Data Visually—Learner’s Guide

Page 258: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 258/300

10.If you do not want Crystal Reports to automatically summarize the chart values for a formula

field, select the Don’t summarize check box.

11.If the Axes and Options tabs appear, you can customize some of the chart’s properties, such

as the scaling of the axes, the legend, and the data points.

12.Click the Text tab.

13.Accept the default title information or add new titles to your chart.

14.Click OK.

Your chart is placed in the location of the insertion frame. You may have to refresh your

report to preview the finished chart.

Note:  When your chart is inserted, it may cover a portion of the report. Move and resize

the chart so that it fits properly within the report.

Activity: Charting on detail information

Objective

• Create a chart that is based on details data by using the Chart Expert.

Instructions

1. Open the Charting-1.rpt starting point report.

2. Create a pie chart with 3D visual effects using the Advanced Layout showing the customers

their last year’s sales. Place the chart in the Report Header.

3. Ensure that the legend displays the percentage of the last year's sales.

4. Change the placement of the legend to the left of the chart.

5. Resize the chart to expand to the entire Report Header section.

6. Preview the report.

7. Save the report as Charting on detail information.rpt.

8. Add the report into the folder in the Workbench.

Your report should look similar to this example.

Fundamentals of Report Design—Learner’s Guide242

Page 259: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 259/300

Customizing a chart

Once you have created a chart, you may want to add a new title, headings, or a legend, change

fonts, or even change the type of chart. Crystal Reports provides many options for working

with your existing charts.When you customize a chart, you can:

•   Edit a chart using the Chart option menu items

• Use the zooming features with bar and line charts

• Auto-arrange a chart in the report

Editing charts in the Chart Options dialog box

The Chart Options dialog box contains many advanced formatting options. To open the Chart

Options dialog box, right-click any chart and select  Chart Options. Each tab in the Chart

Options dialog box varies according to the type of chart selected.

For example, when you open the Chart Options dialog box for a bar chart, the  Appearance

tab allows you to change the overlap, gap width, depth, and direction of the boxes. After right

clicking a pie chart and selecting Chart Options, the Appearance tab allows you to change the

tilt, depth, rotation, and explode distance for the pie chart.

On every tab, the graphic on the left side of the dialog box gives an approximation of how your

edits will affect the chart.

243Representing Data Visually—Learner’s Guide

Page 260: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 260/300

To edit a chart by using Chart Options

1.   Right-click the chart and select Chart Options from the shortcut menu.

2. In the Chart Options dialog box, make the desired changes.

3.   Click OK.

Exploring the Appearance tab

In the Appearance tab, you vary the data elements that affect the appearance of the chart.

Depending on the chart type, the appearance tab offers different data elements. For example,

you can change the degree of tilt of a pie chart, change the style of line in a line chart, or change

the gaps between the bars in a bar chart.

Exploring the Titles tab

In the Titles tab, you can add, remove, or modify the title of your chart.

Fundamentals of Report Design—Learner’s Guide244

Page 261: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 261/300

Here you can add or edit the chart’s title, subtitle, and footnote. For some chart types, the Titles

tab also allows you to add and edit the group and data titles.

Exploring the Data Labels tab

On this tab, you can conceal or reveal values, labels, leader lines, and the name the data fields

used to build the pie name.

You can also specify the location and format of the values and labels you’ve chosen to display.

245Representing Data Visually—Learner’s Guide

Page 262: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 262/300

Exploring the Legends tab

On this tab, you can conceal or reveal the legend.

You can also modify the layout, style, and specify color mode by group or series for the legend.

This tab may not be available for all chart types.

Exploring the Gridlines tab

On this tab, you can conceal or reveal the gridlines.

Fundamentals of Report Design—Learner’s Guide246

Page 263: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 263/300

Page 264: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 264/300

Page 265: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 265/300

Your report should look similar to this example.

249Representing Data Visually—Learner’s Guide

Page 266: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 266/300

Quiz: Representing data visually

1. What functionality would you use when you have multiple chart values or when you do

not have any group or summary fields in the report?

2. What functionality would you use when you want to set the appearance, titles, data labels,

or legend of the chart?

3. What functionality would you use when you want to set conditional color formatting?

4. What functionality would you use when you need to see the details behind summary

information in a bar chart?

5. What functionality would you use when you want to create a chart based on detail

information?

Fundamentals of Report Design—Learner’s Guide250

Page 267: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 267/300

Lesson summary

After completing this lesson, you are now able to:

• Create a chart

251Representing Data Visually—Learner’s Guide

Page 268: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 268/300

Page 269: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 269/300

Lesson 10

Distributing a Report

Lesson introductionNow that you have a finished report, you may need to share it with other people. One of the

most common forms of distributing a report is by exporting it to a different format other than

a Crystal Reports file. You can also save the report to BusinessObjects Enterprise, the web-based

report management system from Business Objects.

After completing this lesson, you will be able to:

• Export a report

• Save a report to BusinessObjects Enterprise

253Distributing a Report—Learner’s Guide

Page 270: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 270/300

Exporting a report

Finished reports can be exported to a number of popular spreadsheet and word processor

formats, as well as to HTML, ODBC, and common data interchange formats. This makes the

distribution of information easier. For example, you may want to use the report data to project

trends in a spreadsheet package or to enhance the presentation of data in a desktop publishingpackage.

After completing this unit, you will be able to:

• Define exporting

• Define exporting formats

• Define exporting destinations

• Export a report

Exporting reports

Crystal Reports lets you insert objects anywhere on the report page. However, when you export

to formats such as MS Word, MS Excel, and HTML, objects that you placed between lines are

moved to the closest line in the output. To alleviate the formatting problems this behavior could

cause, it is recommended that you use guidelines when designing your reports.

The exporting process requires you to specify a format and a destination. The format determines

the file type, and the destination determines where the file is located.

Exporting formats

Crystal Reports provides you with many different export format types:

• Crystal Reports (RPT)

• HTML 3.2

• HTML 4.0

• Microsoft Excel (97–2003)

• Microsoft Excel (97–2003) Data-only

• Microsoft Word (97–2003)

• Microsoft Word (97–2003) - Editable

• ODBC

• PDF

• Record style - Columns with spaces

• Record style - Columns without spaces

• Rich Text Format (RTF)

• Separated Values (CSV)

• Tab-separated text (TTX)

• Text

• XML

Fundamentals of Report Design—Learner’s Guide254

Page 271: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 271/300

In addition to the standard export format types installed on your machine you may find

additional export format types are available to you. These format types are determined by the

DLL files on your local machine.

When you export a report to a file format other than Crystal Reports format (RPT), you may

lose some or all of the formatting that appears in your report. However, the program attempts

to preserve as much formatting as the export format allows.

Note:   The XML exporting functionality supports the use of transforms. You can export to XMLand then use an industry-specific transform to present the data in an industry-specific format. Forexample, you would use the JRDC transform if you worked in the justice/law enforcement area.

Exporting destinations

The destination determines the export location of your report. Crystal Reports enables you to

choose one of six destinations. They include:

• Application

• Disk file• Exchange folder

• Lotus Domino

• Lotus Domino Mail

• MAPI (Microsoft Mail)

To export a report

1.   With your report open, and saved if you have made changes, select the Export button from

the Standard toolbar.

The Export dialog box opens.

2.   Select a format type from the Format  drop-down list.

3. Select a destination type from the Destination  drop-down list.

4.   Click OK.

5. Enter any additional information that you are prompted for.

255Distributing a Report—Learner’s Guide

Page 272: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 272/300

For example, if you selected mail as the destination, you will be prompted to enter the

destination names, subject, and message.

Exporting a report to application formats

The export formats supported by Crystal Reports can be broadly categorized in two groups:Page-based formats and record-based formats.

Page-based formats tend to produce a more exact output. The emphasis of these formats is

layout representation and formatting. Formatting refers to attributes such as font style, text

color, text alignment, background color, and so on. Layout refers to object position, object size,

and the relationship between these attributes and other objects. Depending on the format you

choose, it may not be possible for the program to preserve all layout and formatting perfectly,

but page-based formats, in general, preserve these properties as closely as possible.

With record-based formats, the emphasis is on data rather than the layout and formatting.

However, in some formats—such as Microsoft Excel - Data only—you will notice that some

formatting is exported. Some of the record-based formats are only data-exchange formats.

Exporting a report to Microsoft Excel

Microsoft Excel format is a page-based format. This format converts your report contents into

Excel cells on a page-by-page basis. Contents from multiple pages are exported to the same

Excel worksheet. If a worksheet becomes full and there is more data to export, the export

program creates multiple worksheets to accommodate the data. If a report object covers more

than one cell, the export program merges cells to represent a report object. Microsoft Excel has

a limit of 256 columns in a worksheet; therefore, any report object (or part of it) that is added

to cells beyond 256 columns is not exported. This export format retains most of the formatting,

but it does not export line and box objects from your report.

Microsoft Excel - Data only, as the name suggests, is a record-based format that concentrates

on data. Even so, this format does export most of the formatting, too. Unlike Microsoft Excel

format, Microsoft Excel - Data only format does not merge cells—each object is added to only

one cell. This format can also export certain kinds of summaries in Crystal Reports as Excel

functions. The summaries that are supported are SUM, AVERAGE, COUNT, MIN and MAX.

Exporting a report to Microsoft Word

Microsoft Word (RTF) is a page-based, exact format that produces an RTF (Rich Text Format)

file. The exported file contains text and drawing objects to represent report objects. Individualobjects are placed in text frames. This format is intended for use in applications such as fill-out

forms where the space for entering text is reserved as empty text objects. Almost all of the

formatting is retained in this export format. Text objects cannot, however, be placed outside

the left edge of the page. Therefore, if you have text objects in your report that are placed before

the left edge of the printable area, they will be pushed right. (This is most noticeable in reports

with wide pages.)

Fundamentals of Report Design—Learner’s Guide256

Page 273: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 273/300

Page 274: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 274/300

3.   Click OK.

Activity: Exporting a report to Microsoft Excel

Objective

• Export a report to Excel and Excel (Data Only) to compare the differences between the two

exporting destinations.

Instructions

1. Open Exporting a Report-1.rpt starting point report.

2. Export the report to Microsoft Excel (97-2003) with certain criteria:

• Make sure there are page breaks for each page.

• Convert the order date to be displayed as a string.

• Make sure that each page header is displayed on each page.

3. Save the output as Exporting to Excel.xls.

4. Open Exporting to Excel.xls to view it.

Fundamentals of Report Design—Learner’s Guide258

Page 275: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 275/300

Your report in Excel should look similar to this example.

5. Export Exporting a Report-1.rpt to Microsoft Excel (97-2003) Data-only. Ensure that the

Xtreme logo is also exported.

6. Save the output as Exporting to Excel Data only.xls and view the results.

259Distributing a Report—Learner’s Guide

Page 276: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 276/300

Your report in Microsoft Excel (97-2003) Data-only should look similar to this example when

you first view it in the application.

7. Fix the formatting in the report:

• Expand the columns so all the numbers are visible.

• Add another row and copy the report title into it. Bold the report title to make it stand

out.

• Expand the row with the Xtreme logo to make it visible.

Fundamentals of Report Design—Learner’s Guide260

Page 277: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 277/300

Your report in Microsoft Excel (97-2003) Data-only should now look like this example.

8. Compare the differences between the two export formats:

• The Microsoft Excel (Data only) version needed post-processing work in order to make

it readable.

Activity: Exporting a report to Microsoft Word

Objective

• Export a report to RTF and Microsoft Word (97-2003) - Editable to compare the differences

between the two exporting formats.

Instructions

1. Open the Exporting a Report-1.rpt starting point report.

2. Export the report to RTF and save the output as Exporting to RTF.

3. View the RTF document.

261Distributing a Report—Learner’s Guide

Page 278: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 278/300

Your exported report should look similar to this example.

4. Open the Exporting a Report-1.rpt starting point report.

5. Export the report to Microsoft Word - Editable and save it asExporting to Word - Editable.

6. Insert page breaks after each report page.

7. Save the output and view the Microsoft Word document.

Fundamentals of Report Design—Learner’s Guide262

Page 279: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 279/300

Your exported report should look similar to this example.

8. Compare the differences between the two export formats:

• The report title in the RTF version is in a text box; the report title in the Editable version

is not.

• The RTF version is larger in size (approximately 1.62 MB); the Editable version is smaller

at 278 KB.

263Distributing a Report—Learner’s Guide

Page 280: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 280/300

Saving to BusinessObjects Enterprise

You can use design options and considerations that will help improve the performance of your

reports.

After completing this unit, you will be able to:

• Define viewing requirements in BusinessObjects Enterprise

• Save a report to BusinessObjects Enterprise

• View a report in BusinessObjects Enterprise

Viewing requirements in BusinessObjects Enterprise

When designing your reports, and especially when designing reports for the web, you should

allow report users to drive the data they see. In other words, display summarized information,

so each user can navigate the report quickly and then drill down to access additional data. In

this way, web traffic and response times are minimized, because only the data requested by

the user is transferred from the database server.

These are only a few of the benefits of designing user-driven reports:

• Report users gain interactive control over the type and quantity of information they view

over the web.

• Data transfer and network traffic decrease, because only the information requested by users

is returned from the database server.

• When users need real-time reporting of live data over the web, user-oriented reports respond

quickly and communicate efficiently with the database server.

• Reports become more useful, because each user customizes the report’s contents, thereby

creating a reporting solution specific to his or her particular decision-making problem.

Some of the methods you can use to design optimized reports for viewing in BusinessObjects

Enterprise are:

• Using faster report formats

• Choosing between live and saved data

• Designing summary reports

Using faster report formats

The quickest way to improve the performance of reports created in older versions of Crystal

Reports is to save them in the latest Crystal Reports format. It is recommended that you update

your older reports to take advantage of these enhancements.

To update the format of an older report, open it in Crystal Reports and select  Save from the

File menu. The older version of the report will be replaced with the newer version report.

Note:  If for some reason you need to keep a report in its original file format, use the  Save As

command (instead of Save) and enter a new name for the newer version report.

Fundamentals of Report Design—Learner’s Guide264

Page 281: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 281/300

Choosing between live and saved data

When reporting over the web, the choice to use live or saved data is one of the most important

decisions you’ll make. Whichever choice you make, Crystal Reports displays the first page as

quickly as possible, so you can see your report while the rest of the data is being processed.

Live data

Live reporting gives users real-time access to live data, straight from the database server. Use

live data to keep users up-to-date on constantly changing data, so they can access information

that’s accurate to the second. For instance, if the managers of a large distribution center need

to keep track of inventory shipped on a continual basis, then live reporting is the way to give

them the information they need.

Crystal Reports supports live reporting. However, you should first consider whether or not

you want all of your users accessing the database server on a continual basis. If the data isn’t

rapidly or constantly changing, then all those requests to the database do little more than

increase network traffic and consume server resources. In such cases, you may prefer to use

reports with saved data.

Saved data

Reports with saved data are useful for dealing with data that isn’t continually updated. When

users navigate through reports with saved data, and drill down for details on columns or charts,

they don’t access the database server directly; instead, they access the saved data. Consequently,

reports with saved data not only minimize data transfer over the network, but also lighten the

database server’s workload.

You can schedule these reports within BusinessObjects Enterprise, so they automatically refresh

from the database on a predetermined basis. For example, if your sales database is only updated

once a day, or once a week, then you can run the report on a similar schedule and save it withdata. Sales representatives then always have access to current sales data, but they aren’t hitting

the database every time they open a report. Alternatively, you can refresh reports with saved

data on an as-needed basis.

Saved data is discarded and refreshed when you perform any of these tasks in a report:

•   Select the Refresh command.

• Change your database logon.

• Change the report’s parameters.

• Add a new field that doesn’t exist in the saved data.

•   Drill down in a report where Perform Grouping On Server  is selected, and the Details

section is suppressed.

• Verify the database—if the database structure has changed drastically.

• Change the linking parameter on a subreport (the subreport is refreshed).

• Change the order of groups (only for reports in the Report Application Server).

To save a report with data, first make sure the Save Data with Report option is selected on the

File menu and then save your report.

265Distributing a Report—Learner’s Guide

Page 282: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 282/300

Designing summary reports

Designing and distributing summary reports is a relatively easy way to ensure that users

quickly find the data they need over the web. A summary report can include as much data as

any other report. However, by hiding a summary report’s Details section, you avoid

overwhelming users with data they may not immediately need.

When the Details section is hidden, users navigate with the Group tree first, to locate the desired

data. Then, by drilling down on the report, users can request specific data, which is returned

quickly without unnecessary records. This is especially important to improving navigation of

long summary reports, which might consist of hundreds, thousands, or even tens of thousands

of pages.

To facilitate navigation in this way, you first need to group the data and insert the summary

fields you want to include in your report. Once you’ve grouped and summarized your report

data, hide the Details section (and any other large report sections) so that users can easily

navigate to the data that’s important to them.

Saving a report to BusinessObjects Enterprise

Another way to distribute your reports is through BusinessObjects Enterprise. When you

publish a report to BusinessObjects Enterprise, you can deliver it to end users via any web

application—intranet, extranet, Internet, or corporate portal.

Crystal Reports facilitates the publication of reports through the  Enterprise option found in

the Open and Save As dialog boxes. When you choose the Enterprise option in the Open

dialog box, you can select any published report to make changes to it. The same option in the

Save As dialog box lets you save a modified report back to its original location, or it lets you

save a new report to an Enterprise folder, which, in essence, is the same as publishing the report

to BusinessObjects Enterprise.

You can save Crystal reports to BusinessObjects Enterprise folders. Use the Save As dialog box

to save a modified report back to its original location, or use it to save a new report to an

Enterprise folder. Saving a report to an Enterprise folder is the same as publishing the report

to BusinessObjects Enterprise.

You can also view the report in BusinessObjects Enterprise InfoView, the front-end interface

to BusinessObjects Enterprise.

Note:   This functionality is available only with a BusinessObjects Enterprise XI 3.0/3.1 serverenvironment.

To save a report to an Enterprise folder 

1. On the File menu, click Save As.

2.   In the Save As dialog box, click Enterprise.

Note:   The Enterprise button is not visible if Crystal Reports doesn’t detect BusinessObjects

Enterprise on your machine.

Fundamentals of Report Design—Learner’s Guide266

Page 283: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 283/300

If you have not already logged onto BusinessObjects Enterprise, the Log On to

BusinessObjects Enterprise dialog box appears.

Tip:   You can also log onto a Central Management Server (CMS) from the File menu before

you open a report.

3.   In the System field, enter or select the name of the BusinessObjects Enterprise system that

you want to connect to.

4. Enter your user name and password.

5.   Click the Authentication list to select the appropriate authentication type.

Enterprise authentication requires a user name and password that is recognized by Crystal

Enterprise.

LDAP authentication requires a user name and password that is recognized by an LDAP

directory server.

Windows AD authentication requires a user name and password that is recognized by

Windows AD.

Windows NT authentication requires a user name and password that is recognized by

Windows NT.

Note:  Enterprise authentication is the default method. LDAP, AD, and NT Authentication

requires special setup.

6. When the Enterprise folders appear, select a folder to save your report in.

You can also create a new folder in which to save your report.

7. Enter a file name for your report, if required.

8.   Select Enable repository refresh if you want your report’s repository objects to be updated

when the report is opened again in Crystal Reports or scheduled in BusinessObjects

Enterprise.

9.   Click Save to publish your report to BusinessObjects Enterprise.

267Distributing a Report—Learner’s Guide

Page 284: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 284/300

To view a report in an Enterprise folder 

1.  On the File menu, click Open.

2. In the Open dialog box, click Enterprise.

3.   In the System field, enter or select the name of the BusinessObjects Enterprise system that

you want to connect to.

4. Enter your user name and password.

5.   Click the Authentication list to select the appropriate authentication type.

6.   Click OK.

The Enterprise folders appear and you can select a report to open in Crystal Reports.

7.   Double-click the report you want to view and then click Open.

Note:

• To find a specific report, highlight a folder and select Find from its shortcut menu. You

can then use the Find dialog box to enter the report’s name or a part of its name.

• To limit the risk of expanding a folder than contains many hundreds of reports, use the

batch options on the folder’s shortcut menu:

○   First Batch displays the first 100 objects in the selected folder.

○   Next Batch displays the next 100 objects in the selected folder.

○   Previous Batch displays the previous 100 objects in the selected folder.

○   Last Batch displays the last 100 objects in the selected folder.

• Select the Update Repository Objects option to ensure that the report’s repository objects

are updated when the report is opened in the future.

To view a report in BusinessObjects Enterprise

1. Launch BusinessObjects Enterprise InfoView.

The Logon page appears.

2.   In the Existing User area of the Logon page, type your user name and password.

3. Click the Authentication list to select Enterprise, LDAP, Windows AD, or Windows NT

Authentication.

4. Click Log On.

The home page reappears and you are logged on with your own account.

5. Locate the report in the folder in the list.

6. Double-click the report link to open and view the report.

Fundamentals of Report Design—Learner’s Guide268

Page 285: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 285/300

Activity: Saving a report to BusinessObjects Enterprise

Objective

• Save a report to a folder in BusinessObjects Enterprise and then view the report in

BusinessObjects Enterprise InfoView.

Instructions

1. Open the Distributing a Report-1.rpt starting point report.

2. Modify the summary info section of the report to include the author name.

3. Save the report as Distributing a Report.rpt. Save the report with data so you can view

it in BusinessObjects Enterprise.

4. Save the report to your Favorites folder in BusinessObjects Enterprise by using the

Enterprise folder option in the  Save dialog box.

5.   Open BusinessObjects InfoView.

6. Log on to BusinessObjects Enterprise.

7. Locate the report you saved.

8. View the report in BusinessObjects Enterprise.

269Distributing a Report—Learner’s Guide

Page 286: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 286/300

Page 287: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 287/300

Lesson summary

After completing this lesson, you are now able to:

• Export a report

• Save a report to BusinessObjects Enterprise

271Distributing a Report—Learner’s Guide

Page 288: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 288/300

Fundamentals of Report Design—Learner’s Guide272

Page 289: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 289/300

Answer Key

This section contains the answers to the reviews and/or activities for the applicable lessons.

273 Answer Key—Learner’s Guide

Page 290: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 290/300

Fundamentals of Report Design—Learner’s Guide274

Page 291: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 291/300

Debrief: Planning a report

Page 8

1. Why is it important to plan a report before creating it?

Answer:

○ By taking a systems-oriented approach to reporting, you will produce clearer and more

readable reports.

○ It’s a best practice to document processes, especially if working with a client (even if that

client is internal to the organization).

○ If a group is working on a project, then the group’s work can be documented and they

can see a “snapshot” of the report if it’s been documented.

○ If someone leaves the team for any reason and you need to take over the project, then

you’ll have a record/document of where the other report designer left off.

○ The prototype can flag any problems that may occur (technical, data access, client

misunderstandings, and so on).○ The prototype can constitute a “sign off” point in the report creation process.

275 Answer Key—Learner’s Guide

Page 292: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 292/300

Quiz: Creating a report

Page 67

1.   What is the difference between using the Design tab and Preview tab?

Answer:

When you place a field in the Design tab, a single-field frame represents all those values.

When you highlight the field, sizing handles appear on the frame and the frame changes

color.

In the Preview tab, however, you are working with the actual data. Instead of a field frame

representing many field values, the values themselves appear.

2.   What is the difference between using Print Preview and Refresh?

Answer:

When you preview the report, the program uses the data that is saved in a cache file withthe report on the client machine.

When you refresh the report, the program retrieves new data and displays this new data

on the report.

3. What objects can be stored in the repository?

Answer: The repository stores text objects, bitmaps, custom functions, commands (queries),

and lists of values.

4.  What is the Workbench?

Answer: The Workbench is a folder structure that can represent the type of projects you

work on. In the Workbench, you can create projects (folders) that contain one or more

reports.

5. How do you select multiple report objects?

Answer:

○ Crtl-click each object in succession.

○ You can also use the cursor to click and hold to draw an imaginary box around the objects

you want selected. When you release the mouse, all objects partially surrounded by the

marquee are selected.

○ Click in the section, and then click Select All Section Objects.

Fundamentals of Report Design—Learner’s Guide276

Page 293: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 293/300

Quiz: Selecting records

Page 91

1. What tool is used for filtering or selecting records in Crystal Reports?

Answer: The Select Expert

2. When you want to see new data from the database after modifying the record selection,

what option would you use?

Answer: You would use the Refresh option because the program will run the report again

and retrieve fresh data if you add to the record selection criteria to include more records

than were needed when you first ran the report.

3. Why would you want to ensure your record selection is case insensitive?

Answer: You will want to ensure that your record selection statement is case insensitive if

you are not confident that data entry was consistent.

4. When would you use a time-based record selection?

Answer: You would use a time-based record selection when you wanted to determine

specific results in a given time period.

5. When you want to refresh the data on your report, what are the three methods you can use?

Answer:

You can use:

○ The Refresh button on the Standard toolbar.

○   The Refresh Report Data command from the Report menu.

○   F5 on the keyboard.

277 Answer Key—Learner’s Guide

Page 294: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 294/300

Quiz: Organizing data on a report

Page 126

1. Can each field in the Sort Fields list be assigned a sort direction in ascending or descending

order independently?

Answer: Yes

2. What is the function of the Group Tree?

Answer: The Group Tree functions like a directory tree with a heading for each group in

your report, with the ability to expand the group to see further levels of grouping. Using

the Group Tree aids in navigating through the report.

3. How would you create groups that are not reflected by the fields in your database?

Answer: You would create a specified order group, which enables you to create both the

customized groups that will appear on the report and the records that each group will

contain.

4. Why would you want to have the group header repeat on every page?

Answer:

○ Makes the report more readable and usable.

○ Helps to navigate the report.

5. What is the difference between a subtotal and a summary?

Answer:

A subtotal is a summary that totals or sums numeric values in a group.

When the program summarizes data, it sorts the data, breaks it into meaningful groups,

and then summarizes the values in each group automatically.

Fundamentals of Report Design—Learner’s Guide278

Page 295: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 295/300

Quiz: Formatting a report

Page 166

1.   The Format Painter  copies formatting properties from one report object to one or more

target objects when you first select a source object in a report and then apply that object’sformatting to a target field.

2. The Template Expert gives any number of reports a consistent look without having to format

each report individually.

3. Graphical elements such as lines, boxes, and pictures make specific data stand out and improve

the overall appearance of the report.

4.   The Can Grow option prevents truncation of text objects to allow the text box to expand

vertically to fit all text and data from embedded fields.

5. To reduce the amount of time spent formatting reports by using fields that contain pre-built

functions, use Special Fields.

279 Answer Key—Learner’s Guide

Page 296: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 296/300

Quiz: Applying section formatting

Page 183

Exercise one

1.  True or False: The New Page Before and the New Page After option is usually used with

Group Headers and Group Footers.

Answer: True

2. What option prevents page breaks from spreading data from a single record over two pages?

Answer: Keep Together

3. If you want to lock the formatting and position of all report objects in a section, what option

do you use in the Section Expert?

Answer: Read-only

Exercise two

1. Who are the customers in the New South Wales region of Australia?

Answer: Canberra Bikes and Down Under Bikes

2. What is the street address for the Offroad Bike Verlieh in Berlin?

Answer: Koningswinterer Strasse 800

3. What is the phone number for the Picadilly Cycle in Greater London?

Answer: 44-171-531-0221

Fundamentals of Report Design—Learner’s Guide280

Page 297: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 297/300

Quiz: Applying conditional reporting

Page 225

1. When you need to format objects only in certain cases or apply formatting differently for

different situations, you use conditional formatting.

2. What type of formula do you need to create when you set an on or off property?

Answer: Boolean

3. What type of formula do you need to create when you apply an attribute property?

Answer: If-Then-Else

4. When would you use a conditional formatting function?

Answer: You would use a conditional formatting function (found at the top of the Functions

tree in the Formula Workshop) whenever you needed to create more complex conditional

formatting than is available in the  Highlighting Expert.

281 Answer Key—Learner’s Guide

Page 298: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 298/300

Quiz: Representing data visually

Page 250

1. What functionality would you use when you have multiple chart values or when you do

not have any group or summary fields in the report?

Answer:  You would use the  Advanced chart layout when you have multiple chart values

or when you do not have any group or summary fields in the report.

2. What functionality would you use when you want to set the appearance, titles, data labels,

or legend of the chart?

Answer: You would use the Chart Options dialog box when you want to set the appearance,

titles, data labels, or legend of the chart.

3. What functionality would you use when you want to set conditional color formatting?

Answer: You would use the Color Highlight tab of the Chart Expert when you want to set

conditional color formatting.

4. What functionality would you use when you need to see the details behind summary

information in a bar chart?

Answer: You would use drill-down when you need to see the details behind summary

information in a bar chart.

5. What functionality would you use when you want to create a chart based on detail

information?

Answer: You would use a condition (when to plot the point) and a value (what is plotted

as a point) when you want to create a chart based on detail information.

Fundamentals of Report Design—Learner’s Guide282

Page 299: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 299/300

Quiz: Distributing a report

Page 270

1. The exporting process requires you to specify format and destination.

2. What are the two methods to access and view a report in BusinessObjects Enterprise?

Answer:

○ Enterprise Folders

○ InfoView

3. When designing reports that will be viewed in BusinessObjects Enterprise, what are some

of the methods used to optimize reports?

Answer:

○ Using faster report formats

○ Choosing between live and saved data○ Designing summary reports

4.   What does it mean if the Enterprise button is not visible in Crystal Reports?

Answer: The Enterprise button is not visible if Crystal Reports doesn’t detect BusinessObjects

Enterprise on your machine.

5. What option would you use to ensure that the report’s repository objects are updated when

the report is opened in the future?

Answer: Select the Update Repository Objects option to ensure that the report’s repository

objects are updated when the report is opened in the future.

283 Answer Key—Learner’s Guide

Page 300: BOC310 Crystal Reports 2008 Report Design I.pdf

8/10/2019 BOC310 Crystal Reports 2008 Report Design I.pdf

http://slidepdf.com/reader/full/boc310-crystal-reports-2008-report-design-ipdf 300/300