441
BOC310 SAP Crystal Reports: Fundamentals of Report Design SAP BusinessObjects - Business Intelligence Date Training Center Instructors Education Website Participant Handbook Course Version: 96 Course Duration: 2 Day(s) Material Number: 50103384 An SAP course - use it to learn, reference it for work SAP Class Week of February 13, 2012

BOC310 Col96 Part(Crystal Reports)

Embed Size (px)

DESCRIPTION

business objects book for understanding crystal reports.

Citation preview

Page 1: BOC310 Col96 Part(Crystal Reports)

BOC310SAP Crystal Reports: Fundamentals

of Report DesignSAP BusinessObjects - Business Intelligence

Date

Training Center

Instructors

Education Website

Participant HandbookCourse Version: 96Course Duration: 2 Day(s)Material Number: 50103384

An SAP course - use it to learn, reference it for work

SAP Class Week of February 13, 2012

Page 2: BOC310 Col96 Part(Crystal Reports)

Copyright

Copyright © 2011 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without theexpress permission of SAP AG. The information contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary softwarecomponents of other software vendors.

Trademarks

• Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® and SQL Server® areregistered trademarks of Microsoft Corporation.

• IBM®, DB2®, OS/2®, DB2/6000®, Parallel Sysplex®, MVS/ESA®, RS/6000®, AIX®, S/390®,AS/400®, OS/390®, and OS/400® are registered trademarks of IBM Corporation.

• ORACLE® is a registered trademark of ORACLE Corporation.• INFORMIX®-OnLine for SAP and INFORMIX® Dynamic ServerTM are registered trademarks

of Informix Software Incorporated.• UNIX®, X/Open®, OSF/1®, and Motif® are registered trademarks of the Open Group.• Citrix®, the Citrix logo, ICA®, Program Neighborhood®, MetaFrame®, WinFrame®,

VideoFrame®, MultiWin® and other Citrix product names referenced herein are trademarks ofCitrix Systems, Inc.

• HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C®, World WideWeb Consortium, Massachusetts Institute of Technology.

• JAVA® is a registered trademark of Sun Microsystems, Inc.• JAVASCRIPT® is a registered trademark of Sun Microsystems, Inc., used under license for

technology invented and implemented by Netscape.• SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP Business Workflow, WebFlow, SAP

EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo and mySAP.com aretrademarks or registered trademarks of SAP AG in Germany and in several other countries allover the world. All other products mentioned are trademarks or registered trademarks of theirrespective companies.

Disclaimer

THESE MATERIALS ARE PROVIDED BY SAP ON AN "AS IS" BASIS, AND SAP EXPRESSLYDISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR APPLIED, INCLUDING WITHOUTLIMITATION WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULARPURPOSE, WITH RESPECT TO THESE MATERIALS AND THE SERVICE, INFORMATION, TEXT,GRAPHICS, LINKS, OR ANY OTHER MATERIALS AND PRODUCTS CONTAINED HEREIN. INNO EVENT SHALL SAP BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL,CONSEQUENTIAL, OR PUNITIVE DAMAGES OF ANY KIND WHATSOEVER, INCLUDINGWITHOUT LIMITATION LOST REVENUES OR LOST PROFITS, WHICH MAY RESULT FROMTHE USE OF THESE MATERIALS OR INCLUDED SOFTWARE COMPONENTS.

g2011914104313

SAP Class Week of February 13, 2012

Page 3: BOC310 Col96 Part(Crystal Reports)

About This HandbookThis handbook is intended to complement the instructor-led presentation of thiscourse, and serve as a source of reference. It is not suitable for self-study.

Typographic ConventionsAmerican English is the standard used in this handbook. The following typographicconventions are also used.

Type Style Description

Example text Words or characters that appear on the screen. Theseinclude field names, screen titles, pushbuttons as well asmenu names, paths, and options.

Also used for cross-references to other documentationboth internal and external.

Example text Emphasized words or phrases in body text, titles ofgraphics, and tables

EXAMPLE TEXT Names of elements in the system. These include reportnames, program names, transaction codes, table names,and individual key words of a programming language,when surrounded by body text, for example SELECTand INCLUDE.

Example text Screen output. This includes file and directory namesand their paths, messages, names of variables andparameters, and passages of the source text of a program.

Example text Exact user entry. These are words and characters thatyou enter in the system exactly as they appear in thedocumentation.

<Example text> Variable user entry. Pointed brackets indicate that youreplace these words and characters with appropriateentries.

2011 © 2011 SAP AG. All rights reserved. iii

SAP Class Week of February 13, 2012

Page 4: BOC310 Col96 Part(Crystal Reports)

About This Handbook BOC310

Icons in Body TextThe following icons are used in this handbook.

Icon Meaning

For more information, tips, or background

Note or further explanation of previous point

Exception or caution

Procedures

Indicates that the item is displayed in the instructor'spresentation.

iv © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 5: BOC310 Col96 Part(Crystal Reports)

ContentsCourse Overview ............................................................................. vii

Course Goals.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .viiCourse Objectives ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .vii

Unit 1: Planning a Report.....................................................................1Defining Database Concepts.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2Planning and Developing a Report Prototype... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5

Unit 2: Creating a Report ................................................................... 19Creating a Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Adding Tables ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Design Environment.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Inserting Objects on a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Previewing a Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45Saving a Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51Positioning and Sizing Objects.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65Formatting Objects .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

Unit 3: Selecting Records .................................................................. 89Select Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91Determining the Criteria for Record Selection ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95Saved versus Refreshed Data ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100Applying Record Selection ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104Setting Additional Criteria.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108Modifying Record Selection ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114Applying Time-Based Record Selection ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120

Unit 4: Organizing Data on a Report ....................................................131Sorting Records... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133Grouping Records ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143Creating Nested and Multiple Groups... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153Adding a Specified Order Group... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .158Grouping on Time-Based Data ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .163Creating a Grand Total . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .168Summarizing Data ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .173

2011 © 2011 SAP AG. All rights reserved. v

SAP Class Week of February 13, 2012

Page 6: BOC310 Col96 Part(Crystal Reports)

Contents BOC310

Unit 5: Formatting a Report ...............................................................191Adding Graphical Elements .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193Applying Specialized Formatting ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203Combining Text Objects with Database Fields.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .215Inserting Fields with Pre-Built Functions... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .220

Unit 6: Applying Section Formatting....................................................237Formatting Sections ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .238Creating Summary Reports .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .253

Unit 7: Creating Basic Formulas .........................................................265Defining a Formula ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267Creating Formulas ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .276Applying an If-Then-Else Formula... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .284Applying Boolean Formulas ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .291Applying Date Calculations... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .298Applying Numeric Calculations ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .305Applying String Manipulation... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .314

Unit 8: Applying Conditional Reporting................................................331Formatting Data Conditionally .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .332Adding Key Performance Indicators.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .340

Unit 9: Representing Data Visually ......................................................353Creating a Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .354Charting on Details or Formula Information ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .369Customizing a Chart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .376

Unit 10: Distributing a Report ............................................................387Exporting a Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .388Saving to SAP BusinessObjects Business Intelligence Platform... . . . . . . . . . . . . . . . . .398

vi © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 7: BOC310 Col96 Part(Crystal Reports)

Course OverviewSAP Crystal Reports 2011 is a powerful, dynamic, actionable reporting solution thathelps you design, explore, visualize, and deliver reports via the web or embedded inenterprise applications. This two-day instructor led course is designed to give youcomprehensive skills and in-depth knowledge to plan and create reports that will helpyou analyze and interpret data.

As a business benefit, you will find that this course is an in-depth approach to theentire report creation cycle from planning a report prototype to distributing a report.

Target AudienceThis course is intended for the following audiences:

• Business Analysts• Report Writers• Report Designers• Application Developers• BI System Administrators

Course PrerequisitesRequired Knowledge

• Basic knowledge of database concepts

Recommended Knowledge

• SAP Crystal Reports 2011: Report Design II – Business Reporting Solutions

Course GoalsThis course will prepare you to:

• Gain the fundamentals of report design• Acquire the basis for more advanced courses in the SAP BI curriculum

Course ObjectivesAfter completing this course, you will be able to:

2011 © 2011 SAP AG. All rights reserved. vii

SAP Class Week of February 13, 2012

Page 8: BOC310 Col96 Part(Crystal Reports)

Course Overview BOC310

• Plan and create a report• Organize and format data• Apply record selection• Create formulas and apply conditional reporting• Export and distribute reports

viii © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 9: BOC310 Col96 Part(Crystal Reports)

Unit 1Planning a Report

Unit OverviewThis unit provides the getting started fundamentals of planning and developing areport in SAP Crystal Reports.

Unit ObjectivesAfter completing this unit, you will be able to:

• Define database terms• Determine the layout and content of a report• Develop a prototype of a report

Unit ContentsLesson: Defining Database Concepts.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2Lesson: Planning and Developing a Report Prototype ... . . . . . . . . . . . . . . . . . . . . . . . .5

Exercise 1: Develop a Report Prototype ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9

2011 © 2011 SAP AG. All rights reserved. 1

SAP Class Week of February 13, 2012

Page 10: BOC310 Col96 Part(Crystal Reports)

Unit 1: Planning a Report BOC310

Lesson: Defining Database Concepts

Lesson OverviewBy understanding basic database concepts, you will be better prepared to understandwhat’s needed when planning a report.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Define database terms

Business ExampleYou need to know where your information is stored and in what form before you candetermine the reporting requirements.

Database terms and definitions

Term Definition

Database A database is a bank of data that providesthe information for a report. A databaseis also referred to as a data source.

Table A table is a container of information thatcan hold many pieces of data, such asrecords. Tables are stored in databases.

Record In a database, a record is a complete unitof related information. Each record ismade up of one or more fields, and eachfield can hold one piece of data (knownas a value).

Field A field is the basic building block of arecord. A field can be empty (NULL) orcontain a value.

2 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 11: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Defining Database Concepts

Relational database A relational database contains tablesthat can be linked together based on therelationship between the fields in two ormore tables.

Report A report is an organized presentationof data. A comprehensive, customized,and attractive report can providemanagement with the information itneeds to run an organization effectively.

Link A link is a field that is common totwo or more tables and that serves asa connecting point between those twotables. Linking means that records arematched up from two or more table(s)and ensures that all the data in each rowof multiple tables refers to the samecustomer (transaction, invoice, and soon) on a report.

2011 © 2011 SAP AG. All rights reserved. 3

SAP Class Week of February 13, 2012

Page 12: BOC310 Col96 Part(Crystal Reports)

Unit 1: Planning a Report BOC310

Lesson Summary

You should now be able to:• Define database terms

4 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 13: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Planning and Developing a Report Prototype

Lesson: Planning and Developing a Report Prototype

Lesson OverviewAs a starting point in the report design process, outline the information that the reportis required to provide.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Determine the layout and content of a report• Develop a prototype of a report

Business ExampleYou need to understand the basic concepts of report design, so you can plan whatinformation to include on the report.

Report prototype layoutsBy taking a systems-oriented approach to reporting and developing a prototype, youwill produce clearer and more readable reports.

Hint: With the paper prototype in hand, you can put your full effort intolearning and using the program, rather than trying to design and learn at thesame time. For more details on the report planning process, see the CrystalReports User’s Guide.

Developing a report prototypeTo develop a report prototype, gather the information on which the report will bebased. This stage of the report planning process, referred to as requirements gathering,consists of the report designer asking the report requestor a series of targetedquestions, 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 willbe printed

• Filling in a form.

2011 © 2011 SAP AG. All rights reserved. 5

SAP Class Week of February 13, 2012

Page 14: BOC310 Col96 Part(Crystal Reports)

Unit 1: Planning a Report BOC310

Sketching the report helps if you need to see the report visually; however, a formwith all the categories listed enables you to develop the prototype without missing asection. As well, the form is more professional than a quickly sketched visual and canbe used as a sign-off point in a report request. Having a list of questions (based on theReport Requirements Checklist) can also help to keep you on track.

Note: The Report Requirements Checklist is based on Crystal Reportsterminology. Use this checklist as a starting point for a version specific toyour 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 thereport both a starting point and a goal.

• Define the readers of the report. Plan the report so it includes the informationeach 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 atleast you will 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 titleof 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 purposeyou wrote for the report. It should also contain all of the data needed by thevarious 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.

6 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 15: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Planning and Developing a Report Prototype

Some report information can be drawn directly from data fields; otherinformation 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 setof records from the database.

• Determine if the data needs to be summarized.

Do you want to total, average, count, or determine the maximum or minimumvalue included in all the values in any column on the report? Do you want toinclude 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?

2011 © 2011 SAP AG. All rights reserved. 7

SAP Class Week of February 13, 2012

Page 16: BOC310 Col96 Part(Crystal Reports)

Unit 1: Planning a Report BOC310

8 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 17: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Planning and Developing a Report Prototype

Exercise 1: Develop a Report Prototype

Exercise ObjectivesAfter completing this exercise, you will be able to:• Determine the content and layout for a report and then develop a prototype

Business ExampleAs a report designer, you are requested to build a report for the organization. Based onthe report requirements provided in the business scenario, you will need to determinethe content and layout. Then, it is recommended that you develop a prototype prior tobuilding the report.

Task: Determine Report RequirementsRead through the scenario to determine the basic requirements of the report. Then,create a report prototype.

Scenario

You are a new report designer for the Sales team in a bike manufacturing companycalled the Xtreme Bike Company. Your first assignment is to create a report that willdisplay orders placed by each customer of the organization.

The database administrator tells you that the customer information and the orderinformation are stored in two separate tables in the Xtreme company database. Youare advised to use an ODBC connection to the database.

The sales manager tells you that the standard is to use the company logo AT THEOF THE REPORT as well as a title and print data that is labeled. Other corporatestandards include a page number that is labeled at the bottom of the report andcopyright information.

The main section of the report should contain the customer's name and city. Thecustomer's order information should include the date the order was placed, the amountof the order, and the order ID number.

For this report, the Sales team needs to see records selected from the country of theUSA and for 2004 only. The customers and the cities should be sorted alphabetically,starting with “A.”

Continued on next page

2011 © 2011 SAP AG. All rights reserved. 9

SAP Class Week of February 13, 2012

Page 18: BOC310 Col96 Part(Crystal Reports)

Unit 1: Planning a Report BOC310

The report should display USA as the only country group. The only regional groupsrequired are Western Sales Territory and the Eastern Sales Territory. All otherregions can be listed under Unassigned Regions. Also, the Sales team wants to seeinformation grouped on the dates that orders were placed with the order dates sortedwith the most recent information first.

The Sales team also needs to see such summarized data as the number of ordersfor each order date group. Include the subtotal of the order amount for each orderdate group as well as a report grand total for the order amount. As well, include apercentage of the order amount based on each month's subtotal compared to the grandtotal. The Sales team also needs to see the number of unique customers.

To highlight key information with specialized formatting options, ensure the orderdate group as well as the subtotal and grand total is easily found on the report. Formatthe column headings, so that navigating the report is easier. Use two different fontstyles for the report title for contrast.

1. 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 thefollowing Report Prototype Form as an aid in this activity or sketch the reportprototype on a piece of paper.

Report Prototype Form

Report Prototype Form

Purpose

Audience Report title

Database information

Header information Footer information

Continued on next page

10 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 19: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Planning and Developing a Report Prototype

Body of report (information to be included in the body of the report)

Groups (groups to be set up)

Sorting (Information to be sorted in aspecific order)

Record selection (Specific records tobe displayed)

Calculations or formulas

Summarized data (Summarized data to be included)

Key information/Formatting (Formatting to highlight specific information)

Signoff:

2. Build a report prototype.

ResultYou now have a list of report requirements and a prototype of the content andlayout.

2011 © 2011 SAP AG. All rights reserved. 11

SAP Class Week of February 13, 2012

Page 20: BOC310 Col96 Part(Crystal Reports)

Unit 1: Planning a Report BOC310

Solution 1: Develop a Report PrototypeTask: Determine Report RequirementsRead through the scenario to determine the basic requirements of the report. Then,create a report prototype.

Scenario

You are a new report designer for the Sales team in a bike manufacturing companycalled the Xtreme Bike Company. Your first assignment is to create a report that willdisplay orders placed by each customer of the organization.

The database administrator tells you that the customer information and the orderinformation are stored in two separate tables in the Xtreme company database. Youare advised to use an ODBC connection to the database.

The sales manager tells you that the standard is to use the company logo AT THEOF THE REPORT as well as a title and print data that is labeled. Other corporatestandards include a page number that is labeled at the bottom of the report andcopyright information.

The main section of the report should contain the customer's name and city. Thecustomer's order information should include the date the order was placed, the amountof the order, and the order ID number.

For this report, the Sales team needs to see records selected from the country of theUSA and for 2004 only. The customers and the cities should be sorted alphabetically,starting with “A.”

The report should display USA as the only country group. The only regional groupsrequired are Western Sales Territory and the Eastern Sales Territory. All otherregions can be listed under Unassigned Regions. Also, the Sales team wants to seeinformation grouped on the dates that orders were placed with the order dates sortedwith the most recent information first.

The Sales team also needs to see such summarized data as the number of ordersfor each order date group. Include the subtotal of the order amount for each orderdate group as well as a report grand total for the order amount. As well, include apercentage of the order amount based on each month's subtotal compared to the grandtotal. The Sales team also needs to see the number of unique customers.

Continued on next page

12 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 21: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Planning and Developing a Report Prototype

To highlight key information with specialized formatting options, ensure the orderdate group as well as the subtotal and grand total is easily found on the report. Formatthe column headings, so that navigating the report is easier. Use two different fontstyles for the report title for contrast.

1. 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 thefollowing Report Prototype Form as an aid in this activity or sketch the reportprototype on a piece of paper.

Report Prototype Form

Report Prototype Form

Purpose

Audience Report title

Database information

Header information Footer information

Body of report (information to be included in the body of the report)

Groups (groups to be set up)

Continued on next page

2011 © 2011 SAP AG. All rights reserved. 13

SAP Class Week of February 13, 2012

Page 22: BOC310 Col96 Part(Crystal Reports)

Unit 1: Planning a Report BOC310

Sorting (Information to be sorted in aspecific order)

Record selection (Specific records tobe displayed)

Calculations or formulas

Summarized data (Summarized data to be included)

Key information/Formatting (Formatting to highlight specific information)

Signoff:

2. Build a report prototype.

a) Go to the BOC310 resource folders as initialized in the training systemlandscape. Click Start -> My Documents -> BOC310.

As a solution, refer to the following files:

• ReportProtoype.SWF as an interactive Flash file on developing areport prototype

• Report Prototype Form.pdf as a job aid

ResultYou now have a list of report requirements and a prototype of the contentand layout.

14 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 23: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Planning and Developing a Report Prototype

Lesson Summary

You should now be able to:• Determine the layout and content of a report• Develop a prototype of a report

2011 © 2011 SAP AG. All rights reserved. 15

SAP Class Week of February 13, 2012

Page 24: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

Unit SummaryYou should now be able to:• Define database terms• Determine the layout and content of a report• Develop a prototype of a report

16 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 25: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 26: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 27: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

17 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 28: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

18 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 29: BOC310 Col96 Part(Crystal Reports)

Unit 2Creating a Report

Unit OverviewThis unit provides the knowledge of creating a basic report using SAP Crystal Reports.

Unit ObjectivesAfter completing this unit, you will be able to:

• Create a report using different methods report• Choose a data source type• Add tables to a report• Describe linking• Build a report from the Design view• Navigate toolbars• Add objects from Field Explorer• Add objects from Report Explorer• Add objects from Repository Explorer• Determine data field type• Preview a report• View a report• Explain the differences between working in the Design and Preview tabs• Describe page controls• Describe the status bar• Add summary information• Save a report• Add reports to the Workbench• Check a report for errors• Position objects using a grid• Position objects using guidelines

2011 © 2011 SAP AG. All rights reserved. 19

SAP Class Week of February 13, 2012

Page 30: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

• Position objects using free form placement• Lock an object's position and size• Move objects• Align objects• Resize objects• Cut, copy, and paste objects• Format fields using the Formatting toolbar and the Format Editor• Lock an object's format• Use text objects

Unit ContentsLesson: Creating a Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Lesson: Adding Tables ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Lesson: Design Environment.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Lesson: Inserting Objects on a Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Lesson: Previewing a Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45Lesson: Saving a Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

Exercise 2: Build a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Lesson: Positioning and Sizing Objects .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65Lesson: Formatting Objects .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

Exercise 3: Position, Size, and Format Report Objects .. . . . . . . . . . . . . . . . . . . 79

20 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 31: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating a Report

Lesson: Creating a Report

Lesson OverviewIn order to create a report, you must first connect to the database that contains thatdata required.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Create a report using different methods report• Choose a data source type

Business ExampleDepending on the complexity of the report requirements and your familiarity withcreating a report, you can use one of three methods to create a report.

• Report Wizard• Blank Report• Another Report

Starting a New ReportWhen you launch Crystal Reports, the Start Page appears at the top of the screen.

Figure 1: SAP Crystal Reports – Start Page

2011 © 2011 SAP AG. All rights reserved. 21

SAP Class Week of February 13, 2012

Page 32: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

The Start Page includes links to recent reports you’ve opened, report creationmethods, the Help system, a search functionality, sample reports, and an updateservice. You can create a new report with Crystal Reports using these methods:

Figure 2: Report Wizard

• Use one of the Report Wizards provided.

A user who is unfamiliar with Crystal Reports, or someone who is familiar but isrushed, will find it easier to design a report using one of the Wizards, sometimesreferred to as Experts. You step through the report-building process of a specifictype of report when using an Expert.

• Build the report from the Blank Report option, piece by piece.

You can custom design a report using this method by starting with a blank reportand building the elements of the report piece by piece.

• Create a report using Another Report option.

Another quick method to build a report is to create it from an existing report. Thisexisting report can be used as a template since it may already contain much of theinformation and formatting you need. After you open the report you want to useas 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 choosethe data source you will use to create the report.

22 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 33: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating a Report

Specifying the Data Source

Figure 3: Specify Tables

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 theStart Page, the dialog box that displays will be one of several Data dialog boxes thatallow you to specify the data source from either an existing connection or by creatinga new connection.

If you choose to use a blank report as the basis of your new report, the DatabaseExpert opens automatically.

The options in the Database Expert are:

• My Connections

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.

2011 © 2011 SAP AG. All rights reserved. 23

SAP Class Week of February 13, 2012

Page 34: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

The data you use to create reports in your organization is stored in either a client-serverdatabase such as MS SQL Server, or a PC-type database such as Microsoft Access.You access sources through either an ODBC layer or directly through native drivers.ODBC stands for Open Database Connectivity. It is an interface that gives applicationsthe 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 Reportsallows for access to customer data. Reports that use a salesforce.com driverrefresh 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) . The ODBC (RDO) dialog box opens.

4. Locate and then click the appropriate data source, and then click Next. Thesecond window of the ODBC (RDO) dialog box appears, displaying theconnection information needed to log onto the selected data source.

5. In the Connection Information section of the ODBC (RDO) dialog box, enteryour user ID and password, if required, and then click Finish.

Hint: In your organization the database may be secure, meaning you might beprompted for a user ID and password. For this course, the sample databasehas not been secured.

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

24 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 35: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating a Report

Lesson Summary

You should now be able to:• Create a report using different methods report• Choose a data source type

2011 © 2011 SAP AG. All rights reserved. 25

SAP Class Week of February 13, 2012

Page 36: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Lesson: Adding Tables

Lesson OverviewFrom the data source connection, you can add the available tables and fields to a report.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Add tables to a report• Describe linking

Business ExampleAfter connecting to a data source, you will see the available data. You can then specifywhich tables to use for the report.

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

To add tables to a report

Figure 4: Adding tables to a report

Linking database tablesIf your report contains data from two or more database tables, you will need to link thetables when creating your reports. Linking requires that you use a field that is commonto both tables. You link database tables so records from one table match related recordsfrom another. You define the linking setup in the Links tab of the Database Expert.

26 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 37: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding Tables

Auto Link in the Database ExpertLinks tab automatically chooses links for yourtables based on common fields in tables or indexed fields (if your database supportsindexed fields).

Note: The color flags indicate that these fields are indexed. Indexed fields canincrease the speed of data access and reduce the time it takes for the programto evaluate data

2011 © 2011 SAP AG. All rights reserved. 27

SAP Class Week of February 13, 2012

Page 38: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

The other options in the Links tab include:

• Links display area

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

• Auto-Arrange

When you click this button, the program arranges the tables to fit in the mostefficient manner inside the Links display area.

• Auto-Link

Use this area to choose a method of linking tables. Click By Name to link tablesby their names or By Keyto use foreign key information. Click the Link button tolink tables automatically (by name or foreign key, as selected).

• Order Links

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 thelink 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 toselect it.

• Index Legend

This option opens the Index Legend dialog box so you can see a key to the indexindicators (arrows) used in the Links display area. The numbering of the indexindicators reflects the sequence in which the indexes were created. If a field ispart of several indexes, the index indicator in front of the field shows the colorsof the indexes the field is part of.

To link tables

1. Confirm the tables are linked correctly.2. Click OK.

28 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 39: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding Tables

Lesson Summary

You should now be able to:• Add tables to a report• Describe linking

2011 © 2011 SAP AG. All rights reserved. 29

SAP Class Week of February 13, 2012

Page 40: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Lesson: Design Environment

Lesson OverviewThe Design view is the environment in which you will build a report.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Build a report from the Design view• Navigate toolbars

Business ExampleWhen creating a report, you begin in the Design view, also referred to as the Designtab.

Design Tab

Figure 5: Design and Preview Tabs

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 initialformatting; place objects in the sections where you want them to appear; specifysorting, grouping, and totaling needs; and so forth.

30 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 41: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Design Environment

While working in the Design tab you manipulate “representative” for placeholdersof objects, not the objects themselves. The Design tab offers faster previewing ofinformation and layout because you are not working with the actual data itself. Whena field is placed on the report, the program uses a frame to identify the field on thetab; it does not retrieve the data yet. Thus, you can add and delete fields and otherobjects, move them around, set up complex formulas, and more, without tying up thecomputer 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 andinstructions for creating the final report, but it is not the report itself. To turn theDesign tab report into a final report or into a report that you can fine-tune, you adddata. Data adding occurs whenever you preview the report, print it, or output it in anyother way. The actual data appears in the report.

When you begin creating a report, Crystal Reports automatically creates five areas orsections in the Design window.

2011 © 2011 SAP AG. All rights reserved. 31

SAP Class Week of February 13, 2012

Page 42: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Figure 6: Design View

• Report Header

This section is used for the report title and other information you want to appearat the beginning of the report. It can also be used for charts and cross-tabs thatinclude data for the entire report. Items placed in the Report Header print only onthe first page of the report. Often the name of the report, the print date, companylogo, 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 eachpage. 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 fieldtitles above the fields on a report. Objects in the Page Header print at the top ofevery page of the report. Column headings, print dates, and page numbers arecommon entries in the Page Header.

• Details

This section is used for the body of the report and is printed once per record. Thebulk of the report data appears in this section. Place the data fields on which youwant to report in this area. This information (database fields and text) prints forevery record selected on the report.

• Report Footer

This section is used for information you want to appear only once at the end ofthe report (such as grand totals) and for charts and cross-tabs that include datafor 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 oftenplaced here.

• Page Footer

This section usually contains the page number and any other information youwant to appear on the bottom of each page. Objects placed here print at thebottom 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 abbreviatedforms (RH, PH, D, RF, and PF). You set the Short Section Name option in theDesign View area of the Layout tab in the Options dialog box from the Filemenu. You can also set this option by right-clicking on one of the sectionnames and selecting Show Short Section Names from the shortcut menu.

32 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 43: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Design Environment

Each section is indicated by a section boundary. These lines indicate the separation ofthe areas and do not print to paper.You can move these bars to change the amount ofspace reserved for each section. You click and drag the section divider to the desiredposition; however, you can drag the bottom line only to affect the size of the section.

Figure 7: Design View

Working with Toolbars in Design ViewThe Report Designer window includes several toolbars. SAP Crystal Reports groupsseveral commonly used commands on a toolbar that remains on screen at all timesunless you choose to turn it off using the Toolbar command on the View menu.

Figure 8: Explorers

2011 © 2011 SAP AG. All rights reserved. 33

SAP Class Week of February 13, 2012

Page 44: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

The toolbars are:

• Standard

This toolbar contains several commonly used commands

• Formatting

This toolbar contains commands for formatting the selected field.

• Insert Tools

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 movingaround the report.

• External Command

This toolbar is where organizations can access custom applications or plug-insthat they have created for Crystal Reports.

Note: The ability to customize Crystal Reports by using Add-ins in theReport Designer allows report developers to extend the functionality of theapplication. This customization can include application-specific toolbars,branded billboards, splash screens, and launching of other applications.This flexibility provides opportunities to customize Crystal Reports to yourcompany's specifications.

The toolbars are floating toolbars. You can position them on any of the four sidesof the screen, or float them on your design area. Each toolbar displays an icon thatvisually describes the command it represents. You activate a toolbar command byclicking the appropriate icon.

To move a toolbar, click and hold in an unused part of the toolbar, between groups ofbuttons, or on the unused area at the beginning or end of the toolbar. Drag the entiretoolbar to the desired location. As you approach the edge of the screen, the toolbarautomatically stretches to match that side.

34 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 45: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Design Environment

The toolbar eliminates some of the steps needed to activate a command, increasingthe speed with which you create reports.

Hint: If you are not sure about the function of a button on the toolbar, placethe pointer over the icon and hold it there until a tooltip appears.

2011 © 2011 SAP AG. All rights reserved. 35

SAP Class Week of February 13, 2012

Page 46: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Lesson Summary

You should now be able to:• Build a report from the Design view• Navigate toolbars

36 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 47: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Inserting Objects on a Report

Lesson: Inserting Objects on a Report

Lesson OverviewIn SAP Crystal Reports, you can add objects to a report. Objects, such as databasefields and various report objects, are organized and managed from Explorer windows.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Add objects from Field Explorer• Add objects from Report Explorer• Add objects from Repository Explorer• Determine data field type

Business ExampleWhen creating a report, you need to add placeholders for the data in Design view. Theavailable objects are managed through Explorer windows.

Working with the Field ExplorerDatabase fields, formula fields, lines, and boxes are examples of the types of objectsyou can place, move, and resize on your report. You access and insert these objectsonto the report from the Field Explorer.

Use the Field Explorer to insert, modify, or delete fields on the Design and Previewtabs. 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 youcan add to your report. It also shows formula fields, SQL expression fields, parameterfields, group name fields, and running total fields that you have defined for use inyour report.

You can dock the Field Explorer dialog box. In free-floating mode, drag the FieldExplorer to any location. Alternately, dock the Field Explorer as a tab, similar tothe Design tab.

2011 © 2011 SAP AG. All rights reserved. 37

SAP Class Week of February 13, 2012

Page 48: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

The Field Explorer’s toolbar offers these functions:

• Insert to Report

Use this option to add a field to the report. You can insert more than one field ata 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 Previewtabs.

• Browse

Use this option to browse data for a database field, formula field, or SQLexpression 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 FieldExplorer. 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 expressionfield, 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 chooseDelete to remove them all at once.

Hint: Each button on the Field Explorer’s toolbar has an associated shortcutoption that’s displayed in the tooltip.

38 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 49: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Inserting Objects on a Report

To insert fields onto a report

1. On the Standard toolbar, click Field Explorer. The Field Explorer dialog boxappears. To speed the report building process, this dialog box remains on screenuntil 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 thedatabase(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.

Hint: 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 toplace them. You can also drag and drop fields to add them to the report. Youcan right-click the field in the Field Explorer to invoke a shortcut menu thatdisplays the Insert to Report option.

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

Determining data field typesYou can take a look at a sample of the actual data in the table before you place thefield 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.

Note: The default setting is either to display the first 500 records or to timeout at five seconds, depending on what has been set up. If you have largetables with more than 500 records, you will not see examples of all the datacontained in the fields.

Hint: You can also browse the field data in the database tables after youplace the field on the report by right-clicking the field and selecting BrowseField Data from the shortcut menu.

2011 © 2011 SAP AG. All rights reserved. 39

SAP Class Week of February 13, 2012

Page 50: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Working with the Report ExplorerThe Report Explorer appears when you select the Report Explorer command from theView 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 thereport objects contained in each section and works like a “report navigator”. You canwork with report objects directly from the explorer.

The Report Explorer's toolbar provides buttons that let you expand or collapse yourreport'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 selectednode. If you select this option while the root node is highlighted, all remainingnodes are expanded. If you select this option while a child node is highlighted,only the nodes that are part of the child are expanded.

Note: This option has no effect if selected while a report object ishighlighted, 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 includeformula fields, summary fields, and text objects.

• Show/Hide Graphical Objects

Use this option to show or hide graphical objects in your report. Graphicalobjects 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 yourreport.

You can dock the Report Explorer dialog box. In free-floating mode, drag the ReportExplorer to any location. You can also dock the Report Explorer as a tab, similarto 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'ssections.

Within each section, the report's fields and objects are listed. Any item you selectin 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 actionsyou can carry out on the item.

40 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 51: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Inserting Objects on a Report

For example, if you right-click a text object, the menu contains the options to edit thetext, to format 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.

Note:

• You can select multiple fields for formatting by using Ctrl-click;however, you cannot add additional fields or report objects when usingthe Report Explorer, but you can delete 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 dashedunderline. These indicators are available if you are using a MicrosoftWindows operating system only.

• You can use the openDocument function to create hyperlinks to othertypes of reports (for example, Web Intelligence reports).

To use the Report Explorer

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

2. Right-click the field you want to format and select the option you want to applyfrom the shortcut menu.

3. Apply the changes.

Working with the Repository ExplorerThe 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• Commands (queries)• Custom functions• List of Values

2011 © 2011 SAP AG. All rights reserved. 41

SAP Class Week of February 13, 2012

Page 52: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

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 limitthe type of repository items displayed in the Repository Explorer. You can alsoselect options to sort multiple items by name or by type.

• Advanced filtering

Use this option to display filtering options at the bottom of the RepositoryExplorer. Use these filters to find specific items by words from the Name orAuthor fields in the Add Item dialog box.

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

• Delete the item/folder

Use this option to permanently remove the selected item or folder from therepository. When you 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 isdisplayed in the Repository Explorer.

Hint: Hover your mouse’s cursor over any object in the Repository Explorerto see a tooltip. Tooltips for text objects and bitmaps include Author andDescription information as well as the complete text of the SQL statement.

By maintaining a shared repository of report objects, you can modify a particularobject and update all reports containing that object as they are opened for use. Acentral location for report objects also helps with the task of managing your data—animportant benefit in maximizing productivity and minimizing costs at your company.

The BusinessObjects Enterprise Repository is contained in BusinessObjectsEnterprise. Depending on the version of Crystal Reports you have, you can install aversion of BusinessObjects Enterprise to access the repository.

42 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 53: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Inserting Objects on a Report

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

To open the Repository Explorer

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

Hint: Another way to do this is to click the Repository Explorer optionunder the View menu.

2. . If you’re not logged onto the repository in BusinessObjects Enterprise, clickthe 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, andAuthentication 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.

2011 © 2011 SAP AG. All rights reserved. 43

SAP Class Week of February 13, 2012

Page 54: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Lesson Summary

You should now be able to:• Add objects from Field Explorer• Add objects from Report Explorer• Add objects from Repository Explorer• Determine data field type

44 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 55: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Previewing a Report

Lesson: Previewing a Report

Lesson OverviewWhen you create a new report, you begin in the Design tab. You can view the report inthe Preview tab to see the results. Learn the preview options in SAP Crystal Reportsto understand how the information displayed in a report is affected. From the Previewtab, you can evaluate the format and layout of the report's design.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Preview a report• View a report• Explain the differences between working in the Design and Preview tabs• Describe page controls• Describe the status bar

Business ExampleAs you are building a report or when you are finished, you want to see how the data isdisplayed on the report.

Previewing reportsOnce 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.

Hint: The area at the bottom of the Report Designer environment is calledthe page controls area, which shows you the date and time that the data waslast refreshed.

2011 © 2011 SAP AG. All rights reserved. 45

SAP Class Week of February 13, 2012

Page 56: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

The program gathers the data, makes the necessary calculations, and displays thereport in the Preview tab. With the data in place, you can review the spacing andformatting of your report and see the actual results of all your summaries, formulacalculations, and record and group selections.

The program works with data in this manner:

• The first time the Preview tab is used, it retrieves data from your underlyingdata source(s) and saves it with the report (unless you have set up the programnot to save data).

• From that point on, the program uses the saved data whenever you preview thereport unless you specifically refresh it or add a field that requires the program toretrieve new data.

When you save data with a report, the data is saved in a cache file with the reporton 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 overthe web in a zero-client environment, the HTML Preview option lets you see aninstant rendering of your report to HTML without leaving the Crystal Reports designenvironment. Unlike the Preview tab, which shows the true report format, the HTMLPreview tab shows a converted format. By switching between the two tabs, you canmake adjustments in your report design to yield the best results on the web.

In the case of reports that are published to BusinessObjects Enterprise (managedreports), you don’t have to do any special configuration to make the HTML Previewfeature work.

For stand-alone reports (unmanaged reports), the program must use a stand-aloneReport Application Sever (RAS) to generate the preview. In this case, you need toconfigure the HTML Preview feature. Do this in the Servers tab of the Options dialogbox in Crystal Reports.

If you open a large report in HTML Preview, a progress indicator displays. Oncethe report is open in HTML Preview, you will see a stationary group tree to the leftof the report and a stationary toolbar above the report. You can use the group treeand toolbar to navigate from one page of the report to another without scrolling upand down. The HTML Preview also displays the page margins so you know whatthe report will look like if it is printed.

46 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 57: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Previewing a Report

Viewing a reportCrystal 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.

Using the navigation buttons in the Preview tab, you can move to the beginning orend of the report, or you can move backward and forward through the report onepage 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 theStandard 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 youcreated in your report. You can, however, customize these names using the Optionstab of the Insert Group or Change Group Options dialog box.

When you click the tree node for the group that interests you, the program jumpsimmediately to the part of the report that contains the information for that group. Forlonger reports or reports in which you want to jump back and forth between differentgroups, the navigation features of the Group Tree view make your work extremelyefficient.

Zooming in and out

Zooming enables you to move from a full-page view to a zoom between 25% and400% 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 ifgraphics are positioned properly, and so on. Zooming in at a high magnification levellets you focus on the finer details of your report. Magnification factors can be set todifferent percentages in the Design and Preview tabs.

2011 © 2011 SAP AG. All rights reserved. 47

SAP Class Week of February 13, 2012

Page 58: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Page controls

Page controls enable you to move forward or backward through the report one pageat a time, to move to the first or last page, to cancel the printing of the report, andto close tabs.

The Data Age indicator indicates the date the data was last refreshed or initiallyretrieved, whichever is the most recent. If the data was initially retrieved or refreshedtoday, 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 fieldname, its position on the report, and how many records were returned. When youhover 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 Viewmenu. By default, the status bar is shown (a check mark appears beside the commandon the menu).

Working in the Design and Preview tabsOften, you will find it easier to work in the Design tab when working with multiplesections and areas. You may sometimes want to work in the Preview tab where youcan 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 Designtab. Menus (both menu bar and shortcut menus) and toolbars remain active, providingessentially the same functionality you have when working with a report in the Designtab. However, when you are making numerous changes, it is quicker to make thechanges in the Design tab.

48 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 59: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Previewing a Report

Some additional things to consider are:

• The Design tab and Preview tab are tied together internally. Any changes madein one are reflected in the other.

• The Preview tab has a single vertical ruler at the left of the tab rather than theindividual section rulers seen in the Design tab. The functionality of the ruleris the same.

• The Preview tab identifies report sections in the shaded area to the left of thedata. With a quick look you can tell which report section the data is printingfrom. While section names appear only once in the Design tab, they print eachtime a section prints in the Preview tab.

• The record counter, the Data Age indicator, and the Page Forward/Page Backcontrols are all active in the Preview tab.

• The Preview tab highlights every value when you select a field, whereas, onlythe field frame is highlighted in the Design tab.

Working in the Preview tab has a different feel from working in the Design tab. Eachfield in a database contains dozens, hundreds, or even thousands of values, dependingon 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, sizinghandles appear on the frame and the frame changes color.

In the Preview tab, however, you are working with the actual data. Instead of a fieldframe representing many field values, the values themselves appear. When youhighlight a field or formula field value, you are actually selecting every value in thefield:

• 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 areport is the same in both the Design tab and the Preview tab.

Hint: When working in the Preview tab, remember that each change youmake may require extra time to process because you are working with theactual data, not just the placeholders (as in the Design tab).

2011 © 2011 SAP AG. All rights reserved. 49

SAP Class Week of February 13, 2012

Page 60: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Lesson Summary

You should now be able to:• Preview a report• View a report• Explain the differences between working in the Design and Preview tabs• Describe page controls• Describe the status bar

50 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 61: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saving a Report

Lesson: Saving a Report

Lesson OverviewWhen saving a report, you can add information, such as description, report author,keywords and comments. You can then save the report to various options.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Add summary information• Save a report• Add reports to the Workbench• Check a report for errors

Business ExampleAfter a report is completed, you will want to search for it or modify it. If you need tofollow up, you can refer to the report's summary information for helpful details.

Adding summary informationYou can save summary information with the report. Summary information containssuch 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 dataon which the report is based, a report title, or a comment about some particular dataon the report).

Summary information provides a facility for including anything from a short note tohundreds 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 theycan be reviewed on demand.

To add summary information

1. Select File → Summary Info.

The Document Properties dialog box appears with the Summary tab active.

2. Enter the desired information and clickOKwhen finished to return to your report.

2011 © 2011 SAP AG. All rights reserved. 51

SAP Class Week of February 13, 2012

Page 62: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Saving a reportThe saving function is the same in Crystal Reports as in many other applications. TheOpen, Save, and Save As dialog boxes enable you to open or save a report convenientlyto personalized folders that are created by your operating system. If one of thesefolders does not exist on your machine, the corresponding button will not be displayed.

The personalized folders are:

• Desktop

This 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 yourreports over the Web, instead of by email or hard copy.

• Enterprise

If your company has deployed BusinessObjects Enterprise, a web-based reportmanagement tool, you can log onto the system so you can view the reports storedon the Enterprise system.

• My Connections

This folder shows a list of data sources to which you are connected.

Saving a preview of a reportYou can save the first page of a report as a preview or “snapshot ”of a report so thatyou 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 youmodify the report in the Design tab, and save the report but do not preview, thesnapshot will not be updated.

• Because the snapshot is saved in the report file, the addition of the previewpicture may increase the size of the file.

52 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 63: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saving a Report

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 SavePreview Picture check box, if required.

Note: The Save Preview Picture check box is active by default.

4. Click OK.

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.

Working with the WorkbenchThe Workbench is a folder structure that can represent the type of projects you workon. In the Workbench, you can create projects (folders) that contain one or morereports. For example, if you are a report designer in the financial department of anorganization, you could have separate folders for Accounts Payable and AccountsReceivable.

Use the options on the toolbar to add, remove, or rename folders, reports, and objectpackages. You can reorganize the files in a folder or folders by dragging and droppingthem where you want them to appear. You can also drag report files from WindowsExplorer and drop them into the folder of your choice in the Workbench.

2011 © 2011 SAP AG. All rights reserved. 53

SAP Class Week of February 13, 2012

Page 64: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

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 cansearch for a Crystal report that you have previously created.

– Add New Project

When you select this option, the program adds a new folder under the rootnode that is called Workspace. You can add reports to this folder. Projectfolders 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 yourBusinessObjects Enterprise system. When you have connected to yoursystem, 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 inthe Workspace folders.

• Check Dependencies

Use this option to initiate the Dependency Checker, a method of checking forerrors in a report. The option is available for individual reports or for folders ofreports. Crystal Reports begins checking the report(s) immediately and displaysthe results in the Dependency Checker.

You can right-click any item in the workspace area of the Workbench to see a shortcutmenu. Many of the options that are available on the shortcut menu are also availableon the toolbar. This section describes only the additional options that are not availableon 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 Workspacearea.

Note:

– You cannot undo this option.

54 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 65: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saving a Report

– When you remove a folder, you remove all of the items in it atthe same time.

• Publish to BusinessObjects Enterprise

Use this option to publish a folder of reports to BusinessObjects Enterprise. Youcan publish your reports individually or as an object package. (Object packagescan be scheduled in BusinessObjects Enterprise as a single entity.) When youchoose 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 toAdd, 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 theworkspace to set the project folder.

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 theOpen dialog box, and then clickOpen.

The report is added to the folder.

Checking a report for errorsThe Dependency Checker appears when you check a report or project for errors in theWorkbench, or when you select the command on the Report menu for a report thatyou have open in Crystal Reports. The Dependency Checker registers several typesof 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, oryou can select a report in the Workbench to check for errors.

2011 © 2011 SAP AG. All rights reserved. 55

SAP Class Week of February 13, 2012

Page 66: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Errors listed in the Dependency Checker show the following information:

• Error type

Icon Meaning

Success. The Dependency Checker hasverified that there are no errors in the file.

Warning. The Dependency Checker hasfound something in the file that might bea problem. You can verify the warning,but you don’t have to fix it to have thereport run correctly.

Error. The Dependency Checker hasfound an error that you must fix so thatthe 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 thatyou 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 thatrecommends you run the check again.

When you right-click a message in the Dependency Checker, a shortcut menu appearswith these options:

• Go To

Use this option to open the report that contains the error and to go to the objectthat is causing the problem. You can also select a message and press Enter ordouble-click to open the report.

• Sort By

Use 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

56 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 67: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saving a Report

Use this option to copy the message to the clipboard so that you can paste itinto 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 theDependency Checker.

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.

Hint: You can also select a message and press Enter or double-click toopen the report.

2011 © 2011 SAP AG. All rights reserved. 57

SAP Class Week of February 13, 2012

Page 68: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

58 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 69: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saving a Report

Exercise 2: Build a Report

Exercise ObjectivesAfter completing this exercise, you will be able to:• Build a new report based on the blank report option

Business ExampleAs a report designer, you want to build a new report based on the Customer tableand the Orders table from the Xtreme Sample Database (via an ODBC data sourceconnection).

Task 1: Build a New ReportYou will build a new report based on the blank report option in SAP Crystal Reports.

1. Start a new report based on the blank report option.

2. Add the Customer table and the Orders table.

3. Add these database fields to the report:

Figure 9: Build a New Report

Task 2: Preview and Explore the ReportFrom the Design view, you will preview and explore the new report.

1. Preview the report.

2. Open the Report Explorer to view a list of the report objects.

3. Change the magnification in the Preview tab.

Continued on next page

2011 © 2011 SAP AG. All rights reserved. 59

SAP Class Week of February 13, 2012

Page 70: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Task 3: Save the ReportYou will add summary information, save a preview or snapshot, add the report toWorkbench and check for errors.

1. Add summary information.

2. Save the report as Creating a report.rpt.

Note: Save all activity reports to My Documents.

3. Add the report to the Workbench.

60 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 71: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saving a Report

Solution 2: Build a ReportTask 1: Build a New ReportYou will build a new report based on the blank report option in SAP Crystal Reports.

1. Start a new report based on the blank report option.

a) Click Start -> Programs -> Crystal Reports 2011 -> Crystal Reports 2011to launch SAP Crystal Reports.

b) From the Start Page tab, click Blank report.

2. Add the Customer table and the Orders table.

a) From the Database Expert dialog box, select the ODBC (RDO) connectionto Xtreme.

Note: If this is not listed as a data source, create a new connectionvia ODBC to Xtreme sample database.

b) From the Xtreme tables, double-click Customer and thenOrders. Click OK.

c) From the Links tab, accept the automatic linking. Click OK.

3. Add these database fields to the report:

Continued on next page

2011 © 2011 SAP AG. All rights reserved. 61

SAP Class Week of February 13, 2012

Page 72: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Figure 10: Build a New Report

a) Open Field Explorer. Click View -> Field Explorer.

b) Expand Database Fields -> Customer. Expand Database Fields -> Orders.

Select the specified fields from the Customer and Orders tables.

Hint: For multiple selection of fields, press the CTRL key downas you click each field.

c) Drag the fields to the Details section.

Note: When you drag the fields to the Details section, field labelsare automatically created and simultaneously placed in the PageHeader section. You can delete or move these tables as needed.

Task 2: Preview and Explore the ReportFrom the Design view, you will preview and explore the new report.

1. Preview the report.

a) From the top menu, click View -> Preview Sample.

b) When prompted for the number of records to include in the preview sample,accept the default All records option. Click OK.

Caution: If you are expecting a large number of records, specify alimit to the number of records to preview as a sample.

2. Open the Report Explorer to view a list of the report objects.

a) From the top menu, click View -> Report Explorer.

3. Change the magnification in the Preview tab.

a) From the top menu, click View -> Zoom.

b) From the Zoom dialog box, select the Fit One Dimension option to viewthe report based on its page width. Click OK.

Continued on next page

62 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 73: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saving a Report

Task 3: Save the ReportYou will add summary information, save a preview or snapshot, add the report toWorkbench and check for errors.

1. Add summary information.

a) From the top menu, click File -> Summary Info.

b) In the Document Properties tab, specify summary data as desired. .

c) Ensure that the Save Preview Picture checkbox is selected. This will save asnapshot of the report. Click OK

Note: The Save Preview Picture checkbox is selected by default.

2. Save the report as Creating a report.rpt.

Note: Save all activity reports to My Documents.

a) From the top menu, click File -> Save.

3. Add the report to the Workbench.

a) Click View -> Workbench.

b) From the Workbench panel, click Add.

c) Select the report from My Documents.

Note: A new project folder is automatically created.

d) Rename the project folder to Report Design I.

e) Select Creating a report.rpt and click the Check Dependencies icon fromthe Workbench toolbar.

2011 © 2011 SAP AG. All rights reserved. 63

SAP Class Week of February 13, 2012

Page 74: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Lesson Summary

You should now be able to:• Add summary information• Save a report• Add reports to the Workbench• Check a report for errors

64 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 75: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Positioning and Sizing Objects

Lesson: Positioning and Sizing Objects

Lesson OverviewAfter the fields and objects have been placed on the report, you will need to resize andreposition the objects from either the Design or Preview tab.

Lesson ObjectivesAfter completing this lesson, 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

Business ExampleOrganize the report objects for the optimum display of data.

Positioning and sizing objectsOnce you have placed fields and objects on your report, you may want to repositionor resize them. You can reposition and resize objects from either the Design or thePreview tab.

Positioning and sizing objects is easier in the Design tab because you are moving onlythe placeholder rather than the representative data.

Positioning objects using a grid

Different reporting needs require different methods of positioning objects on yourreport. 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 onemarking the intersection of a vertical and horizontal gridline.

2011 © 2011 SAP AG. All rights reserved. 65

SAP Class Week of February 13, 2012

Page 76: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

When using Snap to Grid, your objects are placed at a gridline. As you move objectsaround, they “snap” from gridline to gridline. This functionality makes it easy to lineup objects both horizontally and vertically.

The Grid display and Snap to Grid on/off options are independent of each other. Youalso 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.

Hint: 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.

Positioning objects using guidelinesIf you want to line objects up with one another, you can insert a guideline and attachthe objects to it. Then, in one step, you can move the guideline to reposition all theobjects attached to the guideline.

When the Guidelines check box is selected, Crystal Reports automatically places avertical marker in the ruler for each field you place in the Details area. These markersor “handles ”let you move the fields and their column headings horizontally on yourreport at the same time by moving the guideline arrowhead.

Hint: Remember that guidelines are visible in both the Design and Previewwindows only if you have the Show Guidelines in Design and ShowGuidelines in Preview check boxes selected under File →Options → Layout.The guideline handles will not appear in the Preview tab unless you select anobject on the report.

When you click a field to move or resize the object, tracker guidelines appear, aligningthe object against the horizontal and vertical rulers to let you clearly see the placement.

66 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 77: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Positioning and Sizing Objects

Caution: You can have as many guidelines as you want, but beware of“guideline clutter”. If you find 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.

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 adashed line extending from it to the opposite side of the Design area. Objectsdragged to this guideline “attach” themselves to it, ensuring that all objectsare lined up together.

2. Attach all the objects that you want to manipulate then drag the guidelinearrowhead to move all the objects together.

Note: Clearing the “Guidelines” check box in the “Options” dialogbox causes your guidelines to disappear within the Design window.However, the arrowheads still show in the ruler lines so you can stillmove objects that are attached to the now invisible guideline.

To remove an object from a guideline

• Drag the object away from the guideline.

To remove a guideline

• 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 rulerline.

To remove all guidelines

Right-click the guidelines and select Remove All Vertical Guidelines or Remove AllHorizontal Guidelines from the shortcut menu.

2011 © 2011 SAP AG. All rights reserved. 67

SAP Class Week of February 13, 2012

Page 78: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Positioning objects using free-form placementIf you turn the gridlines and Snap to Grid off, you have the freedom to place objectsanywhere on the Design window you want. Objects can even be placed offset fromone another.

Hint: For the examples and activities in this training guide, keep Snap to Gridselected. You can choose 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. Whenyou set this option, you cannot drag the object in the Report Designer and the Sizeand 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 objectsYou 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.

Some of the operations deal with the concept of the main object, the last object youselect. Certain limitations apply in certain operations:

• If the new location of a multiple objects selection does not accommodate all theselected objects, then the main object and those that can be accommodated willbe moved. The other objects will remain in their original locations. However, ifthe new location does not accommodate the main object, then no object will bemoved.

68 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 79: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Positioning and Sizing Objects

The Move submenu includes these commands:

• Backward

When you have multiple objects in a stack, use the Backward command to movethe selected object backward (down) one layer in your stack. In order to accessan object you have moved backward, you can move objects that are above it outof the way or move those objects backwards.

• To Back

When you have multiple objects in a stack, use the To Back command to movethe selected object to the bottom of the stack.

• Forward

When you have multiple objects in a stack, use the Forward command to movethe 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 movethe selected object to the front (top) of the stack.

To select and move a single object

1. Click the object once to activate the handles. The object is selected.2. Move your cursor over the object until the four-way cursor appears.3. Click and drag the object to a new position.

To select multiple objects

1. Ctrl-click each object in succession.

Hint: You can also right-click the section and click Select All SectionObjects from the shortcut menu.

2. Click the first object once to show its handles, then hold down the Ctrl key onyour keyboard and click the other objects. As you do this, handles appear onall the objects

3. Once you have selected all desired objects, release the Ctrl key, and then clickand hold on any of the selected objects. The four-way cursor appears as you dragthe objects to a new position.

2011 © 2011 SAP AG. All rights reserved. 69

SAP Class Week of February 13, 2012

Page 80: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

To select multiple objects with a marquee or lasso

Hint: Clear any selected objects before using the marquee or lasso by clickingin 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 objectsyou want selected. When you release the mouse, all objects partially surroundedby the marquee are selected.

2. Once you have selected multiple objects, click and hold on any of the selectedobjects and drag the objects to a new position.

3. Once your objects are in their new position, click an unused area of the Designwindow 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 guidelinearrowhead and moving it to a new position.

1. Create a new guideline by clicking in either the horizontal or vertical ruler barwith 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.

Aligning objectsThe main object is the object that you want to align other objects with. To make anobject the main object, click it last when doing a control-click multiple selection. Youcan 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.

70 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 81: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Positioning and Sizing Objects

Some of the operations deal with the concept of the main object, the last object youselect. Certain limitations apply in certain operations:

• You can select multiple objects in the same section or different sections of areport and align them, with the condition that the alignment will not result inan object being moved to a different section of the report. For example, if youselect an object in the Report Header and another object in the Page Header, youcan align them vertically but not horizontally since moving objects horizontallywould 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 handlesappear, the object is selected.

2. Drag one of the handles with the double-arrow sizing cursor to change thesize of the object. This cursor may appear as vertical, horizontal, or diagonal,depending on the handle you have grabbed. You can resize multiple objects atthe same time by selecting them, then using the double-arrow sizing cursor tostretch 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 mainobject. 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 alsoclick Format → Size.

3. Select Same Width, Same Height, or Same Size to resize the objects.

2011 © 2011 SAP AG. All rights reserved. 71

SAP Class Week of February 13, 2012

Page 82: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Cutting, copying, and pasting objectsTo facilitate faster report design, you can copy and paste objects from one section toanother area. When you copy an object, you are copying the actual data value of thatobject, not just the object definition. This way, you can copy and paste objects withdata 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’sproperties. 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 theapplicable operation from the shortcut menu.

2. Click Edit → Cut/Copy/Paste. Alternately, you can press Ctrl-X or Shift-Deletefor Cut, Ctrl-C or Ctrl-Insert for Copy, or Ctrl-V or Shift-Insert for Paste.

Hint: 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.

72 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 83: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Positioning and Sizing Objects

Lesson Summary

You should now 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

2011 © 2011 SAP AG. All rights reserved. 73

SAP Class Week of February 13, 2012

Page 84: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Lesson: Formatting Objects

Lesson OverviewAfter you have placed fields and objects on the report, you may want to change theirappearance. SAP Crystal Reports enables you to change many of the attributes such asfont, color, and borders through the Formatting toolbar and the Format Editor.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Format fields using the Formatting toolbar and the Format Editor• Lock an object's format• Use text objects

Business ExampleYou want the report to have visual impact. Format the fields and objects to improvehow the report data is displayed.

Formatting fields using the Formatting toolbarThe Formatting toolbar includes such options as font formatting, text formatting andalignment, 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 theway the data displays on your report. For example, you might prefer your numbers tobe printed with two decimal places and 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

74 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 85: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Objects

Formatting fields using the Format EditorUsing the Format Editor is another, more complex method of formatting. Some of themore 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 recordspans more than one page, control borders of the field, limit the number of lines thefield can print, rotate and align text, add tooltip text, and lock the size and position ofthe selected object.

Border tab of the Format Editor

On the Border tab, you can select line styles, drop shadows, and the color for theborder and the background. Clicking Background opens a second color selection listfor you to choose a fill color for the text object.

Font tab of the Format Editor

On the Font tab, your options include the changing the font, style, size, and color. Youcan also add a strikeout (a line through text) and underline effects. The sample boxshows you the results of your choices.

Hint: Many of the attributes you see in the Format Editor have the formulabuttons next to them. These buttons are used for conditional formatting, orapplying a condition to a specific format using a formula.

Number tab of the Format Editor

2011 © 2011 SAP AG. All rights reserved. 75

SAP Class Week of February 13, 2012

Page 86: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

If you select a numeric field to format, the Format Editor offers these options on theNumber tab.

• System Default Number Format

This option checks the settings in your Windows control panel and uses thosesettings for your numeric fields.

• Currency symbol area

This 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 ofdecimal places or to the nearest whole number if no number of decimalplace is indicated.

– Negatives

This option offers several different ways to display negative values.

– Decimal Separator

This option enables you to specify what character to print as a decimalseparator.

– Thousands Separator

This option enables you to turn the thousands separator on and off. Theinput box allows you to specify what that separator is.

– Leading Zero

This option enables you to turn leading zeroes on and off as well as specifythe format.

76 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 87: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Objects

To change the attributes of a field

1. . Right-click a field and select Format Field from the shortcut menu. TheFormat Editor opens.

The tab that is displayed depends on the type of field selected. For example, if anumber field is chosen, then the Number tab is displayed.

2. Select the options on the appropriate tab that you want to apply.3. Click OK.

Locking an object's formatSimilar to locking an object’s position and size, you can also lock the format of anobject so it can’t be changed accidentally.

To lock the format of an object

1. Select the object.2. Click Lock Format on the Formatting toolbar.

Using text objectsText objects are containers that hold information giving you flexibility and controlwhen inserting text into your report. A text object can contain a character, a word, or aparagraph. Database fields and formula fields can be embedded inside text objectsalong with other text. For example, you may want to combine the first and last nameof customers from your database on a mailing label.

Text objects and the elements inside them can then be independently formatted withfonts, color, tabs, and so on.

Suppose you want to put a title on your report. To do this, you need to create a textobject. Text objects have some word processing capabilities, allowing you to type textas well as set, move, and use tabs. You can create left, center, right, and decimal aligntabs inside text objects.

Hint: When you have completed any editing changes, do not press Enterto end the process. This action inserts a return inside the text object. Clickoutside the text object to finish the editing process. If you want to add a newparagraph in a text object, then press Enter to move to the next paragraph.

2011 © 2011 SAP AG. All rights reserved. 77

SAP Class Week of February 13, 2012

Page 88: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

To insert a text object

1. Click Insert Text Object on the Insert Tools toolbar.

You can also click Insert → Text Object. A new, empty text object attaches toyour cursor.

2. Position the text object where you want it on your report, and then click torelease.

The text object opens on your report with its own ruler line. The cursor flashesinside the text object at the insertion point.

3. Enter the text you want to print on your report inside the text box.4. Click outside the text object or click Esc to cancel the selection.

To move or reposition a text object

1. When working with text objects, click the border once to select them. Onceselected, handles appear around the object.

2. Click the text object to move it to a new position or resize it. This functionalityis called the Move/Resize mode.

To edit the text inside a text object

1. Double-click the object.

The insertion point flashes inside the text object to indicate the position whereinserted text will appear.

You can also right-click the text object and select Edit Text Object from theshortcut menu. A ruler line opens above or below the text object. This lineindicates you are inside the text object, ready to edit. You can also set tabs andindents similar to the functionality in a word processor.

2. Edit the text inside the text object.3. Click outside the text object to cancel the selection.

The object now appears with four corners surrounding the text inside.

Hint: The place where the ruler line appears depends on the position of thetext object. If the text object is too close to the top of the screen to add aruler line, it will appear below.

78 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 89: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Objects

Exercise 3: Position, Size, and FormatReport Objects

Exercise ObjectivesAfter completing this exercise, you will be able to:• Position, size and format fields and objects on a report

Business ExampleAs a report designer, you need to consider how to make the report's appearanceeffective for its intended audience. You need to change the appearance of the report.

Task 1: Rearrange and Resize FieldsRearrange the fields in this order, from left to right: Region, City, Customer Name,Order Date, Order Amount and Order ID. You will need to resize these fields todisplay the data.

1. Open the report, Creating a report.rpt.

Hint: It is recommended that you make the changes from the Designtab. From this view, you are working with placeholders rather than fromthe Preview, which includes actual data. This can effect the speed ofthe report design process.

2. In the Details section, rearrange the fields in the specified order from left to right,by using guidelines. The labels should remain in the Page Header section.

Task 2: Format the FieldsFormat the fields and column headings to properly display the data.

1. Resize the fields and labels to fit the text as needed.

2. Format the currency field, Order Amount, with no decimals and no currencysymbol.

3. Format the text field, Region, and its column heading label to be centered.

4. From the Report Explorer panel, format Order Date to print with no time portion.

Continued on next page

2011 © 2011 SAP AG. All rights reserved. 79

SAP Class Week of February 13, 2012

Page 90: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

5. Change the color of all column headings to print bold and in blue. Use Select allSection Objects.

6. Create a text object that will print “Customers & Orders Report” as the titlein the Report Header.

7. Format the report title text box.

8. Save the report as Positioning+ objects.rpt.

Note: Save all activity reports to My Documents.

80 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 91: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Objects

Solution 3: Position, Size, and FormatReport ObjectsTask 1: Rearrange and Resize FieldsRearrange the fields in this order, from left to right: Region, City, Customer Name,Order Date, Order Amount and Order ID. You will need to resize these fields todisplay the data.

1. Open the report, Creating a report.rpt.

Hint: It is recommended that you make the changes from the Designtab. From this view, you are working with placeholders rather than fromthe Preview, which includes actual data. This can effect the speed ofthe report design process.

a) Navigate to My Documents to find the report.

2. In the Details section, rearrange the fields in the specified order from left to right,by using guidelines. The labels should remain in the Page Header section.

a) Click on the horizontal ruler to add a vertical guideline to indicate theplacement of the field. Repeat for each field.

b) Drag the field to the vertical guideline. The red corners indicate that thefield is snapped to the grid guideline. Repeat for each field.

Hint: Select both the field and its corresponding column headinglabel to move at the same time. Press the CTRL key to selectmultiple fields.

Continued on next page

2011 © 2011 SAP AG. All rights reserved. 81

SAP Class Week of February 13, 2012

Page 92: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

Task 2: Format the FieldsFormat the fields and column headings to properly display the data.

1. Resize the fields and labels to fit the text as needed.

a) Select each field. Press the Shift + the left or right arrow keys to resizethe field.

Hint: Select multiple fields to resize. Then, click Format -> Makesame size -> Both. Or, only select either width or height to be thesame.

2. Format the currency field, Order Amount, with no decimals and no currencysymbol.

a) Right-click the Order Amount field and select Format Field.

b) From the Number tab, select a format with no decimals.

c) Clear the Display Currency Symbol checkbox. Click OK.

3. Format the text field, Region, and its column heading label to be centered.

a) Press the CTRL key and select both the Region field and its label.

b) Right-click the selected fields and click Format Objects.

c) From the Common tab, select Centered from the Horizontal Alignmentdropdown menu. Click OK.

4. From the Report Explorer panel, format Order Date to print with no time portion.

a) Right-click Order Date and select Format Field.

Hint: If the Report Explorer isn't already open, click ReportExplorer from the Standard toolbar.

b) In the Format Editor, from the Date and Time tab, select a date format thatdoes not include time. Click OK.

Continued on next page

82 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 93: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Objects

5. Change the color of all column headings to print bold and in blue. Use Select allSection Objects.

a) Right-click the section, in this case the Page Header section, to launchthe menu.

Click Select All Section Objects. All the column headings are now selected.

b) Select Format - > Format Objects.

c) In the Format Editor, from the Font tab, select the following font optionsand click OK.

Font options

Style Bold

Color Blue

6. Create a text object that will print “Customers & Orders Report” as the titlein the Report Header.

a) Select Insert -> Text Object. Create a text box, that is the same width as thepage margins, with the cursor in the Report Header section.

b) Double-click into the text box and type Customers & OrdersReport.

7. Format the report title text box.

a) With the report title selected, click Format -> Format Text.

b) In the Format Editor, select the following options to format the report title.

Format Editor

Tab Option Selection

Paragraph Horizontal Alignment Centered

Font Size 20

Font Color Navy

Border Line Style (for Left,Right, Top, Bottom)

Single

Border Drop Shadow checkbox selected

Continued on next page

2011 © 2011 SAP AG. All rights reserved. 83

SAP Class Week of February 13, 2012

Page 94: BOC310 Col96 Part(Crystal Reports)

Unit 2: Creating a Report BOC310

8. Save the report as Positioning+ objects.rpt.

Note: Save all activity reports to My Documents.

a) Select File -> Save.

84 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 95: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Objects

Lesson Summary

You should now be able to:• Format fields using the Formatting toolbar and the Format Editor• Lock an object's format• Use text objects

2011 © 2011 SAP AG. All rights reserved. 85

SAP Class Week of February 13, 2012

Page 96: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

Unit SummaryYou should now be able to:• Create a report using different methods report• Choose a data source type• Add tables to a report• Describe linking• Build a report from the Design view• Navigate toolbars• Add objects from Field Explorer• Add objects from Report Explorer• Add objects from Repository Explorer• Determine data field type• Preview a report• View a report• Explain the differences between working in the Design and Preview tabs• Describe page controls• Describe the status bar• Add summary information• Save a report• Add reports to the Workbench• Check a report for errors• 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• Format fields using the Formatting toolbar and the Format Editor• Lock an object's format• Use text objects

86 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 97: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 98: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 99: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

87 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 100: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

88 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 101: BOC310 Col96 Part(Crystal Reports)

Unit 3Selecting Records

Unit OverviewThis unit provides the skills necessary for selecting records to use in SAP CrystalReports. Rarely will you want a listing of every record from the database. Most often,the goal is to only return a select set of records.

Unit ObjectivesAfter 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• Define record selection criteria by specifying options• Change record selection to be case insensitive• Describe the difference between saved and refreshed data• Apply selection criteria• Set additional record selection criteria• Modify existing record selection• Modify a record selection formula• Set record selection based on a date

Unit ContentsLesson: Select Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91Lesson: Determining the Criteria for Record Selection ... . . . . . . . . . . . . . . . . . . . . . . 95Lesson: Saved versus Refreshed Data ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100Lesson: Applying Record Selection ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104

Exercise 4: Apply Record Selection ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105Lesson: Setting Additional Criteria .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108

Exercise 5: Set Additional Selection Criteria.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111Lesson: Modifying Record Selection ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

Exercise 6: Refine the Record Selection ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

2011 © 2011 SAP AG. All rights reserved. 89

SAP Class Week of February 13, 2012

Page 102: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

Lesson: Applying Time-Based Record Selection ... . . . . . . . . . . . . . . . . . . . . . . . . . . . .120Exercise 7: Apply a Time-Based Record Selection ... . . . . . . . . . . . . . . . . . . . . .123

90 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 103: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Select Expert

Lesson: Select Expert

Lesson OverviewIn SAP Crystal Reports, you can filter or select the records that you want includedin the report by using the Select Expert.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Explain the functionality of the Select Expert and its components• Define the features of the Select Expert

Business ExampleYou need to limit the records based on specified criteria about the data. Use the SelectExpert to specify criteria.

Using the Select ExpertThe 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 arelisted. You may want to report on only those in North America or only those whosold more than $30,000 last year.

To do this, you set the record selection of your report to include only the data youwant in your report.

2011 © 2011 SAP AG. All rights reserved. 91

SAP Class Week of February 13, 2012

Page 104: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

To activate the Select Expert

Figure 11: 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 notpresented with a pick list of fields.

If you have not selected a field by clicking it to make it active before using oneof these methods, a dialog box opens, displaying the fields.

92 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 105: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Select Expert

The Select Expert's featuresIn addition to the New and Delete buttons, the Select Expert contains several functionbuttons 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 whilein 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.

2011 © 2011 SAP AG. All rights reserved. 93

SAP Class Week of February 13, 2012

Page 106: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

Lesson Summary

You should now be able to:• Explain the functionality of the Select Expert and its components• Define the features of the Select Expert

94 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 107: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Determining the Criteria for Record Selection

Lesson: Determining the Criteria for Record Selection

Lesson OverviewLimit the number of records in the report results by setting filters and specifyingrecord selection options.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Define record selection criteria by specifying options• Change record selection to be case insensitive

Business ExampleYou want to limit the data retrieved by the report based on specific selection criteria.

Defining record selection

Figure 12: 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

2011 © 2011 SAP AG. All rights reserved. 95

SAP Class Week of February 13, 2012

Page 108: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

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 thatonly matching records are included on the report; for example, only recordsfrom California (CA).

• is one of

This option enables you to specify a series of values as the criteria, so that onlyrecords matching one of these will be included on the report; for example, onlyrecords from CA, BC, or NY.

• is not one of

This option enables you to exclude a series of values as the criteria, so that thosematching records will be excluded on the report; for example, not records fromCA, BC, or NY.

• is greater than or less than

This option enables you to indicate a specific value that records must be above orbelow to be included on the report; for example, only records with sales greaterthan 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 isabove or below (or equal to) to be included on the report; for example, onlyrecords with sales that are the same amount (that is, $50,000) or greater than orover $50,000 for the last year.

• is between

This option enables you to select records that have a value falling between ormatching one of the two specified values; is inclusive and includes the endvalues; for example, only records with last year’s sales between $10,000 and$20,000, including $10,000 and $20,000.

• is not between

This option enables you to exclude records that have a value falling between ormatching one of the two specified values; is inclusive and excludes the endvalues; for example, excludes records with last year’s sales between $10,000 and$20,000, including $10,000 and $20,000.

• starts with

96 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 109: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Determining the Criteria for Record Selection

This option enables you to indicate character(s) or value(s) that each datafield must begin with in order to pass the selection criteria; for example, onlycustomers 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 fielddoes not begin with in order to pass the selection criteria; for example, nocustomers whose names begin with the letter “A.”

• is like

This option permits DOS wildcard characters (? and *) to specify criteria thatmust be met; for example, crystal, comical, and critical could all be selectedusing “is like c*.”

• is not like

This option permits DOS wildcard characters (? and *) to specify criteria thatmust 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 inorder 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 inorder 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.

2011 © 2011 SAP AG. All rights reserved. 97

SAP Class Week of February 13, 2012

Page 110: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

The Select Expert dialog box defaults to “any value.” If you enter a choice otherthan “any value” in the drop-down list box, a second drop-down list appears thatcontains some sample data from your database. You can choose values directly fromthe drop-down list or manually enter the value at the cursor prompt.

Note: If you are familiar with the Crystal formula language, you can enteryour formula here. You can click Show Formula>>> to view the formula(s),if any, used by Crystal Reports. You can also activate the Formula Editorfrom this extended window and modify this formula. For example, you maywant only the records in which profits are over a certain percentage. Oncethe percentage is calculated, the record selection decides whether or not toallow the record to pass.

Changing Record Selection to be case insensitiveIf you are not confident that data entry was consistent and California could have beenentered as “CA,” “ca”, Ca,” or even “cA” in your database, you will want to ensurethat your record selection statement is case insensitive. Otherwise, you would notfilter 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. 1. Click File → Options2. 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.

98 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 111: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Determining the Criteria for Record Selection

Lesson Summary

You should now be able to:• Define record selection criteria by specifying options• Change record selection to be case insensitive

2011 © 2011 SAP AG. All rights reserved. 99

SAP Class Week of February 13, 2012

Page 112: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

Lesson: Saved versus Refreshed Data

Lesson OverviewWith SAP Crystal Reports, you have the option to use data that is saved with the reportor to use current data that is most recently retrieved from the data source.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Describe the difference between saved and refreshed data

Business ExampleSaving data with the report allows you to capture report results based on that specificday and time. Refreshing the data allows you to see the report results based on themost recently available data.

Saving data with a Report

Figure 13: Saving Data with 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 oncolumns or charts, they don't access the database server directly; instead, they accessthe saved data. Consequently, reports with saved data not only minimize data transferover the network, but also lighten the database server's workload.

You can schedule these reports within BusinessObjects Enterprise, so theyautomatically refresh from the database on a predetermined basis. For example, if yoursales database is only updated once a day, or once a week, then you can run the report

100 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 113: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saved versus Refreshed Data

on a similar schedule and save it with data. Sales representatives then always haveaccess to current sales data, but they aren't hitting the database every time they open areport. 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).

1. Click File Save Data with Report2. Save the report.

Note: If the Save Data with Report option is checked, then it’s alreadyactive.

Refreshing data in a reportWhen you refresh a report that doesn't have saved data, Crystal Reports retrievesdata from the database; otherwise, the program discards the report's saved data andretrieves new data.

By design, Crystal Reports only retrieves data when necessary. When you previewyour report in the Preview tab, print the report, or export it to a file, the program runsyour report and retrieves the required data. Once you are working with the data in thePreview 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 first time.• 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.

2011 © 2011 SAP AG. All rights reserved. 101

SAP Class Week of February 13, 2012

Page 114: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

However, there may be times when you want to retrieve new data for the report. Forexample, you may have created a report several days earlier and you want to see it runwith the most current data. Refreshing report data is intended for times such as this.

1. Click Refresh on the Navigation Tools toolbar. Alternately, click Report RefreshReport Data or press F5 on the keyboard.

The program runs your report and retrieves the required data.

102 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 115: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saved versus Refreshed Data

Lesson Summary

You should now be able to:• Describe the difference between saved and refreshed data

2011 © 2011 SAP AG. All rights reserved. 103

SAP Class Week of February 13, 2012

Page 116: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

Lesson: Applying Record Selection

Lesson OverviewWhen you apply a filter to the report, limiting the number of records returned, you areapplying the selection criteria.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Apply selection criteria

Business ExampleThe data source will contain more records than is required. Select records based onspecified criteria such as a range of dates, location and performance.

Setting selection criteriaRecord selection is determined by the selection criteria. Applying record selection toyour report allows you to limit or restrict the records that are displayed.

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.

104 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 117: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Record Selection

Exercise 4: Apply Record Selection

Exercise ObjectivesAfter completing this exercise, you will be able to:• Select only the records you want to see included on your report

Business ExampleAs a report designer, you need to show records of companies only from specificprovinces or states. For example, only records from British Columbia (BC), Ohio(OH), Pennsylvania (PA), and California (CA) will appear on the report.

Task: Apply a record selectionAt the report level, apply a record selection to show only companies from the followingregions: British Columbia (BC), Ohio (OH), Pennsylvania (PA), and California (CA).

1. Open the Positioning+ objects.rpt.

2. Create a record selection statement using the Select Expert.

ResultWhen you return to view the record selection statement, it should appear similarto this: {Customer.Region} in [“BC”, “OH”,“PA” and “CA”].

The report only shows company records from the specified regions.

2011 © 2011 SAP AG. All rights reserved. 105

SAP Class Week of February 13, 2012

Page 118: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

Solution 4: Apply Record SelectionTask: Apply a record selectionAt the report level, apply a record selection to show only companies from the followingregions: British Columbia (BC), Ohio (OH), Pennsylvania (PA), and California (CA).

1. Open the Positioning+ objects.rpt.

a) Double-click the report file to open it.

2. Create a record selection statement using the Select Expert.

a) Click Report -> Select Expert -> Record.

b) From the Choose Field dialog box, click the Customer.Region field. ClickOK.

c) From the dropdown list, select the criteria, is one of.

d) From the list of values, select BC, OH, PA and CA. Click OK.

e) Save the report as Applying record selection.rpt.

ResultWhen you return to view the record selection statement, it should appearsimilar to this: {Customer.Region} in [“BC”, “OH”,“PA”and “CA”].

The report only shows company records from the specified regions.

106 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 119: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Record Selection

Lesson Summary

You should now be able to:• Apply selection criteria

2011 © 2011 SAP AG. All rights reserved. 107

SAP Class Week of February 13, 2012

Page 120: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

Lesson: Setting Additional Criteria

Lesson OverviewYou can apply multiple record selection criteria to the report. This allows you tofurther refine the report results.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Set additional record selection criteria

Business ExampleThe report results are more than is required. You need to refine the record selectionby adding more criteria.

Setting additional record selection criteriaOften, your report will require more than one selection criteria. For example, you maywant 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, ifneeded, formula fields in the Select Expert. Crystal Reports reads the date from yoursystem 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 hiredbetween a certain period. The easiest method is to use the "is between" option inthe Select Expert.

To do this, you need to create a report showing staff names and their hire dates. If youwant to see all the employees hired in a specific year, use the "is between" option andenter the first day of the first month of the year in the top drop-down list and the lastday of the last month of the year in the bottom drop-down list. This record selectionwill 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 toselect a predetermined start and finish date for the period of time you request.

108 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 121: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Setting Additional Criteria

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 recordselection.

3. Select the desired field.4. Click OK.

The Select Expert dialog box opens, ready for you to set the criteria as you didfor the first field.

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.

2011 © 2011 SAP AG. All rights reserved. 109

SAP Class Week of February 13, 2012

Page 122: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

110 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 123: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Setting Additional Criteria

Exercise 5: Set Additional Selection Criteria

Exercise ObjectivesAfter completing this exercise, you will be able to:• Refine the record selection by adding criteria

Business ExampleYou need to modify a Crystal report's record selection by adding new criteria. Forexample, as well as the existing criteria, you need to include all companies with anorder amount over $1000.

Task: Add Record Selection CriteriaAt the report level, you will modify the Crystal report's record selection by adding thenew criteria to include all companies with an order amount over $1000.

1. Open the Applying record selection.rpt.

2. Display the current record selection.

3. Add new selection criterion to include only companies with an order amountover $1000.

4. Save the report.

2011 © 2011 SAP AG. All rights reserved. 111

SAP Class Week of February 13, 2012

Page 124: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

Solution 5: Set Additional Selection CriteriaTask: Add Record Selection CriteriaAt the report level, you will modify the Crystal report's record selection by adding thenew criteria to include all companies with an order amount over $1000.

1. Open the Applying record selection.rpt.

a) Navigate to My Documents to find the report.

2. Display the current record selection.

a) Click Report -> Select Expert -> Record.

3. Add new selection criterion to include only companies with an order amountover $1000.

a) Click New.

b) From the Choose Field dialog box, select Order Amount. Click OK.

c) Select is greater than as the operator.

d) Type 1000 as the value.

With this addition, the entire record selection formula should appear similarto the following:{Customer.Region} in [“BC”, “CA”, “OH”, “PA”] and{Orders.Order Amount} > 1000

4. Save the report.

a) Save the report as Setting additional selectioncriteria.rpt. Save the report to My Documents.

112 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 125: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Setting Additional Criteria

Lesson Summary

You should now be able to:• Set additional record selection criteria

2011 © 2011 SAP AG. All rights reserved. 113

SAP Class Week of February 13, 2012

Page 126: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

Lesson: Modifying Record Selection

Lesson OverviewYou can modify the record selection filters or modify the record selection formula.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Modify existing record selection• Modify a record selection formula

Business ExampleThe report results are not exactly what is expected. Modify the record selection toreturn different report results.

Modifying existing record selectionSometimes you may need to modify the record selection in order to produce theresults you intended.

1. From the Design or Preview tab, make sure no fields are selected, and then clickSelect Expert.

The Select Expert opens.

2. Modify the selection.3. 3. Click OK to apply the changes.

Note: You can remove the record selection by clicking the Delete buttonin the Select Expert. Remember that you are only removing the recordselection, not the records.

Modifying a record selection formulaYou can set up different types of record selection requests without any previousknowledge 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 therecord selection request.

114 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 127: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Modifying Record Selection

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,000would result in Californian or British Columbian companies that sold over $30,000.

For example, using the record selection formula that shows only BC and CAcompanies with no other selection criteria, the formula in the Select Expert wouldlook like this:

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 lastyear’s sales.

1. Open the Select Expert and click Show Formula.

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 soldover $30,000 or companies in British Columbia (BC) or California (CA).

2011 © 2011 SAP AG. All rights reserved. 115

SAP Class Week of February 13, 2012

Page 128: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

116 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 129: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Modifying Record Selection

Exercise 6: Refine the Record Selection

Exercise ObjectivesAfter completing this exercise, you will be able to:• Refine the current record selection

Business ExampleThe Crystal report displays more regions than is now required. You want to furtherrefine the record selection to specify only BC and CA as the regions to display.

Task: Modify the Record SelectionModify the current record selection by specifying only BC and CA as the regionsto display. Switch between the selection criteria using “and” to “or” to change thestatement between the Order Amount and Region criteria. Notice the difference inthe report data.

1. Open the Setting additional selection criteria.rpt

2. Specify only BC and CA as the regions to display in the current record selectionformula.

3. Change the “and” statement between Order Amount and Region to “or”. Reviewthe report data and then, switch it to the “and” statement.

2011 © 2011 SAP AG. All rights reserved. 117

SAP Class Week of February 13, 2012

Page 130: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

Solution 6: Refine the Record SelectionTask: Modify the Record SelectionModify the current record selection by specifying only BC and CA as the regionsto display. Switch between the selection criteria using “and” to “or” to change thestatement between the Order Amount and Region criteria. Notice the difference inthe report data.

1. Open the Setting additional selection criteria.rpt

a) Navigate to My Documents to find the report.

2. Specify only BC and CA as the regions to display in the current record selectionformula.

a) Click Report -> Select Expert -> Record.

b) In the Select Expert dialog box, select the Customer.Region tab.

c) From the list of values, select OH and click Remove. Select PA and clickRemove.

3. Change the “and” statement between Order Amount and Region to “or”. Reviewthe report data and then, switch it to the “and” statement.

a) Click Formula Editor. Change “and” to “or”.

b) Click Save and close.

c) Click OK.

d) When prompted, select Used Saved Data.

Notice that the report data displays all records with an order amount greaterthan $1000, including customers from OH and PA regions

e) Change the record selection formula back to the “and” statement betweenOrder Amount and Region criteria.

Notice that the report data displays only customers from BC and CAregions with order amounts greater than $1000.

f) Save the report as Refining the record selection.rpt.

118 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 131: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Modifying Record Selection

Lesson Summary

You should now be able to:• Modify existing record selection• Modify a record selection formula

2011 © 2011 SAP AG. All rights reserved. 119

SAP Class Week of February 13, 2012

Page 132: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

Lesson: Applying Time-Based Record Selection

Lesson OverviewSetting a time-based record selection is useful when you want to determine resultsbased on a certain date or time range.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Set record selection based on a date

Business ExampleYou may want to find out which customers bought over $10,000 in product from thecompany in the first quarter of the fiscal year.

Setting record selection based on a dateOften, you will want to select records based on a date field. You may want to see allaccounts that have not been accessed in the past year, or to show all sales reps thathave placed five or more orders in the past month.

To do this, you would create a record selection using the appropriate date and, ifneeded, formula fields in the Select Expert. Crystal Reports reads the date from yoursystem 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 hiredbetween a certain period. The easiest method is to use the “is between” option inthe Select Expert.

Hint: Watch out for “is between” and “is less than” when entering dates. Ifno time is entered, the program assumes you meant “midnight” and you mightmiss an entire day’s results.

To do this, you need to create a report showing staff names and their hire dates. If youwant to see all the employees hired in a specific year, use the “is between” option andenter the first day of the first month of the year in the top drop-down list and the lastday of the last month of the year in the bottom drop-down list. This record selectionwill return the records of all employees who were hired in that year.

120 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 133: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Time-Based Record Selection

Another method is to use “is in the period.” This method provides you with options toselect a predetermined start and finish date for the period of time you request.

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.

2011 © 2011 SAP AG. All rights reserved. 121

SAP Class Week of February 13, 2012

Page 134: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

122 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 135: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Time-Based Record Selection

Exercise 7: Apply a Time-Based RecordSelection

Exercise ObjectivesAfter completing this exercise, you will be able to:• Apply a record selection based on a date to a Crystal report

Business ExampleYou need to modify the Crystal report to display records based on a specific year.

Task: Display Records Based on YearModify the record selection at the report level to display customer and order databased only in 2004.

1. Open the report, Refining the record selection.rpt.

2011 © 2011 SAP AG. All rights reserved. 123

SAP Class Week of February 13, 2012

Page 136: BOC310 Col96 Part(Crystal Reports)

Unit 3: Selecting Records BOC310

Solution 7: Apply a Time-Based RecordSelectionTask: Display Records Based on YearModify the record selection at the report level to display customer and order databased only in 2004.

1. Open the report, Refining the record selection.rpt.

a) Navigate to My Documents to find and open this report.

b) Click Report -> Select Expert -> Record.

c) Click New.

d) From the Choose Field dialog box, select Order Date.

e) Choose is between.

f) Enter the first value in this range as 01/01/2004 12:00:00AM.

g) Enter the second value in this range as 12/31/2004 12:00:00AM.

h) Click OK.

i) When prompted, select Used Saved Data to refresh the report.

The report now displays only records from 2004.

j) Save the report asApplying time-based recordselection.rpt.

124 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 137: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Time-Based Record Selection

Lesson Summary

You should now be able to:• Set record selection based on a date

2011 © 2011 SAP AG. All rights reserved. 125

SAP Class Week of February 13, 2012

Page 138: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

Unit SummaryYou should now be able to:• Explain the functionality of the Select Expert and its components• Define the features of the Select Expert• Define record selection criteria by specifying options• Change record selection to be case insensitive• Describe the difference between saved and refreshed data• Apply selection criteria• Set additional record selection criteria• Modify existing record selection• Modify a record selection formula• Set record selection based on a date

126 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 139: BOC310 Col96 Part(Crystal Reports)

BOC310 Test Your Knowledge

Test Your Knowledge

1. Which tool in SAP Crystal Reports is used for filtering or selecting records inCrystal Reports?

2. When you want to refresh data on a report, what are the three methods youcan use?

3. When would you use a time-based record selection?

2011 © 2011 SAP AG. All rights reserved. 127

SAP Class Week of February 13, 2012

Page 140: BOC310 Col96 Part(Crystal Reports)

Test Your Knowledge BOC310

Answers

1. Which tool in SAP Crystal Reports is used for filtering or selecting records inCrystal Reports?

Answer: Select Expert

2. When you want to refresh data on a report, what are the three methods youcan use?

Answer: You can use:

• The Refresh button on the Standard toolbar• Refresh Report Data command from the Report menu• F5 on the keyboard

3. When would you use a time-based record selection?

Answer: You would use a time-based record selection when you wanted todetermine specific results in a given time period.

128 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 141: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 142: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 143: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

129 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 144: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

130 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 145: BOC310 Col96 Part(Crystal Reports)

Unit 4Organizing Data on a Report

Unit OverviewThis unit provides you with the basic skills of organizing data in SAP Crystal Reports.Learn how to sort, group and summarize the report's records into a meaningful way.

Unit ObjectivesAfter completing this unit, you will be able to:

• Apply a sort order to records• Create groups• Modify groups• Create nested and multiple groups• Reorder groups• Add a specified order group• Group on time-based data• Create nested and multiple groups• Reorder groups• Add a specified order group based on criteria not specified in the database• Group on time-based data• Insert a grand total• Insert a summary• Insert a group and summary at the same time

Unit ContentsLesson: Sorting Records... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133

Exercise 8: Apply Sorting Options ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139Lesson: Grouping Records ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143Lesson: Creating Nested and Multiple Groups ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153

Exercise 9: Create and Reorder Multiple Groups ... . . . . . . . . . . . . . . . . . . . . . . .155

2011 © 2011 SAP AG. All rights reserved. 131

SAP Class Week of February 13, 2012

Page 146: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Lesson: Adding a Specified Order Group ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .158Exercise 10: Add a Specified Order Group ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .159

Lesson: Grouping on Time-Based Data ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .163Exercise 11: Group on a Date Field.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .165

Lesson: Creating a Grand Total. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .168Exercise 12: Insert a Grand Total . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .169

Lesson: Summarizing Data... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .173Exercise 13: Insert Summaries ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181

132 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 147: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Sorting Records

Lesson: Sorting Records

Lesson OverviewUsing a record sort order enables you to list the records in ascending, descendingor specified order.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Apply a sort order to records

Business ExampleYou want the report to show the results in a more meaningful way. Sort the recordsbased on the greatest possible relevance.

Applying a sort order to recordsOnce you have selected the records to print and positioned them on your report, youwill likely want to sort them in a meaningful sequence. For example, you may wantto sort in alphabetical order or from highest to lowest sales. If you do not specify asort order, Crystal Reports displays the records in their natural order, that is, the orderin which they appear in your database.

Each field in the Sort Fields list can be assigned a sort direction in ascending ordescending order independently. For example, you could sort your list by Region inalphabetical order, then by company in descending order of Last Year Sales.

2011 © 2011 SAP AG. All rights reserved. 133

SAP Class Week of February 13, 2012

Page 148: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Figure 14: Record Sort Expert

1. Click the Record Sort Expert button on the Expert Tools toolbar.

You can also click ReportRecord 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 rightusing > (Add).

3. Assign an Ascending or Descending order individually in the Sort Direction area.

The selection is indicated with an A (ascending) or D (descending), dependingon which sort order was selected. In a multiple-level sort, not all sorts have to bethe same (ascending or descending).

4. Click OK, and then preview your report.

Hint: The default is Ascending for each field as it is added to the SortFields list. Click Descending to change the sort direction.

1. Select the field and click < (Remove).

You can also double-click the field.

1. Select the field and click the Up or Down arrow above the Sort Fields area.

Hint: You can also click a field and drag it into the sort position yourequire.

134 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 149: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Sorting Records

Using sort controlsYou may want to design your report so that users can modify a sort field or sortdirection without refreshing information from the database. You can do this using aSort Control.

A Sort Control is useful for several reasons:

• It allows users to sort report data for further analysis without leaving the canvasof 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 thefollowing 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 alerts users).

2011 © 2011 SAP AG. All rights reserved. 135

SAP Class Week of February 13, 2012

Page 150: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Figure 15: Group Expert

1. Once the data is grouped, on the Report menu, click Record Sort Expert.

The Record Sort Expert appears.

Note: Sort fields that begin with "Group" specify that the sort was doneautomatically when the data was grouped.

2. Highlight the fields that you want to sort by and click the > arrow to add themto the Sort Fields list.

The order of the fields in the Sort Fields list is the initial order by which datais sorted.

Note: To enable a Sort Control on a field, that field must be included inthe Sort Fields list.

3. Click OK when finished.4. Create your Sort Control:

If you want to use an existing text object:

a) On your report, right-click the text object that you would like to use asa Sort Control.

b) Click Bind Sort Control.

The Sort Control dialog box appears.

c) Select a sort field and click OK.

If you want to add a new text object:

a) On the Insert menu, click Sort Control.b) Select a sort field and click OK.c) Click and drag your cursor to the report location where you would like

to insert the Sort Control.d) 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.

136 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 151: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Sorting Records

Users can sort the fields you have selected by clicking the sort arrows that appearbeside the text object. The report promotes the selected field temporarily to the top ofthe sort order. When a second Sort Control is used, the first is returned to its originalposition in the sort order and the second is promoted to the top sort.

Note: Grouping hierarchy is not affected by 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.

2011 © 2011 SAP AG. All rights reserved. 137

SAP Class Week of February 13, 2012

Page 152: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

138 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 153: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Sorting Records

Exercise 8: Apply Sorting Options

Exercise ObjectivesAfter completing this exercise, you will be able to:• Sort records to list the in a specific order

Business ExampleThe Crystal report needs to be sorted in a specific order to add more meaning to itsrecords.

Task 1: Sort RecordsSort the report records to display in ascending order by Region and City, thendescending order by Order Date.

1. Open the report, Applying time-based record selection.rpt.

Task 2: Create Sort ControlCreate a sort control of an existing text object, Region, in the page header.

1. Apply a sort control to the Region heading.

ResultWhen you preview the report, notice how the Region heading now has up anddown arrows to allow you to change the sort direction of the region data.

Task 3:Remove the sort control from the Region heading.

1. Remove the sort control.

2011 © 2011 SAP AG. All rights reserved. 139

SAP Class Week of February 13, 2012

Page 154: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Solution 8: Apply Sorting OptionsTask 1: Sort RecordsSort the report records to display in ascending order by Region and City, thendescending order by Order Date.

1. Open the report, Applying time-based record selection.rpt.

a) Navigate to My Documents to find and open the report.

b) Click Report -> Record Sort Expert.

c) Double-click Region. Specify ascending as the sort direction.

d) Double-click City. Specify ascending as the sort direction.

e) Double-click Order Date. Specify descending as the sort direction.

f) Click OK.

When you preview the report, the records display with the Region and Cityin ascending order, then descending order by Order Date.

Task 2: Create Sort ControlCreate a sort control of an existing text object, Region, in the page header.

1. Apply a sort control to the Region heading.

a) Right-click Region in the page header.

b) Click Bind Sort Control.

c) Select Region as the field that the Sort Control will affect. Click OK.

ResultWhen you preview the report, notice how the Region heading now has upand down arrows to allow you to change the sort direction of the regiondata.

Continued on next page

140 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 155: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Sorting Records

Task 3:Remove the sort control from the Region heading.

1. Remove the sort control.

a) Right-click Region in the page header.

b) Click Bind Sort Control.

c) Select <Not Interactive>. Click OK.

The sort control has now been removed.

d) Save the report as Applying sorting options.rpt.

2011 © 2011 SAP AG. All rights reserved. 141

SAP Class Week of February 13, 2012

Page 156: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Lesson Summary

You should now be able to:• Apply a sort order to records

142 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 157: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Grouping Records

Lesson: Grouping Records

Lesson OverviewGroup the report results based on common criteria.

Lesson ObjectivesAfter completing this lesson, 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

Business ExampleYou need to organize the results based on common criteria for a more useful report.For example, group records by country.

Creating groupsEven though your records are now sorted, you may want to break data into meaningfulgroups. For example, you may want all the customers from one region together in onegroup: all California customers together, all BC customers together, and so on.

Crystal Reports can then summarize the information in each group. You can groupinformation based on report fields, on database fields that are not in the report, and onformula fields. This grouping cannot be achieved with multi-level sorts since it is onelong 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 arevisible in the left margin of the Design window. Once you have created a group, aGroup Header and Group Footer surround the Details area. Each group you create hasits own header and footer. Also, when you insert a group, the Group #n Name field isautomatically created in the Group Header.

2011 © 2011 SAP AG. All rights reserved. 143

SAP Class Week of February 13, 2012

Page 158: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Navigating using the Preview PanelThe Preview Panel appears in the left margin of the Preview window. It functions likea directory tree with a heading for each group in your report, with the ability to expandthe group to see further levels of grouping.

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 appearbeside the group names.

Navigating in the report using drill-downIn the Preview window, you can also drill down on the various groups to obtaininformation for the specific group.

1. Double-click a group on the actual report.

An extra tab opens beside the Design and Preview tabs, displaying theinformation for that group.

2. Click the Close View button beside the page controls to close the drill-downgroup tab.

Applying sort order options when groupingYou apply sort order options when grouping in the Insert Group dialog box.

144 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 159: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Grouping Records

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 thedatabase. For example, you could create groups based on geographical areas orsales territories and name them accordingly such as Western Region, EasternRegion, Central Region, and so on. • in original order 100 Fundamentals

• in original order

This option leaves the records in the same order as they were stored in thedatabase.

• 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 groupingoptions available.

These options include:

• Customize Group Name Field

The name of the group can be customized to suit your needs. You can choosefrom 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 groupsto stay together. If there is enough room to print all records from a group onthe current page, then all the records will print on that page. If not, they willbe 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 isprinted on the report. If, for example, you had grouped your report by region, theregion 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 thanone page, this option forces the Group Name Field to repeat on each new page fora particular group.

2011 © 2011 SAP AG. All rights reserved. 145

SAP Class Week of February 13, 2012

Page 160: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Each group generated by the report prints a group header before printing the Detailsarea information. Group names are commonly found in the group header. After thelast record of the group has printed, the group footer prints. Summary informationabout the group is commonly found in the group footer.

Note: If you do not want to include the group name with the group, youcan clear the Insert Group Name with Group option on the Layout tab in theOptions dialog box under the File menu.

Hint: Grouping overrides record sort, so check your grouping and sortingoptions after refreshing a report to ensure the results returned are stillappropriate.

To insert a group

1. Click InsertGroup .

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 formattingoptions for dates. Options exist for number/currency and text fields as well.

2. Format the field.3. Click OK.

Hint: Hover your cursor over a group in the grey area to display thename of the group.

146 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 161: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Grouping Records

Modifying groupsOnce you have created groups on your report, you may find it necessary to modifythem. For example, perhaps you grouped by region and would now like to group bycountry. You could delete the region group and add a new group, or you could redefinethe existing group. Or perhaps you want to add a second level of grouping to haveyour records grouped by country then by region.

Hint: You will find it easier to work with your groups from the Design tabwhere you can see the group names and boundaries.

Changing the definition of a groupYou may create a group that later you want to remove because of changingcircumstances or changing information needs. If your needs change, you can modifythe group. For example, you created a report that was grouped by region, but nowprefer to have the information grouped by country. You do not need to remove theexisting group and replace it with a new one; you can redefine the existing group.

1. In the Design window, right-click the gray area of the Group Header or GroupFooter 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 theKeep 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 groupsYou may create a group that later you want to remove because of changingcircumstances or changing information needs. Fundamentals of ReportDesign—Learner’s 104 Guide

1. Right-click in the gray area over the Group Header or Group Footer of the groupyou want to delete, and then select Delete Group from the shortcut menu.

The group section is deleted from the report.

Creating nested and multiple groupsYou are not limited to one level of grouping within Crystal Reports. You can havegroups within groups.

2011 © 2011 SAP AG. All rights reserved. 147

SAP Class Week of February 13, 2012

Page 162: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

For example, you can have a report of all customers, broken down by country, andeach country in turn broken down by region. You could even go further and have athird level, by city.

To create nested or multiple groups

To create nested groups, follow the same steps that you did when you created thefirst 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 listin the Sort Fields area of the Record Sort Order Expert.

Reordering groupsYou can have very sophisticated reports with groups nested within other groups. Forexample, your company may have many distributors in many countries. You want togroup by country, then within each country, you want to group by geographic regionlike Northwest, Central, and so on. Then, you may need to group within each ofthose regions by state.

You can create groups in any particular order. Groups can be reordered at any time,unlike the sort order of records.

1. Left-click in the gray area to the left of the Design window and hold the mousebutton 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 dropit in its new location.

1. Click Group Expert from the Expert Tools toolbar.

The Group Expert dialog box appears.

2. Use the arrows to rearrange the order of the groups.3. 3. Click OK.

Adding a specified order groupYou 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-sellingregion to the lowest, you want to sort them geographically.

148 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 163: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Grouping Records

Specified order grouping enables you to create both the customized groups that willappear 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 thespecified order grouping and then select in specified order.

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. Forexample, you might want to have two groups on your report, one for the WesternRegion and one for the Eastern Region. You could create these two groups by clickingthe 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 yourreport. You can reorder these groups by selecting the name and clicking the Up orDown buttons.

After creating a custom group, you need to define which records belong to whichgroup. You define this criteria in the Define Named Group dialog box. This dialog boxfunctions exactly like the Select Expert

Once you have created at least one custom group, a third tab appears on the InsertGroup dialog box. This tab deals with the records that do not fall into any of thecustom group categories. By default these records are included in a group calledOthers. You specify what to do with all the remaining records that do not meet any ofthe 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 themon 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. Forexample, if TX did not fall into either Western or Eastern, all records for Texaswould be put into a group called "TX."

2011 © 2011 SAP AG. All rights reserved. 149

SAP Class Week of February 13, 2012

Page 164: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

You can create groups from either the Design or Preview windows. If you are inthe Design window, you will see the new Group Header and Group Footer areassurrounding the Details area. For each group you define, a new Group Header andGroup Footer is created.

Hint: When you add a grand total, the grand total displays for all recordsselected by the Select Expert, not only for those showing on the report aftercreating specified groups. However, if you apply a specified order groupingand choose to discard others, your grand totals will be correct, calculatingonly 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.

Grouping on time-based dataSuppose 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 thoseemployees who have their birthdays in each month of the year. Or, you might needa report that shows all the orders placed, broken down by yearly quarters. You cangroup records by Date fields. When you apply grouping on a Date field, a secondlevel of sorting options becomes available.

150 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 165: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Grouping Records

The first list gives you the option to select on which field you want to base thegroupings. You can pick the sort order in the second list. If you choose to base yourgroups on a date field, a third option will appear. In this third list, you can specify thefrequency of the groups.

Hint: The options for formatting date, time, and date/time fields are extensive.You can also customize the 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. The Insert Group dialog box opens.3. Select a sort order.4. In the third drop-down list, choose the date interval you want to group by.5. 5. Click OK.

2011 © 2011 SAP AG. All rights reserved. 151

SAP Class Week of February 13, 2012

Page 166: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Lesson Summary

You should now be able to:• Create groups• Modify groups• Create nested and multiple groups• Reorder groups• Add a specified order group• Group on time-based data

152 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 167: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating Nested and Multiple Groups

Lesson: Creating Nested and Multiple Groups

Lesson OverviewYou can create nested groups and multiple groups in SAP Crystal Reports.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Create nested and multiple groups• Reorder groups

Business ExampleYou need to organize the report further. Insert a group into another group to createa hierarchy of groups.

2011 © 2011 SAP AG. All rights reserved. 153

SAP Class Week of February 13, 2012

Page 168: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

154 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 169: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating Nested and Multiple Groups

Exercise 9: Create and Reorder MultipleGroups

Exercise ObjectivesAfter completing this exercise, you will be able to:• Create multiple groups and then arrange them in hierarchal order

Business ExampleYou need to display the report records in multiple groups and then arrange the groupsusing hierarchal order to better organize the data.

Task: Create Another GroupCreate another group in the report.

1. Add Country as a group in ascending order.

2011 © 2011 SAP AG. All rights reserved. 155

SAP Class Week of February 13, 2012

Page 170: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Solution 9: Create and Reorder MultipleGroupsTask: Create Another GroupCreate another group in the report.

1. Add Country as a group in ascending order.

a) Open the report, Creating groups.rpt,

b) Navigate to My Documents to find and open the report.

c) Click Report -> Group Expert.

d) From the available fields, double-click Country.

e) Click Options.

f) Specify that Country is sorted in ascending order and click OK.

g) With Country group selected, click the up arrow above the Group by panel.Click OK.

This will move the Country group up to a higher hierarchal level. Thereport now displays the records by Country and then by Region.

h) Save the report as Creating and reordering multiplegroups.rpt.

156 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 171: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating Nested and Multiple Groups

Lesson Summary

You should now be able to:• Create nested and multiple groups• Reorder groups

2011 © 2011 SAP AG. All rights reserved. 157

SAP Class Week of February 13, 2012

Page 172: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Lesson: Adding a Specified Order Group

Lesson OverviewCreating groups in a specified order is possible in SAP Crystal Reports.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Add a specified order group based on criteria not specified in the database

Business ExampleWhen the required grouping isn't available from the data source, you can customizegroups and the order of how they will appear in the report.

158 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 173: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding a Specified Order Group

Exercise 10: Add a Specified Order Group

Exercise ObjectivesAfter completing this exercise, you will be able to:• Add a specified order group to create customized groups to better reflect the way

you want the information on the report to appear.

Business ExampleYou need to customize the report's groups according to the Sales organization'sdesignation of territories.

Task: Create Custom GroupsCustomize the region groups to include a “Western Sales Territory”, an “Eastern SalesTerritory”. Regions not assigned to either of these custom groups will be included in“Unassigned Regions”.

1. Modify the record selection by deleting the Region selection criteria and thenadding a new Country selection criteria to include USA and Canada.

2. Modify the region group to include “Western Sales Territory” and add California(CA), Idaho (ID), Nevada (NV), and British Columbia (BC) to this group.

3. Modify the region group to include “Eastern Sales Territory” and add Florida(FL), Ohio (OH), Ontario (ON), and Pennsylvania (PA) to this group.

4. Include all other regions to “Unassigned Regions”.

2011 © 2011 SAP AG. All rights reserved. 159

SAP Class Week of February 13, 2012

Page 174: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Solution 10: Add a Specified Order GroupTask: Create Custom GroupsCustomize the region groups to include a “Western Sales Territory”, an “Eastern SalesTerritory”. Regions not assigned to either of these custom groups will be included in“Unassigned Regions”.

1. Modify the record selection by deleting the Region selection criteria and thenadding a new Country selection criteria to include USA and Canada.

a) Open the report, Creating and reordering multiple groups.rpt.

b) Click Report -> Select Expert -> Record.

c) Select Region tab.

d) Click Delete.

e) Click New.

f) From the available fields, double-click Country.

g) Select “is one of” as the selection operator.

h) From the list of values, select USA and then Canada. Click OK.

i) When prompted, click Refresh Data.

2. Modify the region group to include “Western Sales Territory” and add California(CA), Idaho (ID), Nevada (NV), and British Columbia (BC) to this group.

a) Click Insert -> Group.

b) Select Region from the dropdown menu of available fields.

c) Select in specified order as the sort option.

d) Click New to create a named group.

e) Type Western Sales Territory as the group name.

f) Select “is one of” as the selection operator.

g) From the list of values, add the following regions: California (CA), Idaho(ID), Nevada (NV), and British Columbia (BC)

h) Click OK.

Continued on next page

160 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 175: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding a Specified Order Group

3. Modify the region group to include “Eastern Sales Territory” and add Florida(FL), Ohio (OH), Ontario (ON), and Pennsylvania (PA) to this group.

a) From the Insert Group dialog box, click New.

b) Type Eastern Sales Territory as the group name.

c) Select “is one of” as the selection operator.

d) From the list of values, add the following regions: Florida (FL), Ohio(OH), Ontario (ON), and Pennsylvania (PA)

e) Click OK.

4. Include all other regions to “Unassigned Regions”.

a) From the Insert Group dialog box, click the Others tab.

b) Select the option to put all others together.

c) Type Unassigned Regions as the group name.

d) Click OK.

e) Save the report as Adding a specified order group.rpt.

2011 © 2011 SAP AG. All rights reserved. 161

SAP Class Week of February 13, 2012

Page 176: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Lesson Summary

You should now be able to:• Add a specified order group based on criteria not specified in the database

162 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 177: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Grouping on Time-Based Data

Lesson: Grouping on Time-Based Data

Lesson OverviewOrganize the report based on a time period in SAP Crystal Reports.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Group on time-based data

Business ExampleYou want the report data to display records group by date, such as year.

2011 © 2011 SAP AG. All rights reserved. 163

SAP Class Week of February 13, 2012

Page 178: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

164 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 179: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Grouping on Time-Based Data

Exercise 11: Group on a Date Field

Exercise ObjectivesAfter completing this exercise, you will be able to:• Apply grouping that is built on date-based criteria

Business ExampleYou want to modify a Crystal report to group based on dates.

Task: Group by Order DateGroup the report records based on Order Date. Display the groups by month and year.

1. Open the report, Adding a specified order group.rpt.

2. Insert a group based on order date.

3. Change the Order Date group to display the records for each month.

4. Format the group name to display the month and year.

5. Format the report fields.

2011 © 2011 SAP AG. All rights reserved. 165

SAP Class Week of February 13, 2012

Page 180: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Solution 11: Group on a Date FieldTask: Group by Order DateGroup the report records based on Order Date. Display the groups by month and year.

1. Open the report, Adding a specified order group.rpt.

a) Navigate to My Documents to find and open the report.

2. Insert a group based on order date.

a) Click Insert -> Group.

b) From the list of available fields, select Order Date.

c) Select the option to printfor each year. Click OK.

3. Change the Order Date group to display the records for each month.

a) Click Report -> Group Expert.

b) From the list of groups, select Order Date. Click Options.

c) Select the option to print for each month. Click OK.

4. Format the group name to display the month and year.

a) Select the Order Date group name field.

b) Click Format -> Format Field.

c) From the Date and Time tab, select the option, March 1999, to display dateand time by month and year. Click OK.

5. Format the report fields.

a) Right-click Order ID. Click Format Field.

b) From the Number tab, select the option, (1123), to display the numberwithout the thousands comma separator. Click OK.

c) Select the Region and Order Date group name headings. Move them rightto indent these headings.

d) Save the report as Grouping on a date field.rpt.

166 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 181: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Grouping on Time-Based Data

Lesson Summary

You should now be able to:• Group on time-based data

2011 © 2011 SAP AG. All rights reserved. 167

SAP Class Week of February 13, 2012

Page 182: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Lesson: Creating a Grand Total

Lesson OverviewYou can calculate and display a grand total in SAP Crystal Reports.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Insert a grand total

Business ExampleYou want to insert a grand total into the report footer to display a report summary. Forexample, you want to display the grand total sum of orders on the report.

168 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 183: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating a Grand Total

Exercise 12: Insert a Grand Total

Exercise ObjectivesAfter completing this exercise, you will be able to:• Insert a summary for the entire report called a grand total

Business ExampleYou want to modify the report to display the grand total number of customer ordersand grand total order amount.

Task: Insert Total Number of CustomersSummarize the distinct count of customers and display the grand total.

1. Open the report, Grouping on summary data.rpt.

2. Remove the group selection for months that had more than 10 orders.

3. Change the record selection to display all customers in the USA only.

4. Insert a summary field to the report that performs a distinct count of customersfor the entire report.

5. Insert a summary field that displays the total order amount for the entire report.

6. Add text objects beside each summary field to create a title for each.

2011 © 2011 SAP AG. All rights reserved. 169

SAP Class Week of February 13, 2012

Page 184: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Solution 12: Insert a Grand TotalTask: Insert Total Number of CustomersSummarize the distinct count of customers and display the grand total.

1. Open the report, Grouping on summary data.rpt.

a) Navigate to My Documents to find and open the report.

2. Remove the group selection for months that had more than 10 orders.

a) Click Report -> Select Expert -> Group.

b) Select the group selection formula. Click Delete.

3. Change the record selection to display all customers in the USA only.

a) Click Report -> Select Expert -> Record.

b) Select the Customer record selection formula. Change the operator to isequal to.

c) Select USA from the list of values. Click OK.

4. Insert a summary field to the report that performs a distinct count of customersfor the entire report.

a) Click Insert -> Summary.

b) From the list of available fields, select Customer Name.

c) Select how to calculate this summary as Distinct count.

d) Select summary location as Grand Total (Report Footer). Click OK.

5. Insert a summary field that displays the total order amount for the entire report.

a) Click Insert -> Summary.

b) From the list of available fields, select Order Amount.

c) Select how to calculate this summary as Sum.

d) Select summary location as Grand Total (Report Footer). Click OK.

e) Right-click this summary field and click Format Field.

f) Select a number format option that does not display decimals, such as$(1123). Click OK.

Continued on next page

170 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 185: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating a Grand Total

6. Add text objects beside each summary field to create a title for each.

a) Click Insert -> Text Object. Place the text object in the Report Footersection beside the customer count summary field.

b) Double-click the text object and type a description like TotalCustomers.

c) Click Insert -> Text Object. Place the text object in the Report Footersection beside the order amount summary field.

d) Double-click the text object and type a description like Total OrderAmount.

Note: Optionally, format the text objects for emphasis on thereport.

e) Save the report as Inserting a grand total.rpt.

2011 © 2011 SAP AG. All rights reserved. 171

SAP Class Week of February 13, 2012

Page 186: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Lesson Summary

You should now be able to:• Insert a grand total

172 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 187: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Summarizing Data

Lesson: Summarizing Data

Lesson OverviewOne of the primary purposes for breaking data into groups is to run calculations oneach group of records instead of all records in the report. When SAP Crystal Reportssummarizes data, it sorts the data, divides it into groups and then summarizes thevalues in each group automatically.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Insert a summary• Insert a group and summary at the same time

Business ExampleYou need to insert summaries into the report both at the group level and the reportlevel.

Inserting a summaryCrystal Reports includes a number of summarizing options. A subtotal is the sum ofall values from a single field, from all the records in a group. In a sales report, forexample, if you subtotal the amount ordered by sales representative, Crystal Reportsgathers all the records that belong to the sales representative and totals the amountsordered 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.

2011 © 2011 SAP AG. All rights reserved. 173

SAP Class Week of February 13, 2012

Page 188: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

For example:

• Customer list reports determine the number of customers in each state. Thesummary would count the distinct customers in each state group.

• Order reports determine the average order placed each month. The summarywould calculate the size of the average order for each month group.

• Sales reports determine the total sales per sales representative. The summarywould 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 anotherbroader-based group. For example, you can show the percentage of orders in eachregion of a country as compared to the entire country. Or you can show the sales ineach city of a country over the total sales of the entire country. Percentage summaryfields support the sum, average, maximum, minimum, count, and distinct countoperations.

You apply the percentage summary first by specifying the total value for thesecond-level group (numerator), then the total value for the broader-based group(denominator).

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 thegroup. The percentage summary of 41.16% is shown as well.

When you insert a summary in your report, the summary is displayed as the summaryoperation plus what is being summarized.

In this example, “Count of” is the summary operation and the “Customers” field isbeing summarized.

When you select the summary, you see its full name in the Status bar at the bottomof the Design window.

The summary field automatically lines up with and attaches to the same guideline asthe field it was based on.

You can also insert a simple text object as a label beside your summary field as anexplanation to make it meaningful for the user. Adding a text object as an explanatorylabel in front of the summary or subtotal helps to further describe the context of thenew summary or subtotal. For example, a subtotal that sums the sales of a particularregion could read “Subtotal of Last Year’s Sales by Region.”

174 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 189: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Summarizing Data

You can insert summary information in either the Design or Preview tabs. The optionsavailable when inserting a summary field vary depending on the type of data youare summarizing.

Hint: You do not need to select the field you want to summarize (or subtotal)before any of these menu options are made available. You can choose thisfield in the Insert Summary dialog box.

To insert a summary

Figure 16: Insert Summary

1. Click Insert Summary.

You can also click the Insert Summary button on the Insert Tools toolbar.

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 subtotaled amount fromthe Summary location list. For example, if you select a sales amount, you couldchoose to subtotal by region, which would give you a subtotaled sales amountfor each region.

5. Click OK when finished.

2011 © 2011 SAP AG. All rights reserved. 175

SAP Class Week of February 13, 2012

Page 190: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Inserting a group and summary at the same timeIf there are currently no groups on the report, you can group and summarize all inone step.

To insert a group and a summary

1. Click Insert Summary.

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.

Hint:

• You can create a new group for your report by clicking the InsertGroup button.

• You can add your summary to all group levels by clicking the Addto all group levels check box.

The Insert Group dialog box opens.

5. On the Common tab, select the group from the first list, and then select the sortorder.

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 thatparticular report. You can sort on any field that is used on the report or in thedatabase tables selected for that report.

Creating a group based on summary dataWhen you group or summarize data, all the groups in the report are included bydefault. There may be times, however, when you do not want to include all groups:

• You might want to see only those groups whose summarized values meet acertain condition.

• You might want to see only the groups with the highest summary values, orthe lowest.

176 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 191: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Summarizing Data

For example, if you have a mailing list grouped by region and your record selectionformula specifies only California customers ({Customer.Region} = “CA”), your reportwill have only the single group of California.

The Select Expert can be used to select groups of records in the same way that youselect individual records.

When you are setting up group selection criteria, instead of basing the selectioncriteria on standard fields, as you do for record selection, you base the criteria ongroup name fields or summary fields.

• If you have grouped your data but have not summarized it, you can only set upgroup selection based on the group name field. For example, you may want toselect only those groups whose Region is Massachusetts:

• If you have summarized your data, you can set up group selection based oneither the group name field or the summary field. For example:

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 selectioncriteria you set up is intended for group selection. In all other cases, the programknows that you are setting up record selection.

Hint: Group selection is not so much selection as it is suppression. All of thegroups are still in the report. However, only the selected groups are showing.The group tree and any grand totals are processed prior to group selection. Forthis reason, the group tree and grand totals will continue to reflect all groups,including those that are excluded by the group selection criteria.

2011 © 2011 SAP AG. All rights reserved. 177

SAP Class Week of February 13, 2012

Page 192: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

To create a group selection based on summary information

1. Right-click the summary field on which you want to base group selection andchoose Select Expert from the shortcut menu.

The Select Expert dialog box appears.

Note: If you click the Select Expert button without first highlighting asummary 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.

If you have not already previewed the report or refreshed the data, there will notbe any data saved with the report. Without the data, the program cannot calculategroup values; thus, no values appear when you click the arrow in the rightdrop-down list. In this situation, you will have to type in the values you want. Ifyou 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.

4. When you are finished, click OK in the Select Expert to return to the report.

Creating a grand totalOnce you have produced summary information for each group, you may also want tohave a summary for the whole report. Known as a grand total, this total displays at theend of the report in the Report Footer.

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, theoptions available depend on the data type on which you are basing the calculation.

178 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 193: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Summarizing Data

To insert a grand total

1. Click Insert Summary.

Click Insert Summary.

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 theStatus bar. The Grand Total field automatically lines up with and attaches to thesame guideline as the data field it was based upon.

2011 © 2011 SAP AG. All rights reserved. 179

SAP Class Week of February 13, 2012

Page 194: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

180 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 195: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Summarizing Data

Exercise 13: Insert Summaries

Exercise ObjectivesAfter completing this exercise, you will be able to:• Insert summaries for the grouped data• Create labels for the summary fields

Business ExampleAfter creating groups, you need to perform calculations on the report data, such assubtotals, percentages and data counts.

Task: Insert Summary FieldsStarting with an existing report, Grouping on a date field.rpt, insert the followingsummary fields:

Figure 17: Insert Summary Fields

1. Open the report, Grouping on a date field.rpt, from the activity resources forthis course.

2. Insert a count of the Order ID for each month.

3. Insert a subtotal for Order Amount for each month.

4. Add a percentage summary for Order Amount, based on the entire report, foreach month.

5. Create labels to place beside each summary field.

2011 © 2011 SAP AG. All rights reserved. 181

SAP Class Week of February 13, 2012

Page 196: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

Solution 13: Insert SummariesTask: Insert Summary FieldsStarting with an existing report, Grouping on a date field.rpt, insert the followingsummary fields:

Figure 18: Insert Summary Fields

1. Open the report, Grouping on a date field.rpt, from the activity resources forthis course.

a) Navigate to this unit's activity resource folder inMy Documents, to find andopen Grouping on a date field.rpt.

2. Insert a count of the Order ID for each month.

a) Click Order ID.

b) Click Insert -> Summary.

c) In the Insert Summary dialog, choose the following:

Input Field Entry

Choose the field to summarize Orders.Order ID

Calculate this summary Count

Summary location Group #3: Orders.Order Date

d) Click OK.

Continued on next page

182 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 197: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Summarizing Data

3. Insert a subtotal for Order Amount for each month.

a) Click Order Amount.

b) Click Insert -> Summary.

c) In the Insert Summary dialog, choose the following:

Input Field Entry

Choose the field to summarize Orders.Order Amount

Calculate this summary Sum

Summary location Group #3: Orders.Order Date

d) Click OK.

4. Add a percentage summary for Order Amount, based on the entire report, foreach month.

a) Click Order Amount.

b) Click Insert -> Summary.

c) In the Insert Summary dialog, choose the following:

Input Field Entry

Choose the field to summarize Orders.Order Amount

Calculate this summary Sum

Summary location Group #3: Orders.Order Date

Show as percentage of (checkboxselected)

Grand Total: Sum of Order Amount

d) Click OK.

e) Move the percentage summary field and place it below the subtotal field forOrder Amount.

Continued on next page

2011 © 2011 SAP AG. All rights reserved. 183

SAP Class Week of February 13, 2012

Page 198: BOC310 Col96 Part(Crystal Reports)

Unit 4: Organizing Data on a Report BOC310

5. Create labels to place beside each summary field.

a) Click Insert -> Text Object. Place the text object directly beside thesummary field.

b) Type a description, such as Subtotal.

c) Repeat for each summary field.

d) Preview the report.

e) Save the report as Inserting summaries.rpt.

184 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 199: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Summarizing Data

Lesson Summary

You should now be able to:• Insert a summary• Insert a group and summary at the same time

2011 © 2011 SAP AG. All rights reserved. 185

SAP Class Week of February 13, 2012

Page 200: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

Unit SummaryYou should now be able to:• Apply a sort order to records• Create groups• Modify groups• Create nested and multiple groups• Reorder groups• Add a specified order group• Group on time-based data• Create nested and multiple groups• Reorder groups• Add a specified order group based on criteria not specified in the database• Group on time-based data• Insert a grand total• Insert a summary• Insert a group and summary at the same time

186 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 201: BOC310 Col96 Part(Crystal Reports)

BOC310 Test Your Knowledge

Test Your Knowledge

1. Any of the fields from the Sort Fields list can be independently assigned a sortdirection in ascending or descending order.Determine whether this statement is true or false.□ True□ False

2. How would you create groups that are not reflected by the fields in your database?

3. What is the difference between a subtotal and a summary?

2011 © 2011 SAP AG. All rights reserved. 187

SAP Class Week of February 13, 2012

Page 202: BOC310 Col96 Part(Crystal Reports)

Test Your Knowledge BOC310

Answers

1. Any of the fields from the Sort Fields list can be independently assigned a sortdirection in ascending or descending order.

Answer: True

True. Any of the fields from the Sort Fields list can be independently assigned asort direction.

2. 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 createboth the customized groups that will appear on the report and the records thateach group will contain.

3. 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 meaningfulgroups, and then summarizes the values in each group automatically.

188 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 203: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 204: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 205: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

189 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 206: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

190 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 207: BOC310 Col96 Part(Crystal Reports)

Unit 5Formatting a Report

Unit OverviewThis unit provides the basics of formatting a report in SAP Crystal Reports. Manydifferent formatting options exist to highlight information and to make the informationon the report easier to understand.

Unit ObjectivesAfter 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• Format multiple objects• Apply a predefined template• Apply text rotation• Apply accounting conventions• Apply numeric, currency, date, time, and date/time formatting• Embed a database field into a text object• Prevent the truncation of a text object• Format individual elements of a text object• Insert special fields• Format special fields• Embed a special field into a text object

Unit ContentsLesson: Adding Graphical Elements .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193

Exercise 14: Add Graphical Elements .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .199Lesson: Applying Specialized Formatting ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203

2011 © 2011 SAP AG. All rights reserved. 191

SAP Class Week of February 13, 2012

Page 208: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

Exercise 15: Apply Formatting Elements.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211Lesson: Combining Text Objects with Database Fields .. . . . . . . . . . . . . . . . . . . . . .215Lesson: Inserting Fields with Pre-Built Functions ... . . . . . . . . . . . . . . . . . . . . . . . . . . .220

Exercise 16: Add Special Fields.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .225Exercise 17: Faciliated Discussion: Validate the Report Design... . . . . . .229

192 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 209: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding Graphical Elements

Lesson: Adding Graphical Elements

Lesson OverviewAs well as data and text, you can add graphical elements, such as images and lines,in SAP Crystal Reports.

Lesson ObjectivesAfter completing this lesson, 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

Business ExampleWhen you want data or summaries to stand out in the report or when you want toimprove the overall appearance of the report, add graphical elements. When workingwith graphic elements, you may prefer to work from the Design tab. It is easierfrom this view to ensure that graphic elements such as lines, boxes and pictures arepositioned correctly.

Adding a line to a report

Figure 19: Insert Graphical Elements

2011 © 2011 SAP AG. All rights reserved. 193

SAP Class Week of February 13, 2012

Page 210: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

You can add lines to your report to make information stand out from the rest of thereport. For example, a line in the Group Header section will print once for everygroup, 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 anddrag your mouse 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.

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, longdash), width (thickness), and color.

3. Click OK.

Hint: To avoid the line being dragged out of position, select the Lock Positionand 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 inCrystal Reports.

194 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 211: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding Graphical Elements

Adding a box to a reportYou 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 youare creating forms. Pay close attention to where you are placing your box. A boxspanning the group header, details area, and group footer prints once for every groupof records. A box in the Details section prints once for every record. You can put abox 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 onecorner of the box and drag your mouse to the opposite corner of the desired box.

3. Use the tip of the pencil to draw with. Position the pencil where you want onecorner of the box and drag your mouse to the opposite corner of the desired box.

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 alsoassign a fill color and a drop shadow.

3. Select the Rounding tab to adjust the corners of the box to the curve you want forthe 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 DropShadow option that is usually available on the Box tab of the FormatEditor.

5. Click OK when you are finished.

2011 © 2011 SAP AG. All rights reserved. 195

SAP Class Week of February 13, 2012

Page 212: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

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 boxto a new position.

3. Click and drag one of the center handles to stretch the box either horizontallyor vertically.

You can also size your box vertically and horizontally at the same time byclicking and dragging one of the four corner handles.

Adding a graphic to a reportOften, 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 atthe top of a report.

You will find it easier to work in the Design window when placing a picture on areport 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 thatcorner to be and click the mouse button to release.

The area or section in which you are placing the graphic automatically expandsto accommodate the graphic.

Hint: When placing an object onto your report, ensure the top edge of theobject is placed in the section in which you want to insert the object. Ifnecessary, the height of the section is automatically increased to display theobject.

196 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 213: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding Graphical Elements

To format a graphic

1. Right-click the graphic and choose Format Graphic from the shortcut menu.

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.• Click OK when you are finished.

Adding a dynamic image objectObjects can be inserted into Crystal Reports using OLE (Object Linking andEmbedding), which enables you to add objects from other applications and then usethose applications from within Crystal Reports to edit the objects if necessary. Theseobjects are often referred to as OLE objects.

You can now place pictures and graphics in a report through a link stored in adatabase, so that it is no longer necessary to store images within the database. Thisnew feature supports the common practice of storing images on a web server andstoring references to those images in a database.

A dynamic image object is a picture or metafile (PNG, JPG, WMF, BMP, TIF) thatyou access in Crystal Reports by use of a file path or URL. Typically, you use thisoption when you have the path to your pictures or metafiles stored as a string field in adatabase (that is, you do not have the actual objects stored in the database). You canalso 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 dynamicimage objects is created in Crystal Reports through the use of a conditional formattingformula 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 notsupported in a BusinessObjects Enterprise environment for this release. If you plan topublish reports that contain dynamic image objects to BusinessObjects Enterprise, it isrecommended that you use URL links for your OLE objects.

Note: This feature is activated when you refresh your report data. You maynot notice a change in the static OLE object until you click the Refresh buttonin Crystal Reports. Dynamic images are saved in the report with saved data.

2011 © 2011 SAP AG. All rights reserved. 197

SAP Class Week of February 13, 2012

Page 214: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

To add a dynamic image object

1. Right-click the image that you inserted and choose Format Graphic from theshortcut menu.

Note: You begin the process of making an image dynamic by insertingthe object into your report as usual. This object becomes the defaultobject. If Crystal Reports cannot find the dynamic reference to theobject, it uses the default object instead.

2. In the Format Editor, click the Picture tab, and then click the conditionalformatting 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.

198 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 215: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding Graphical Elements

Exercise 14: Add Graphical Elements

Exercise ObjectivesAfter completing this exercise, you will be able to:• Add graphical elements, such as images and borders, to the report

Business ExampleYou want information on the report to stand out and you want to brand the reportwith the company logo.

Task: Add Images and LinesYou will add lines to the report to create emphasis. As well, you will add the companylogo and the copyright image.

1. Open the report, Inserting a grand total.rpt.

2. Add the company logo to the report header.

3. Add a thick blue line directly below the column headings.

4. Add a thick blue border around the Order Date group.

Hint: You may need to adjust the height of sections related to this groupto make room for a border.

5. Add a copyright image to the Page Footer section.

6. As an optional step, make the copyright image a dynamic object. The report willbe automatically updated when a new copyright image replaces the original.

2011 © 2011 SAP AG. All rights reserved. 199

SAP Class Week of February 13, 2012

Page 216: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

Solution 14: Add Graphical ElementsTask: Add Images and LinesYou will add lines to the report to create emphasis. As well, you will add the companylogo and the copyright image.

1. Open the report, Inserting a grand total.rpt.

a) Navigate to My Documents to find and open the report.

2. Add the company logo to the report header.

a) Click Insert -> Picture.

b) Navigate to My Documents to select the company logo image file,xtreme.bmp. Drop the image in the Report Header section.

Hint: You may need to adjust the Report Title text box to makeroom for the image in the report header.

3. Add a thick blue line directly below the column headings.

a) Select all the column headings in the page header. Right-click and selectFormat Objects.

b) From the Format Editor dialog box, click the Font tab. Deselect theUnderline checkbox.

Click OK.

c) Click Insert -> Line. Drag and drop the line across the Page Header sectiondirectly below the column headings.

d) Right-click the line and select Format Line.

e) Select the 3 pt width and the color blue. Click OK.

Continued on next page

200 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 217: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding Graphical Elements

4. Add a thick blue border around the Order Date group.

Hint: You may need to adjust the height of sections related to this groupto make room for a border.

a) Click Insert -> Box. Drag and drop the box so that it surrounds all theobjects in the Order Date group header, details and group footer sections.

b) Right-click the box and select Format Box.

c) From the Format Editor dialog box, select the 2.5 width and the colorblue. Click OK.

5. Add a copyright image to the Page Footer section.

a) Click Insert -> Picture.

b) Navigate to My Documents to select the original copyright image file,copyright.jpg. Drop the image in the Page Footer section.

c) Save the report as , Adding graphical elements.rpt.

6. As an optional step, make the copyright image a dynamic object. The report willbe automatically updated when a new copyright image replaces the original.

a) Right-click the copyright image and select Format Graphic.

b) From the Format Editor dialog box, select the Picture tab.

c) Click the x+2 Formula Editor beside Graphic Location.

d) Write a formula that indicates the location of the new copyright logo. Forexample: “c:\My Documents...\copyright.jpg”

Hint: Remember to include quotations for the graphic location.

e) Click Save and Close. Click OK.

2011 © 2011 SAP AG. All rights reserved. 201

SAP Class Week of February 13, 2012

Page 218: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

Lesson Summary

You should now 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

202 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 219: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Specialized Formatting

Lesson: Applying Specialized Formatting

Lesson OverviewIn SAP Crystal Reports, you can customize the report to be presentation quality.

Lesson ObjectivesAfter completing this lesson, 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

Business ExampleYou want to make a positive impression with how the report results are displayed.Format the objects to deliver a presentation quality report.

Formatting multiple objectsUse the Format Painter to copy formatting properties from one report object to oneor more target objects. The Format Painter button displays on the Standard toolbarwhen you select a source object in your report. If you apply formatting to a target fieldthat is not the same as your source field, only the common properties are applied.

2011 © 2011 SAP AG. All rights reserved. 203

SAP Class Week of February 13, 2012

Page 220: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

Some things to keep in mind about the Format Painter:

• The Format Painter does not copy hyperlink information to a target object orfield.

• The Format Painter does not copy formatting that is applied through use ofthe Highlighting Expert.

• The Format Painter does not copy formatting from text/template objects todatabase fields.

• When using a Date and Time field as your source, a target field’s date or timeproperties are changed; the reverse is also true (that is, a Date field or a Timefield used as your source also affects the date and time properties of a Dateand Time field).

• This tables lists the source report objects and fields and the applicable targetsyou can use with the Format Painter.

Figure 20: Formatting multiple objects

204 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 221: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Specialized Formatting

To copy and apply formatting

1. Select a source object or field in your report and click Format Painter.

Hint: You can also select Format Painter from the shortcut menu.

Note:

• The Format Painter button is not available until you select anobject or field.

• Click the button a second time, or press Esc, to exit the FormatPainter.

• 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 Stopcursor if the object or field cannot be used as a target.

Applying predefined templatesA template is an existing report file whose formatting can be added to a new orexisting report. You can use the templates found in the Template Expert to give anynumber of reports a consistent look without having to format each report individually.

Use the Template Expert command to apply one of several professionally-designedstyles to your report. When you choose the Template Expert command, the TemplateExpert appears.

Use this dialog box to select a report style and apply it to your report.

2011 © 2011 SAP AG. All rights reserved. 205

SAP Class Week of February 13, 2012

Page 222: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

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.

2. Choose a template.3. Click OK.

Note: If a template has already been applied, you can undo the currenttemplate or reapply the last template in the Template Expert. If you wantto have the headings print vertically to save space on your report, use textrotation, sometimes referred to as vertical text. Designed primarily to supportformatting in foreign languages (for example, Japanese), you can formatstring fields, memo fields, and text objects vertically.

Applying text rotationYou can export a report with vertical text to various formats; a report with vertical textcan also be exported to the web and viewed in a report viewer, a type of specializedweb 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 theshortcut menu.

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.

206 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 223: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Specialized Formatting

Applying accounting conventionsTo 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 whendisplaying numbers in accounting reports and determine whether overflow fieldrepresentation is enabled for the selected field(s), commonly referred to as fieldclipping.

To apply accounting formatting

1. Right-click the currency or number field and click Format Field from theshortcut menu.

The Format Editor opens, displaying the appropriate options for the number orcurrency field selected.

2. Click the Number tab to make it active, if it is not displayed.3. Click the Customize button.

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 signsof numbers (plus or minus) reverse their sign when displaying debit or creditamounts in financial reports.

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/timeformattingYou 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.

2011 © 2011 SAP AG. All rights reserved. 207

SAP Class Week of February 13, 2012

Page 224: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

You can choose from a list of sample styles, including the system default settings, oryou can customize the style of the number display:

• System Default

Whatever you have specified through your machine’s Control Panel is thedesignated system default.

• 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 samplenumber formats but want to customize one of these styles further, you makealterations 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 numberfield in the Number tab of the Format Editor. Because you select a currency field, theoptions that appear in the Style area of the Number tab change to currency formattingexamples.

The currency options are listed in the Format Editor.

The options are:

• Display currency symbol

Select Display currency symbol to have the symbol appear on the report. Setwhether the symbol is fixed in one position or whether the symbol “floats” withthe currency numbers by clicking the option buttons.

• System Default

This choice reflects the default format that is set up in your machine’s ControlPanel.

• 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

208 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 225: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Specialized Formatting

Use the options in the Date and Time tab of the Format Editor to customize thedisplay of your date and time fields. Depending on the type of field you have selectedto format, the Date and Time tab of the Format Editor displays the appropriate systemdefault formats and sample styles for that type of field.

Figure 21: Date and Time Functions

The options are:

• System Default

The choices System Default Long Format and System Default Short Format arethe 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, ordate/time fields quickly.

• Customize

If you do not choose any of the system default formats or sample formats, youcan further customize your formatting through the Custom Style dialog box

2011 © 2011 SAP AG. All rights reserved. 209

SAP Class Week of February 13, 2012

Page 226: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

To customize a sample style

1. Choose the system default format or one of the sample styles that you thinklooks closest in format to the one you want to create for either a number orcurrency field.

2. Click Customize.

The Custom Style dialog box opens. If the field is a number, you make themodifications in the Number tab of the Custom Style dialog box.

If your selection is a currency field, you make the modifications in the CurrencySymbol tab of the Custom Style dialog box.

3. Make the modifications, as necessary4. 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 youthink is close to 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 Styledialog box to further customize the field. After you have defined a customizedformat, a new item called Custom Style appears in the Style area of the Date andTime tab in the Format Editor.

Caution: The Custom Style item only appears in the list of styles if youhave defined and selected it as the style to use for that type of field. If youchoose the system default or a sample style after using the custom style, thecustom style will be discarded. This action applies to a number, currency,date, time, or date/time field.

210 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 227: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Specialized Formatting

Exercise 15: Apply Formatting Elements

Exercise ObjectivesAfter completing this exercise, you will be able to:• Embed a field into a text object• Prevent the truncation of text• Change the font and color of a text object

Business ExampleInsert Business example here

Task 1: Embed a Field into a Text ObjectYou will combine text and a field into one text object. Combine each of the summaryfields with their respective text object. Repeat for the subtotals in the group footer andgrand total in the report footer.

1. Open the report, Adding graphical elements.rpt.

2. Select a summary field and drag it into their respective text box.

Task 2: Prevent TruncationYou will prevent the subtotal and grand totals values from truncation when the reportis previewed.

1. Format the subtotal and grand total objects to grow when more lines are neededto display the text and its sum.

Task 3: Change the Color and Font of TextYou will change the color and font of the text in the report title.

1. Edit the report title text.

2011 © 2011 SAP AG. All rights reserved. 211

SAP Class Week of February 13, 2012

Page 228: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

Solution 15: Apply Formatting ElementsTask 1: Embed a Field into a Text ObjectYou will combine text and a field into one text object. Combine each of the summaryfields with their respective text object. Repeat for the subtotals in the group footer andgrand total in the report footer.

1. Open the report, Adding graphical elements.rpt.

a) Navigate to My Documents to find and open the report.

2. Select a summary field and drag it into their respective text box.

a) In the Group Footer section, select Sum of Order Amount and drag this fieldinto the Subtotal text box.

b) Repeat for the all the summary fields in the group footer and report footer.

Task 2: Prevent TruncationYou will prevent the subtotal and grand totals values from truncation when the reportis previewed.

1. Format the subtotal and grand total objects to grow when more lines are neededto display the text and its sum.

a) Right-click the subtotal object and select Format Text.

b) From the Format Editor dialog box, select the Can Grow checkbox. ClickOK.

Hint: The Can Grow option does not work horizontally. You mayneed to further adjust the width of the text box to correctly displayits value when the report is previewed.

c) Repeat for the all the subtotal objects in the group footer and grand totalobject in the report footer.

Continued on next page

212 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 229: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Specialized Formatting

Task 3: Change the Color and Font of TextYou will change the color and font of the text in the report title.

1. Edit the report title text.

a) Double-click the report title object to edit the text.

b) Select “Customers & Orders”. Right-click and select Text Formatting.

c) Select font style as bold and the color as maroon. Click OK.

d) Save the report as, Adding formatting elements.rpt.

2011 © 2011 SAP AG. All rights reserved. 213

SAP Class Week of February 13, 2012

Page 230: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

Lesson Summary

You should now 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

214 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 231: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Combining Text Objects with Database Fields

Lesson: Combining Text Objects with Database Fields

Lesson OverviewData makes up the majority of the report. Often, however, you need to combine ormanipulate data, add labels, or paragraphs to the report to make them more functional.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Embed a database field into a text object• Prevent the truncation of a text object• Format individual elements of a text object

Business ExampleYou have a database field, such as date, that you want to display with a description.Combine the description and the database field into one report object.

Embedding a database field into a text objectTo print embedded text and field information or to embed multiple fields, you embedthe field into a text object. For example, you might want to create a form letterwith the beginning “Dear Mr. Smith”, where “Mr.” and “Smith” were part of yourdatabase, and you added the salutation. You can insert a field into a text object byusing a menu command, a button, or a dialog box.

Many databases add blanks or spaces after the text of their string fields. Insertingdatabase fields into text objects with Crystal Reports automatically trims any trailingspaces from the beginnings or ends of the data.

If you were to put these three data fields into a text object, Crystal Reports trims anyexcess characters, and joins them so they flow:

Mr. Paul Smith

Ms. Elaine Jones

Ms. Carol Smith-Jones

2011 © 2011 SAP AG. All rights reserved. 215

SAP Class Week of February 13, 2012

Page 232: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

To embed a database field into a text object

1. Double-click the text object to enter the edit mode.

A blinking cursor appears.

2. In the Field Explorer, select the field you want to add.3. Drag the field into the text object.

You can also select multiple fields and insert them into the text objectsimultaneously.

As you approach the text object with the cursor, watch for the vertical insertionline to appear inside the text object.

Hint: Do not let go of the mouse button until the vertical insertion lineis in the position you want the database field to print.

4. Move the cursor to place the insertion point where you want it to appear in thetext object. If you place the database field correctly, it will look like this:

5. Select the Show Field Names option in FileOptions to read the database fieldnames as you insert them into your text objects.

Note: Embedding a text object within another text object is not possible.

Preventing truncation of text objectsSometimes it is difficult to predict how long or tall you should make your text objectsif 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, toallow the text box to expand vertically, if necessary, to fit all text and data from theembedded fields, like word wrap in a word processing application.

Remember to size your text objects with the printed result in mind. Do not worry ifthe full names of the database or special fields are not visible in the Design tab. Theprinted result is what 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.

2. Select the Can Grow check box on the Common tab and enter the maximumnumber of lines that you want the field to expand.

Note: The Can Grow option does not expand horizontally.

216 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 233: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Combining Text Objects with Database Fields

Formatting individual elements of text objectsYou can format the individual elements of a text object independently. An element isany single item that is contained in a text object. The word “report” is made up of sixelements, since each letter could be selected and formatted individually. Each fieldthat 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 thetext object as a whole.

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 textor a field.

3. Right-click the selected element(s) and select the formatting option from theshortcut 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.

2011 © 2011 SAP AG. All rights reserved. 217

SAP Class Week of February 13, 2012

Page 234: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

Setting tabs in a text objectEach text object can have its own tab setting.

• To set tabs

– Click in the text object to put it into edit mode.

The ruler line appears.

– Click the ruler line where you want to place the tab.• To move a tab

Drag it to a new position on the ruler.

• To remove a tab

Drag it off of the ruler line and let go.

Hint: Editing text objects is like using a mini word processor. You canadd tabs, set paragraph alignments, and create indentations.

218 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 235: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Combining Text Objects with Database Fields

Lesson Summary

You should now be able to:• Embed a database field into a text object• Prevent the truncation of a text object• Format individual elements of a text object

2011 © 2011 SAP AG. All rights reserved. 219

SAP Class Week of February 13, 2012

Page 236: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

Lesson: Inserting Fields with Pre-Built Functions

Lesson OverviewAs well as the fields that are retrieved from the data source, you can insert specialfields. These special fields are often retrieved from the report itself, such as file author,page number and print date.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Insert special fields• Format special fields• Embed a special field into a text object

Business ExampleYou can reduce the amount of time spent format reports by using special fields thatcontain pre-built functions..

Inserting special fieldsSpecial fields contain information that is not included in the database, but is useful tothe overall presentation quality of the report, making your report more readable.

220 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 237: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Inserting Fields with Pre-Built Functions

Figure 22: Insert Special Fields

2011 © 2011 SAP AG. All rights reserved. 221

SAP Class Week of February 13, 2012

Page 238: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

Some of the more commonly used special fields are:

• Current CE User ID: displays the ID number of the current BusinessObjectsEnterprise user (if one exists).

• Current CE User Name: displays the name of the current BusinessObjectsEnterprise user (if one exists).

• Data Date: prints the date the data was last refreshed on a report with saved data.• 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 Reportswill not format a page until it is requested by the user, or until it isrequired 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.

Hint: If you have created and saved a report and then months later couldnot remember the file name or location, put the file name and locationinto 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 toperform the same function.

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 cursor3. Drag the field in the desired location and click to drop it onto the report

222 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 239: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Inserting Fields with Pre-Built Functions

Formatting special fieldsThe formatting options for each of the special fields varies depending on the data typethe 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 areformatting.

2. Make the desired changes3. Click the other tabs to make any other changes4. Click OK.

Hint: Changing the date order does not change the placement of the optionsin the Format area. To see how your date will print, remember to look at thesample at the bottom of the dialog box.

Note: The separator boxes can accommodate several characters each. Do notforget to add a space in the separator box if that is what you want betweenthe date elements.

Embedding a special field into a text objectYou can place special fields inside a text object to complete a sentence, or wheninformation changes if the report changes. For example, if you need to know eachtime the report was modified, you would insert a special field into a sentence thatstates when the report was last changed.

When inserting a special field into a text object, you follow the same steps as insertinga database field.

To embed a special field into a text object

1. In the Field Explorer, locate the Special Fields list and expand its contents.2. Click the field you want to insert into the text object from the scrolling field list.3. Drag the field from the menu until the cursor shows a vertical insertion point

inside your text object at the position you want the field to print.

You can also select the field, and then click the Insert button at the top of thedialog box.

4. Once the insertion point is in the desired place, click the mouse button to releasethe field into the text object.

2011 © 2011 SAP AG. All rights reserved. 223

SAP Class Week of February 13, 2012

Page 240: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

224 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 241: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Inserting Fields with Pre-Built Functions

Exercise 16: Add Special Fields

Exercise ObjectivesAfter completing this exercise, you will be able to:• Add several special fields to the report to cut down on the time spent formatting

individual elements

Business ExampleAs the report designer, you want to add special fields that provide report specificinformation, such as page number, print date.

Task 1: Add Print Date and Page NumberAdd the print date to the Report Header section and the page number to the PageFooter section.

1. Open the report, Adding formatting elements.rpt.

2. Open Field Explorer.

3. Add the special fields, Print Date to the report header and Page Number to thepage footer.

Task 2: Format Special FieldsFormat the date to print like March 1999. Format the page number as bold. Inserteach of the special fields into a text object that includes a descriptive label.

1. Format the print date.

2. Format the page number.

3. Insert Print Date into a text box that states “Print:” in bold.

4. Insert Page Number into a text box that states “Page Number:”

2011 © 2011 SAP AG. All rights reserved. 225

SAP Class Week of February 13, 2012

Page 242: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

Solution 16: Add Special FieldsTask 1: Add Print Date and Page NumberAdd the print date to the Report Header section and the page number to the PageFooter section.

1. Open the report, Adding formatting elements.rpt.

a) Navigate to My Documents to find and open the report.

2. Open Field Explorer.

a) Click View -> Field Explorer.

3. Add the special fields, Print Date to the report header and Page Number to thepage footer.

a) Expand the Special Fields node.

b) Select Print Date and drag it to the report header.

c) Select Page Number and drag it to the page footer.

Task 2: Format Special FieldsFormat the date to print like March 1999. Format the page number as bold. Inserteach of the special fields into a text object that includes a descriptive label.

1. Format the print date.

a) Right-click Print Date and select Format Field.

b) From the Format Editor dialog box, in the Date tab, select the option todisplay this date as March 1999.

c) Click OK.

2. Format the page number.

a) Right-click Page Number and select Format Field.

b) From the Format Editor dialog box, in the Font tab, select the style as Bold.

c) Click OK.

Continued on next page

226 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 243: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Inserting Fields with Pre-Built Functions

3. Insert Print Date into a text box that states “Print:” in bold.

a) Click Insert -> Text Object. Place this text object into the Report Headersection.

b) Type Printed:.

c) Select Print Date and drag it into the text object.

d) Right-click the text object and select Format Text.

e) From the Format Editor dialog box, in the Font tab, select the style as Bold.

f) Click OK.

4. Insert Page Number into a text box that states “Page Number:”

a) Click Insert -> Text Object. Place this text object into the Page Footersection.

b) Type Page Number:.

c) Select Page Number and drag it into the text object.

d) Save the report as Adding special fields.rpt.

2011 © 2011 SAP AG. All rights reserved. 227

SAP Class Week of February 13, 2012

Page 244: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

228 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 245: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Inserting Fields with Pre-Built Functions

Exercise 17: Faciliated Discussion: Validatethe Report Design

Exercise ObjectivesAfter completing this exercise, you will be able to:• Verify that the completed report looks similar to the report prototype

Business ExampleYou need to review the report to ensure that it includes all that was specified in theprototype.

Task: Review the Report DesignReview the report prototype against the completed report.

1. Map each item on the report prototype form to the completed report.

2011 © 2011 SAP AG. All rights reserved. 229

SAP Class Week of February 13, 2012

Page 246: BOC310 Col96 Part(Crystal Reports)

Unit 5: Formatting a Report BOC310

Solution 17: Faciliated Discussion: Validatethe Report DesignTask: Review the Report DesignReview the report prototype against the completed report.

1. Map each item on the report prototype form to the completed report.

a) Review the prototype specifications:

• The report reflects the purpose of the report.• The header includes the company 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 thelocator order number (ID).

• The report displays only the Western Sales Territory and Eastern SalesTerritory, 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 or orders by date, a

subtotal and a grand total, a percentage of order amount compared tothe grand total, and the number of unique or distinct customers.

• Key information has been highlighted in the report.

230 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 247: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Inserting Fields with Pre-Built Functions

Lesson Summary

You should now be able to:• Insert special fields• Format special fields• Embed a special field into a text object

2011 © 2011 SAP AG. All rights reserved. 231

SAP Class Week of February 13, 2012

Page 248: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

Unit SummaryYou should now 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• Format multiple objects• Apply a predefined template• Apply text rotation• Apply accounting conventions• Apply numeric, currency, date, time, and date/time formatting• Embed a database field into a text object• Prevent the truncation of a text object• Format individual elements of a text object• Insert special fields• Format special fields• Embed a special field into a text object

232 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 249: BOC310 Col96 Part(Crystal Reports)

BOC310 Test Your Knowledge

Test Your Knowledge

1. Graphical elements such asmake specific data stand out and improve the overall experience of the report.Fill in the blanks to complete the sentence.

2. The copies formatting properties from one reportobject to one or more target objects when you first select a source object in areport and then apply that object's formatting to a target field.Fill in the blanks to complete the sentence.

3. The gives any number of reports a consistentlook without having to format each report individually.Fill in the blanks to complete the sentence.

4. To reduce the amount of time spent formatting reports by using fields thatcontain pre-built functions, use .Fill in the blanks to complete the sentence.

2011 © 2011 SAP AG. All rights reserved. 233

SAP Class Week of February 13, 2012

Page 250: BOC310 Col96 Part(Crystal Reports)

Test Your Knowledge BOC310

Answers

1. Graphical elements such as lines, boxes, and pictures make specific data standout and improve the overall experience of the report.

Answer: lines, boxes, and pictures

2. The Format Painter copies formatting properties from one report object to oneor more target objects when you first select a source object in a report and thenapply that object's formatting to a target field.

Answer: Format Painter

3. The Template Expert gives any number of reports a consistent look withouthaving to format each report individually.

Answer: Template Expert

4. To reduce the amount of time spent formatting reports by using fields thatcontain pre-built functions, use Special Fields.

Answer: Special Fields

234 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 251: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 252: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 253: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

235 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 254: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

236 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 255: BOC310 Col96 Part(Crystal Reports)

Unit 6Applying Section Formatting

Unit OverviewThis unit explores formatting options that can be applied to entire report sections, suchas headers, details and footers, in SAP Crystal Reports.

Unit ObjectivesAfter completing this unit, you will be able to:

• Define the Section Expert• Format sections• Define a summary report• Create a summary report

Unit ContentsLesson: Formatting Sections ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .238

Exercise 18: Format Sections ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .249Lesson: Creating Summary Reports .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .253

Exercise 19: Create a Summary Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .257

2011 © 2011 SAP AG. All rights reserved. 237

SAP Class Week of February 13, 2012

Page 256: BOC310 Col96 Part(Crystal Reports)

Unit 6: Applying Section Formatting BOC310

Lesson: Formatting Sections

Lesson OverviewYou can create multiple sections within an area on the report.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Define the Section Expert• Format sections

Business ExampleWith the multiple sections of a report, format specific sections to differentiate orhighlight the information located here.

The Section ExpertThe Section Expert offers flexibility when formatting different sections of a report.The three tabs that always appear in the Section Expert are

Figure 23: Section Expert

• Common tab• Paging tab• Color tab

238 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 257: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Sections

A fourth tab, the Layout tab, appears when you select the details section and theFormat with Multiple Columns option on the Common tab.

To open the Section Expert

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 withmultiple columns, and so on for a desired section.

The active options on the Common tab vary, depending on which section is selected inthe Sections list. Only options applicable to the selected section are available.

Note: The Conditional Formatting button enables you to add a formula thatapplies a condition to the selected feature. The formula is processed when thecondition is met in the report data.

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) onthe shortcut menu. It prevents the area/section from printing, but still allows theuser to double-click a summary field to open a new display tab to show theunderlying 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 viewersdrill down on the summary fields to see the information behind them. Orperhaps 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 theunderlying data. If a user double-clicks when the magnifying glass appears, theprogram produces a new tab, but the details do not show. Only the summary fieldis duplicated. You can also make this feature conditional by clicking the formulabutton 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 pageas possible. In a report that generates invoices, for example, you would wanteach invoice to have the total printed at the bottom of the page. That way, allinvoices have the total printed in the same place, no matter how many entries areon the invoice. This command can be made conditional by clicking the formulabutton then entering a Boolean formula.

2011 © 2011 SAP AG. All rights reserved. 239

SAP Class Week of February 13, 2012

Page 258: BOC310 Col96 Part(Crystal Reports)

Unit 6: Applying Section Formatting BOC310

• Keep Together

This option prevents page breaks from spreading data from a single record overtwo pages. Therefore, if you have multiple lines in the Detail section, all theinformation for each detail line would stay together on one page if you turn theKeep Together option on. This command can be made conditional by clickingthe formula button then entering a Boolean formula.

• Suppress Blank Section

This command suppresses or prevents printing of the section if all fields in thatsection are blank. A typical use is in the creation of a mailing label reportwhere there is no second address line and you do not want a gap to print. Thiscommand can be made conditional by clicking the formula button then enteringa Boolean formula.

• Underlay Following Sections

Underlay allows any objects that are in the section to flow into the next whileallowing objects from the next section to print on top of the first. This commandcan be made conditional by clicking the formula button then entering a Booleanformula.

You might place the company logo in the Page Header and turn on UnderlayFollowing Sections for the Page Header to create a watermark effect. Thiscommand is often used with sections containing charts.

• Format with Multiple Columns

This option is activated only when the Details section is chosen. This optionenables you to create a report that shows the details in columnar format ratherthan having the details all show one under the other. An example is addresslabels.

• Clamp Page Footer

When this check box is selected, the program removes any extra white spaceat the bottom of a report. This minimizes unnecessary scrolling for reportsviewed online.

Note: This option appears only when you have selected Page Footerin the Sections list.

• Reserve Minimum Page Footer

This option enables you to minimize the space reserved for your Page Footersections, thereby maximizing the space available for valuable report informationon each page. This option only affects a Page Footer area with multiple sections.

240 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 259: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Sections

By default, Crystal Reports reserves space at the bottom of each page foryour Page Footer sections. This space is reserved whether or not the PageFooter sections are conditionally suppressed. Normally, the space reserved isequivalent to the combined height of all Page Footer sections that are shownor conditionally suppressed.

You can, however, minimize the space reserved. To do so, first conditionallysuppress individual Page Footers as desired. Then select Page Footer in theSections area of the Section Expert, and select the Reserve Minimum PageFooter option on the Expert’s Common tab. When you do this, Crystal Reportswill only reserve space on each page for the tallest of your Page Footer sections.

Note: This option appears only when you select Page Footer in theSections list.

• Reserve Minimum Page Footer

This option enables you to minimize the space reserved for your Page Footersections, thereby maximizing the space available for valuable report informationon 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 foryour Page Footer sections. This space is reserved whether or not the PageFooter sections are conditionally suppressed. Normally, the space reserved isequivalent to the combined height of all Page Footer sections that are shownor conditionally suppressed.

You can, however, minimize the space reserved. To do so, first conditionallysuppress individual Page Footers as desired. Then select Page Footer in theSections area of the Section Expert, and select the Reserve Minimum PageFooter option on the Expert ’s Common tab. When you do this, Crystal Reportswill only reserve space on each page for the tallest of your Page Footer sections.

Note: This option appears only when you select Page Footer in theSections list.

• Read-only

This option makes a section read-only and locks the formatting and position ofall the report objects it contains so they can’t be formatted or moved. When youselect this option, all other choices in the Section Expert become inactive. Theformatting options that are usually available on the toolbars or shortcut menusare also suppressed for that section.

• Relative Positions

2011 © 2011 SAP AG. All rights reserved. 241

SAP Class Week of February 13, 2012

Page 260: BOC310 Col96 Part(Crystal Reports)

Unit 6: Applying Section Formatting BOC310

This option allows you to lock the relative position of a report object next to agrid object within a section.

– Only horizontal locking is possible. If you need to preserve relative verticalpositioning, you should create a new report section.

– Once Relative Positions is selected for a section, you can no longer dragobjects 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 gridobjects (that is, objects that can grow horizontally).

Note:

• Only horizontal locking is possible. If you need to preserve relativevertical positioning, you should create a new report section.

• Once Relative Positions is selected for a section, you can no longerdrag objects to new positions within that section. To change an object'sposition, use the Object Size and Position dialog box.

• Relative positioning applies only to objects placed to the right of gridobjects (that is, objects that can grow horizontally).

The Conditional Formatting button enables you to add a formula that applies acondition to the selected feature. The formula is processed when the condition ismet 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:

• New Page Before

New Page Before is an available format property for Group (header and footer)and Details sections. When you select this option, the program inserts a pagebreak before it prints the section. The page break thus comes before:

– The group (if using the option with a Group footer section).– Each report record (if using the option with a Details section).

242 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 261: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Sections

The Page Header and Page Footer appear on each page. If you have a subtotalor summary field in a Group Footer section, you can use the New Page Beforeoption to put these values on pages following the value being totaled.

Hint: In order to avoid blank pages, use the conditions NotOnFirstRecord and Not OnLastRecord with New Page Before or NewPage After.

• Reset Page Number After

This option causes the page number to return to one after the section is complete.Normally, this feature is applied to a Group Footer. Therefore, if one groupspans several pages, you see page 1, page 2, and so on, of the group. Then, whenCrystal Reports goes to the next group, you see page 1, page 2, and so on, again.

• New Page After

When the End of Section check box is selected, the program inserts a page breakafter the section.

– The Page Header and Page Footer appear on each page.– Use New Page After in the Group footer section to print each group on

a separate page.

When the Visible Records check box is selected, the program inserts a pagebreak after a specific number of records.

Note:

– This feature applies only to visible records. Suppressed recordsmay be contained on a page, but will not count toward visiblerecords.

– This option appears only when you have selected the Detailssection in the Sections list.

• Orientation

Allows you to set page orientation for each section in the report except for thePage Header and Page Footer. The default setting will be the same as the reportpage orientation in the Page Setup dialog box.

Note: In order to avoid blank pages, use the conditions NotOnFirstRecord and Not OnLastRecord with New Page Before or NewPage After.

2011 © 2011 SAP AG. All rights reserved. 243

SAP Class Week of February 13, 2012

Page 262: BOC310 Col96 Part(Crystal Reports)

Unit 6: Applying Section Formatting BOC310

Exploring the Color tab

Use the Color tab to set the background color for the desired section.

The options in the Color tab are:

• Background Color

To add a background color to the selected section, select this check box, thenchoose a color from the list.

• Conditional Formula

Click this button if you want to set up a conditional formatting formula for thecorresponding property.

Exploring the Layout tab

Use the Layout tab to set up your report in a multi-column format. That is, instead ofhaving the data print straight down the page, you can set up multiple columns and havethe data flow from column to column. You can also have your data print across thendown the page, printing one record in each column, then printing a second record ineach column, then a third, and so on. The dialog box is divided into four smaller boxes.

244 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 263: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Sections

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 howhigh 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 wantto allow between details.: Horizontal =the gaps between details going across thepage, Vertical = the gaps between details going down the page.

Determine the gaps you want to allow. Enter the horizontal gap in the Horizontaledit 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 followswhen printing the details on a report page. Your options are:

– Across then Down

Prints details across the columns, one detail in the first column, one in thenext, 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 firstcolumn, then in the second, and so on.

– Down then Across

Prints details down the first column, then down the second column, andso on.

• Format groups with multiple column

Select this check box if you want the program to format groups with multiplecolumns using the Width, Gap between Details, and Printing Directions specifiedfor the selected section.

Formatting a sectionWhen would you use multiple sections in your report? Perhaps you want to display astandard set of details and additional details if there is an outstanding invoice. You canplace the standard data in Details a and leave it at the default to always print. Thenyou can place the invoicing data in Details b and format Details b to print only whenthere is an outstanding invoice.

2011 © 2011 SAP AG. All rights reserved. 245

SAP Class Week of February 13, 2012

Page 264: BOC310 Col96 Part(Crystal Reports)

Unit 6: Applying Section Formatting BOC310

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 displaygroup values for US customers by conditionally formatting it. Then, you couldconditionally 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 inthe list.

2. Select the top section.3. Click the Merge button.

The program merges the selected section with the section below. Any data in thesection 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.

Hint: When you want to delete a section and its contents, use the Deletesection option. When a section contains objects and you want to combine thedata with data in another section, use the Merge section option.

246 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 265: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Sections

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.3. Select a color from this list to make the background color of the selected section

absolute.

2011 © 2011 SAP AG. All rights reserved. 247

SAP Class Week of February 13, 2012

Page 266: BOC310 Col96 Part(Crystal Reports)

Unit 6: Applying Section Formatting BOC310

248 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 267: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Sections

Exercise 18: Format Sections

Exercise ObjectivesAfter completing this exercise, you will be able to:• Format report sections using Section Expert

Business ExampleAs a report designer, you need to manage how the report sections are displayed. Youcan suppress, format and specify printing options of a section.

Task 1: Suppress Report SectionsSuppress the Page Footer, Report Footer, and Group Footer #2 sections.

1. Open the report, Sections-1.rpt.

2. Suppress sections using Section Expert.

Task 2: Format Group to Print on Separate PageFormat every country to print on a separate page.

1. Specify paging for Country Group Header section.

Task 3: Format Section ColorFormat the section color of Region Group Header and Details to print with a silverbackground.

1. Specify the background color for the Region Group Header and Details sections.

2011 © 2011 SAP AG. All rights reserved. 249

SAP Class Week of February 13, 2012

Page 268: BOC310 Col96 Part(Crystal Reports)

Unit 6: Applying Section Formatting BOC310

Solution 18: Format SectionsTask 1: Suppress Report SectionsSuppress the Page Footer, Report Footer, and Group Footer #2 sections.

1. Open the report, Sections-1.rpt.

a) Navigate to My Documents to find and open the report.

2. Suppress sections using Section Expert.

a) Click Report -> Section Expert.

b) Select Page Footer from the list of sections.

c) Select the option to Suppress (No Drill-Down).

d) Select Report Footer from the list of sections.

e) Select the option to Suppress (No Drill-Down).

f) Select Group Footer #2 from the list of sections.

g) Select the option to Suppress (No Drill-Down).

h) Click OK.

Continued on next page

250 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 269: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Sections

Task 2: Format Group to Print on Separate PageFormat every country to print on a separate page.

1. Specify paging for Country Group Header section.

a) Click Report -> Section Expert.

b) Select Group Header #1 for the Country Group Header section.

c) Click the Paging tab.

d) Select the New Page Before checkbox.

e) Select the x+2 beside this option to launch the Formula Editor.

f) Type Not(notonfirstrecord).

This formula will exclude the paging option from applying to the firstrecord of this section. Therefore, a blank page will not be displayed beforethe first group.

g) Click Save and Close.

h) Click OK.

Task 3: Format Section ColorFormat the section color of Region Group Header and Details to print with a silverbackground.

1. Specify the background color for the Region Group Header and Details sections.

a) Click Report -> Section Expert.

b) Select Group Header #2 for the Region Group Header.

c) Select the Color tab.

d) Select the Background Color checkbox.

e) Select Silver as the color. Click OK.

f) Save the report as Formatting sections.rpt.

2011 © 2011 SAP AG. All rights reserved. 251

SAP Class Week of February 13, 2012

Page 270: BOC310 Col96 Part(Crystal Reports)

Unit 6: Applying Section Formatting BOC310

Lesson Summary

You should now be able to:• Define the Section Expert• Format sections

252 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 271: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating Summary Reports

Lesson: Creating Summary Reports

Lesson OverviewA summary report includes only one summary line for each group in the report. In asummary report, the details are hidden from the viewer, but can be made accessiblethrough drill-down.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Define a summary report• Create a summary report

Business ExampleThe report results have a lot of data in the details. The report data is grouped witha summary inserted into the group footer. You only want to display a list of thesummary results for each group.

Summary reportsThe reports that you have created so far are detailed reports that include all lines ofdetail. However, you can create different types of reports. For example, perhaps amanager is only interested in summary information such as the total sales for a region.A summary report is easily created from a detail report. In order to be able to createa summary report, you must first have at least one group defined on your report, aswell as a summary field. Then, you need to hide the Details section so you only seethe group information.

When you create a summary report, you can choose to enable users to drilldown on summary information to access the underlying data. Drill–down is thecapability to double–click a summary field and open a new window tab to show thebehind–the–scenes data that makes up that summary. From the Section Expert youhave the choice to Hide or Suppress a Details section.

2011 © 2011 SAP AG. All rights reserved. 253

SAP Class Week of February 13, 2012

Page 272: BOC310 Col96 Part(Crystal Reports)

Unit 6: Applying Section Formatting BOC310

Creating a summary reportThe options in the Section Expert that are applicable to creating a summary report are:

• Hide (Drill–Down OK)

When Hide (Drill–Down OK) is selected, the cursor changes into a magnifyingglass whenever you are in a summary report and you move the mouse pointerover a summary field. Double–click to see the data that makes up that summary.With Hide (Drill–Down OK) enabled, viewers can access the data underlying thesummary information.

• Suppress (No Drill–Down)

You may not want to allow your viewers to drill down on the summary fieldsto see the information behind them, or to inadvertently drill down. ChoosingSuppress (No Drill–Down)still hides the section, but does not allow anyoneto see the underlying data. The magnifying glass still appears. If the userdouble–clicks when the magnifying glass appears, the system produces a newtab, but the details will not show. Only the summary field will be duplicated.

Hint: Drill–down capabilities are also available with charts. The samefunctionality works in summary reports, because they are both based onsummary fields.

Viewing the summary report in the Preview windowWhen you view a summary report in the Preview window, the cursor changes toa magnifying glass whenever it moves across a part of the report that represents asummary.

When you double–click with this magnifying glass, a new report window preview tabopens and the details behind that summary are displayed.

You can double–click as many summaries as you need, and each one opens its ownpreview tab. You can close any of these drill–down tabs at any time by viewing thattab, and then clicking the close tab button.

254 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 273: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating Summary Reports

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 optionsprevent 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

Hint: After you hide the Details section to create a summary report,you may want to format the report so that the column headings labelingdetailed information are displayed in the drill-down tab rather than inthe Preview tab. To do so:

• Move the Group Name field from the Group Header section intothe Group Footer section

• Move the column headings from the Page Header section intothe Group Header section.

• Hide the Group Header section.

2011 © 2011 SAP AG. All rights reserved. 255

SAP Class Week of February 13, 2012

Page 274: BOC310 Col96 Part(Crystal Reports)

Unit 6: Applying Section Formatting BOC310

256 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 275: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating Summary Reports

Exercise 19: Create a Summary Report

Exercise ObjectivesAfter completing this exercise, you will be able to:• Display only the summary information in a report

Business ExampleYou want to hide the details and only show the summary information for each groupin a report.

Task: Display Summary Information of Multiple GroupsModify the report to display the summary information of multiple groups. First, hidethe Details section so drill-down is not available. Then, change the Details sectionso that drill-down is available.

1. Open the report, Formatting sections.rpt.

2. Remove the section settings, New Page Before or New Page After so the reportwill show multiple groups on each page.

3. Change the option for the Details section to be suppressed and then hidden.These options determine whether or not the Details section is drillable.

2011 © 2011 SAP AG. All rights reserved. 257

SAP Class Week of February 13, 2012

Page 276: BOC310 Col96 Part(Crystal Reports)

Unit 6: Applying Section Formatting BOC310

Solution 19: Create a Summary ReportTask: Display Summary Information of Multiple GroupsModify the report to display the summary information of multiple groups. First, hidethe Details section so drill-down is not available. Then, change the Details sectionso that drill-down is available.

1. Open the report, Formatting sections.rpt.

a) Navigate to My Documents to find and open the report.

2. Remove the section settings, New Page Before or New Page After so the reportwill show multiple groups on each page.

a) Click Report -> Section Expert.

b) From the Section Expert dialog box, select the Paging tab.

c) From the list of available sections, select each of the Group Header andGroup Footer sections to remove any section paging options, includingassociated formulas, for New Page Before or New Page After.

d) Click OK.

3. Change the option for the Details section to be suppressed and then hidden.These options determine whether or not the Details section is drillable.

a) From the Section Expert dialog box, select the Common tab.

b) From the list of available sections, select Details.

c) Select the option to Suppress (No Drill-Down). Click OK.

When you preview the report, notice that you cannot drill down to theDetails section.

d) Click Report -> Section Expert.

e) From the list of available sections, select Details.

f) Deselect the option to Suppress (No Drill-Down)

g) Select the option to Hide (Drill-Down OK). Click OK.

When you preview the report, notice that you can drill down to the Detailssection.

h) Save the report as, Creating a summary report.rpt.

258 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 277: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating Summary Reports

Lesson Summary

You should now be able to:• Define a summary report• Create a summary report

2011 © 2011 SAP AG. All rights reserved. 259

SAP Class Week of February 13, 2012

Page 278: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

Unit SummaryYou should now be able to:• Define the Section Expert• Format sections• Define a summary report• Create a summary report

260 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 279: BOC310 Col96 Part(Crystal Reports)

BOC310 Test Your Knowledge

Test Your Knowledge

1. True or False? The New Page Before and the New Page After options are usuallyused with Group Header and Group Footer sections.Determine whether this statement is true or false.□ True□ False

2. Which option prevents page breaks from spreading data from a single recordover two pages?

3. If you want to lock the formatting and position of all report objects in a section,which option do you use in the Section Expert?

2011 © 2011 SAP AG. All rights reserved. 261

SAP Class Week of February 13, 2012

Page 280: BOC310 Col96 Part(Crystal Reports)

Test Your Knowledge BOC310

Answers

1. True or False? The New Page Before and the New Page After options are usuallyused with Group Header and Group Footer sections.

Answer: True

True. These options create a page break between groups.

2. Which option prevents page breaks from spreading data from a single recordover two pages?

Answer: Keep Together

3. If you want to lock the formatting and position of all report objects in a section,which option do you use in the Section Expert?

Answer: Read-only

262 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 281: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 282: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 283: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

263 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 284: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

264 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 285: BOC310 Col96 Part(Crystal Reports)

Unit 7Creating Basic Formulas

Unit OverviewThis unit provides you with the skills and knowledge of creating basic formulas. Ifyou want to display data that is a calculated value, you must create a formula field andplace that formula field on your report.

Unit ObjectivesAfter completing this unit, you will be able to:

• Describe a formula• Describe the components of a formula• Explain Crystal syntax• Describe SAP Crystal Reports data• Work with formulas in the Field Explorer• Define the methods to create formulas• Create a formula using the Formula Workshop• Create a formula using the Formula Editor• Create an If-Then-Else formula• Describe a Boolean formula• Create a Boolean formula• Describe a date calculation• Create a date calculation• Describe a numeric calculation• Create a numeric calculation• Describe a string manipulation formula• Create a string manipulation formula

2011 © 2011 SAP AG. All rights reserved. 265

SAP Class Week of February 13, 2012

Page 286: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Unit ContentsLesson: Defining a Formula ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267Lesson: Creating Formulas... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .276Lesson: Applying an If-Then-Else Formula... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .284

Exercise 20: Apply an If-Then-Else Formula ... . . . . . . . . . . . . . . . . . . . . . . . . . . . .287Lesson: Applying Boolean Formulas ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .291

Exercise 21: Apply a Boolean Formula... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .295Lesson: Applying Date Calculations... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .298

Exercise 22: Apply Date Calculations ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .301Lesson: Applying Numeric Calculations ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .305

Exercise 23: Apply Numeric Calculations ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .309Lesson: Applying String Manipulation... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .314

Exercise 24: Apply String Manipulation Formulas ... . . . . . . . . . . . . . . . . . . . . . .319Exercise 25: Faciliated Discussion: Creating Basic Formulas ... . . . . . . . .323

266 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 287: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Defining a Formula

Lesson: Defining a Formula

Lesson OverviewIn many cases, the data you want to appear on your report already exists in thedatabase. Sometimes, however, your report requires data that is derived bymanipulating data in an existing field in the database. In this case, you would use aformula to manipulate the data, and a formula field to contain the manipulated data.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Describe a formula• Describe the components of a formula• Explain Crystal syntax• Describe SAP Crystal Reports data• Work with formulas in the Field Explorer

Business ExampleAs well as database fields and text fields, you can add formula fields to the report.With formulas, you can manipulate the data to display as required on the report. Forexample, you can display an order amount with tax included by creating a formula.

Formulas

Figure 24: Formula Workshop

2011 © 2011 SAP AG. All rights reserved. 267

SAP Class Week of February 13, 2012

Page 288: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

A formula is used to manipulate data in your report. For example, a formula canperform a calculation or change the field’s formatting. You can think of a formulaas a small piece of computer programming code that processes and prints its resulton your report, just like a database field. It will print the result wherever you placethe 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 flexibleformulas.

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 FormulaFormulas 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 rulesare used to organize the components. You can use any of the components listed inyour formula.

268 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 289: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Defining a Formula

Figure 25: Components of a Formula

Hint: When you select a function or operator in the appropriate tree, or whenyou select a function or operator that is used in the body of your formula, youcan press F1 to see help specific to that function or operator.

Crystal syntaxYou write formulas according to a specific set of rules called syntax. The FormulaEditor checks the syntax and helps identify problems so you can fix them before youadd 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.

2011 © 2011 SAP AG. All rights reserved. 269

SAP Class Week of February 13, 2012

Page 290: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

When creating formulas, you have the option of using either Crystal syntax or Basicsyntax. 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 sameformula; however, you can use multiple formulas written in either syntaxwithin the same report.

If you are already familiar with Crystal syntax, you can continue to use it and benefitfrom the wide range of functions, operators, and control structures.

If you are familiar with Microsoft Visual Basic or other versions of Basic, thenworking in the Basic syntax in Crystal Reports may be more comfortable for you. Ingeneral, Basic syntax is modeled on Visual Basic except that it has specific extensionsto handle reporting.

Report processing is not slowed down by using Basic syntax. Reports using Basicsyntax formulas can run on any machine that Crystal Reports runs on. Also, usingBasic syntax formulas does not require distributing any additional files with yourreports.

Changing the syntax from Crystal syntax to Basic syntax or going from Basic syntaxto Crystal syntax changes the list of functions in the Functions window as well asthe list of operators in the Operators window. However, the available report fieldsremain 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 arrowto select either Crystal Syntax or Basic Syntax from the list.

Note: For the purposes of this lesson, the Crystal syntax will be usedthroughout the examples.

270 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 291: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Defining a Formula

Special characters used in Crystal syntax

Figure 26: Special Charecters

Data typesWhen writing formulas in Crystal Reports, it is important to know the data types ofthe fields you are working with:

• Boolean• String• Date• Time• DateTime• Number• Currency

All fields will be recognized as one of these data types. You must always be aware ofthe 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 memofield. Formulas can work with memo fields, and they can process stringsup to 64K in length.

2011 © 2011 SAP AG. All rights reserved. 271

SAP Class Week of February 13, 2012

Page 292: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Working with formulas in the Field Explorer

Figure 27: Formulas from 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 to254 characters.

272 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 293: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Defining a Formula

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.

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 shortcutmenu.

3. Type the new name for the formula, and then press Enter or click off the field.The formula has been renamed.

Deleting a formulasWhen a formula is created and added to a report, the Report Designer:

• Stores the specification for creating the formula, using the name you assignedto it.

• Places a working copy of that formula at the point you specify in the report. Aworking copy is any occurrence of the formula in the report.

In order to completely delete a formula, you must delete the specification and allworking copies of the formula. You cannot delete the specification without deleting allworking copies of the formula.

Even after the working copies of a formula have been deleted from the report, theformula specification remains unchanged. The specification is listed in the FieldExplorer dialog box.

It is available if you want to enter the formula in the report again. A formula cannot bedeleted from this list if it is referenced by another formula on the report.

2011 © 2011 SAP AG. All rights reserved. 273

SAP Class Week of February 13, 2012

Page 294: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

To delete a formula

1. In the Report Designer, right-click the formula field you want to delete andselect Delete from the shortcut menu.

To delete the formula specification

1. Choose View from the main menu and select Field Explorer. The Field Explorerdialog box appears.

2. In the Field Explorer, right-click the formula you want to delete and chooseDelete.Note: A dialog box appears if this formula is currently in use in a report. Ifyou delete this formula, you will delete all references of it in reports. ClickYes to delete.

274 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 295: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Defining a Formula

Lesson Summary

You should now be able to:• Describe a formula• Describe the components of a formula• Explain Crystal syntax• Describe SAP Crystal Reports data• Work with formulas in the Field Explorer

2011 © 2011 SAP AG. All rights reserved. 275

SAP Class Week of February 13, 2012

Page 296: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Lesson: Creating Formulas

Lesson OverviewCreating basic formulas to include in your report will enhance its usefulness. You cancreate formulas in Crystal Reports using either Crystal syntax or Basic syntax.

Note: This course uses Crystal syntax exclusively.

Lesson ObjectivesAfter completing this lesson, 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

Business ExampleYou need the report to include calculations that will enhance the usefulness of the data.

Formula creation methodsYou can create a formula using these methods:

• Formula Workshop

You can create most kinds of formulas in the Formula Workshop. Theworkshop consists of a toolbar, a tree that lists the types of formulas you cancreate or modify, and an area for defining the formula itself.

• Formula Editor

The Formula Editor is a component of the Formula Workshop. Use theFormula Editor to create and modify the content of formulas.

• Formula Expert

The Formula Expert is a component of the Formula Workshop. Use theFormula Expert to create and modify formulas based on custom functions.

Note: Only the Formula Workshop and the Formula Editor will bediscussed in this course.

276 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 297: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating Formulas

Adding comments to a formulaWhen you create a formula, always include comments in the formula itself. Formulacomments 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 theFormula Workshop. You can use comments to explain the purpose of a formulaor explain the steps involved in writing it. These explanations or descriptions ofyour formulas will help you or others if, after a period of time, the formula needs tobe modified.

Comments begin with two forward slashes (//) and are followed by the text of thecomment. Everything that follows the slashes on the same line is treated as beingpart of the comment.

Creating a formula in the Formula WorkshopThere are many ways to access the Formula Workshop. You see it when you add newformula fields, when you define selection formulas, when you work with customfunctions, and so on.

You can open the Formula Workshop by itself before you begin adding specifickinds of formulas.

Workshop Tree

The Workshop Tree contains folders for each type of formula you can create in CrystalReports. It also contains folders for custom functions and SQL Expressions. If theworkshop appears as the result of using a specific command (for example, you’veselected the Record command on the Selection Formulas submenu), the appropriatefolder in the tree is selected, and the appropriate version of the Formula Editorappears.

Expand any folder in the tree to see the formulas that already exist. New formulas canbe added, and existing formulas can be edited or deleted as needed.

Hint: TheWorkshop Tree can be docked. By default, it appears docked onthe left-hand side of the Formula Workshop, but you can manually dock it onthe right-hand side. In free-floating mode, the Workshop Tree can be draggedto any location in the workshop.

Formula Workshop buttons

2011 © 2011 SAP AG. All rights reserved. 277

SAP Class Week of February 13, 2012

Page 298: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

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 theWorkshop Tree,or working with an editor. Individual buttons are available or unavailable based on thetask you are undertaking. Each toolbar can be moved and docked as you require.

The buttons for theGeneral toolbar of the Formula Workshop perform the followingfunctions:

Save andClose:

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 type selected from the list. Also usedto create a new custom function or SQL Expression.

Hide/Showworkshoptree:

Shows or hides the Workshop Tree.

Togglepropertiesdisplay:

Toggles display between Custom Function Editor and CustomFunction Properties dialog box. Custom functions and formulas(where possible) are displayed in the selected mode until the buttonis clicked again.

Use Ex-pert/Editor:

Opens the Formula Expert. Use the Formula Expert to help youcreate a formula based on a custom function.Þ Note: This button is not available when creating a customfunction.

Help: Opens online Help for the Formula Workshop dialog box.

The buttons for theWorkshop Tree toolbar of the Formula Workshop performthe 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.

ExpandNode:

Expands or collapses the selected node in theWorkshop Tree. Alsoworks with multiple node selections.

278 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 299: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating Formulas

ShowFormattingFormulaNodes Only:

Shows or hides report object nodes in the Formatting Formulasfolder if the objects do not have formulas associated with them.

Add toRepository:

Opens the Add Custom Function to Repository dialog box so youcan select a repository to add the custom function to.

Add toReport:

Adds the selected repository custom function to the report.

The buttons for the Expressions Editor toolbar of the Formula Workshop performthe following functions:

Check: Tests the syntax of the formula or custom function and identifiessyntax errors if they are found.

Undo: Undoes the last action performed.

Redo: Redoes the last action.

Browse Data: When you select a field from the Report Fields window and clickthe Browse Data button, a dialog box appears with a list of thevalues for the selected field.View values for the selected field and select individual values toinsert into your formula.Þ Note: This button is not available for custom functions.

Find orReplace:

Searches the Formula Editor for a specified word, number, orformula string.

ToggleBookmark:

Inserts a bookmark at the beginning of a selected formula line.Click the button again to remove the bookmark.

NextBookmark:

Jumps to the next bookmark.

PreviousBookmark:

Jumps to the previous bookmark.

Clear AllBookmarks:

Deletes all bookmarks in the current formula.

Sort trees: Arranges all Report Fields, Functions, and Operators trees inalphabetical order.

2011 © 2011 SAP AG. All rights reserved. 279

SAP Class Week of February 13, 2012

Page 300: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Field tree: Hides or views the Report Fields tree.Þ Note: This button is not available for custom functions.

Functiontree:

Hides or views the Functions tree.

Operatortree:

Hides or views the Operators tree.

Find results: Hides or views the result set of a global formula search.

CrystalSyntax:

Allows you to select Crystal syntax or Basic syntax as yourformula syntax.

ExceptionsFor Nulls:

Allows you to select Exceptions For Nulls or Default Values ForNulls as a method for dealing with null values in your data.

Com-ment/Uncom-ment:

Comments out the highlighted selection of a formula. Commentedlines 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 withinCrystal Reports. This file can be accessed from the menu as well as the Helpicon on the toolbar in the Formula Editor. Within the online Help, you canselect the Index tab and enter the name of a function. The program returns anexplanation of the function you entered.

• If you need the search and replace functionality within the Formula Editor, youcan click the Find or Replace icon on the toolbar in the Formula Editor. Selectthe Edit Text search option to access the search and replace functionality.

• You can create new formulas quickly within the Formula Workshop by clickingthe New button on the Formula Workshop toolbar.

• You can switch between formulas by navigating through theWorkshop Tree onthe left-hand side of the Formula Workshop.

• You can change the default syntax type for Crystal Reports formulas whenyou select the formula language syntax from the list in the Reporting tab ofthe 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 anindividual basis in the Formula Workshop.

280 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 301: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating Formulas

To access the Formula Workshop

1. On the Report menu, click Formula Workshop. Alternately, you can click theFormula 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 formulayou want to create.

The appropriate editor or dialog box appears.

Creating a formula in the Formula EditorThe Formula Editor is a component of the Formula Workshop. Using the FormulaEditor, you combine fields, operators, and functions together to create a workingformula. The Formula Editor enables you to type the components of the formuladirectly.

Select the various functions, operators, group field values, and other formulas from theavailable lists. By double-clicking the item, Crystal Reports inserts it into the formulafor you. In the Formula Editor, you can customize your settings with dockable andresizable frame windows, bookmarks, drag and drop, and search and replace. TheFormula Editor has four main windows:

Window Description of contents

Report Fields Report fields contain all database fields accessible for your report.They also contain any formulas or groups already created for thereport.

Functions Functions are prebuilt procedures that return values. Theyperform calculations such as average, sum, count, sin, trim, anduppercase. Custom functions are also listed in this window.

Operators Operators are the “action verbs” you use in formulas. Theydescribe an operation or an action to take place between two ormore values. Examples: add, subtract, less than, and greater than.

Formula textwindow

Area where you create a formula.

Note: Use File → Options → Formula Editor tab to set the default text fontand font.

2011 © 2011 SAP AG. All rights reserved. 281

SAP Class Week of February 13, 2012

Page 302: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

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 thecomponent trees.

Note: Tip:

• Ctrl + Space brings up a list of available functions. If you havealready started typing, it brings up a list of keywords that arepossible matches for what you have already typed.

• A list of available fields automatically appears when you enter anopen brace bracket. Ctrl + Space brings up the list again if youpreviously 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 then position 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.

282 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 303: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating Formulas

Lesson Summary

You should now be able to:• Define the methods to create formulas• Create a formula using the Formula Workshop• Create a formula using the Formula Editor

2011 © 2011 SAP AG. All rights reserved. 283

SAP Class Week of February 13, 2012

Page 304: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Lesson: Applying an If-Then-Else Formula

Lesson OverviewThe If-Then-Else type formula is a conditional formula. That is, if a condition ismet, then a certain action will be taken. If the condition is not met, then a differentaction takes place.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Create an If-Then-Else formula

Business ExampleYou need to display report results based on whether or not specified conditions are met.

If-Then-ElseIf-Then-Else formulas can check for as many conditions as required in order for youto 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 formulaSuppose you want to display a rating beside each customer’s order figures in anorders report depending on the level achieved: high orders or low orders. You canaccomplish a task such as this by using an If-Then-Else formula.

If {Orders.Orders Amount}>40000#

Then

"high orders"

Else

284 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 305: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying an If-Then-Else Formula

"low orders"

Hint: The data type must be the same for the Then and Else parts of theformula (text, numeric, date). For example, if the Then part of the formulaprints a text string, the Else part of the formula must also print a text string.

2011 © 2011 SAP AG. All rights reserved. 285

SAP Class Week of February 13, 2012

Page 306: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

286 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 307: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying an If-Then-Else Formula

Exercise 20: Apply an If-Then-Else Formula

Exercise ObjectivesAfter completing this exercise, you will be able to:• Create a conditional formula

Business ExampleYou want to highlight data on the report based on whether or not specified conditionsare met.

Task: Create an If-Then-Else Formula

Figure 28: If-Then-Else Operator

You want to display either “Domestic” or “International” when specified conditionsare met. Display “Domestic” when the country value is USA. Display “International”when the country value is not USA.

1. Open the report, Applying a Boolean formula.rpt.

2. Create the Domestic or International formula to display “Domestic” beside theCountry values equal to USA and “International” for all others.

2011 © 2011 SAP AG. All rights reserved. 287

SAP Class Week of February 13, 2012

Page 308: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Solution 20: Apply an If-Then-Else FormulaTask: Create an If-Then-Else Formula

Figure 29: If-Then-Else Operator

You want to display either “Domestic” or “International” when specified conditionsare met. Display “Domestic” when the country value is USA. Display “International”when the country value is not USA.

1. Open the report, Applying a Boolean formula.rpt.

a) Navigate to My Documents to find and open the report.

Continued on next page

288 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 309: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying an If-Then-Else Formula

2. Create the Domestic or International formula to display “Domestic” beside theCountry values equal to USA and “International” for all others.

a) Click Report -> Formula Workshop.

b) From the Formula Workshop dialog box, select the icon for New. ClickFormula.

c) When prompted, type the formula name, Domestic orInternational. Click OK.

d) From the Formula Editor dialog box, write a conditional formula, that usesthe if x then y else z control structure and that reuses the Check for USAformula from the list of Formula Fields.

The formula should look similar to this:IF {@Check for USA} = YES then “Domestic” ELSE “International”

e) Click Save and Close.

f) From the Field Explorer, drag the Domestic or International formula to theDetails section.

g) Right-click one of the vertical text objects from the Page Header. SelectFormat Painter. Click the Domestic or International column heading toapply the same vertical orientation.

When you preview the report, “Domestic” or “International” appears in thedetails depending on whether or not the country is equal to USA.

h) Save the report as Applying an If-Then-Else formula.rpt.

2011 © 2011 SAP AG. All rights reserved. 289

SAP Class Week of February 13, 2012

Page 310: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Lesson Summary

You should now be able to:• Create an If-Then-Else formula

290 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 311: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Boolean Formulas

Lesson: Applying Boolean Formulas

Lesson OverviewBoolean formulas incorporate the operators: and, or and not. They are used to defineconditions of true or false.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Describe a Boolean formula• Create a Boolean formula

Business ExampleYou want to produce either one of two results based on whether the specifiedconditions are met.

Boolean formulasA Boolean formula always returns a value of True or False. The result of a Booleanformula can be displayed as:

• True or False• T or F• Yes or No• 1 or 0

You can change how a Boolean value displays in your report by right–clicking thevalue 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, todetermine whether an order amount matches a certain condition, you would write aformula like this:

{Orders.Order Amount} > 5000

2011 © 2011 SAP AG. All rights reserved. 291

SAP Class Week of February 13, 2012

Page 312: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Creating a Boolean formulaBoolean operators are used to create conditions that require a logical relationshipbetween two or more values. Conditions that use Boolean operators are calledBoolean 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 besatisfied (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 expressionsthat evaluate to a Boolean. The expression evaluates True only if both x and y aretrue. All other combinations result in a value of False.

Figure 30: AND Operator

Some examples include:

Figure 31: And Operator Examples

292 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 313: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Boolean Formulas

Or

The Or operator takes two expressions that evaluate to a Boolean. If either expressionevaluates True, the operator returns True. If both expressions evaluate False, theoperator returns False

Figure 32: OR Operator

Some examples include:

Figure 33: OR Operator examples

Not

The Not operator reverses the True or False value of x.

2011 © 2011 SAP AG. All rights reserved. 293

SAP Class Week of February 13, 2012

Page 314: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Figure 34: NOT Operator

• Not (Not(False)) = False• Not (Not(True)) = True

Some examples include:

Code Description

not (A > B and B > C) If A=5, B = 4, C = 3, the expression(A>B and B>C) is True. Both conditionstied together by the Boolean operatorAnd are True; thus, the entire statementhas a value of True. The Not operatorchanges the value of the expression toFalse.

not (A > B and B > C) If A=3, B = 4, C = 3, the expression(A>B and B>C) is False. One of the twoconditions tied together by the Booleanoperator And is False; thus, the entirestatement has a value of False. TheNot operator changes the value of theexpression to True.

294 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 315: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Boolean Formulas

Exercise 21: Apply a Boolean Formula

Exercise ObjectivesAfter completing this exercise, you will be able to:• Apply a Boolean formula to report data

Business ExampleYou need to evaluate the data in Country field to determine if it is equal to USA.Display the results of this evaluation on the report.

Task: Create a Boolean FormulaCreate a Boolean formula to evaluate the Country field data for values equal to USA.Show the results on the report.

1. Open the report, Basic Formulas-1.rpt.

2. Create a new formula named Check for USA, that evaluates the field data inCountry for values equal to USA.

2011 © 2011 SAP AG. All rights reserved. 295

SAP Class Week of February 13, 2012

Page 316: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Solution 21: Apply a Boolean FormulaTask: Create a Boolean FormulaCreate a Boolean formula to evaluate the Country field data for values equal to USA.Show the results on the report.

1. Open the report, Basic Formulas-1.rpt.

a) Navigate to My Documents to find and open the report.

b) Click File -> Page Setup, and then select Landscape to see the entire reportin a horizontal view. Click OK.

2. Create a new formula named Check for USA, that evaluates the field data inCountry for values equal to USA.

a) Click Report -> Formula Workshop.

b) From the Formula Workshop dialog box, select the icon for New. ClickFormula.

c) When prompted, type the formula name,Check for USA. Click OK.

d) From the Formula Editor dialog box, expand the Report Fields node.Double-click Country field.

e) Type the rest of the formula, = “USA”.

The formula should be similar to this: {Customer.Country} = “USA”

f) From the Field Explorer, drag the Check for USA formula to the Detailssection.

g) Right-click one of the vertical text objects from the Page Header. SelectFormat Painter. Click the Check for USA column heading to apply thesame vertical orientation.

h) Select the@Check for USA formula field in the Details section.

i) Click Format -> Format Field.

j) From the Format Editor, select the Boolean tab.

k) Select Yes or No as the Boolean text. Click OK.

When you preview the report, “Yes” or “No” appears in the detailsdepending on whether or not the country is equal to USA.

l) Save report as, Applying a Boolean formula.rpt.

296 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 317: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Boolean Formulas

Lesson Summary

You should now be able to:• Describe a Boolean formula• Create a Boolean formula

2011 © 2011 SAP AG. All rights reserved. 297

SAP Class Week of February 13, 2012

Page 318: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Lesson: Applying Date Calculations

Lesson OverviewA database field can contain a date value, which is recognized as date only, time onlyor date-time. When applying calculations based on date fields, you need to considerhow to value is recognized.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Describe a date calculation• Create a date calculation

Business ExampleApply date calculations when you want information based on date values. Forexample, if you want to know the number of days, then you'll need to calculatebetween two date values, such as Ship Date and Order Date.

Date calculationDate functions allow you to convert numbers to dates, which you then can format todisplay as appropriate, and to convert dates to numbers.

Creating a date calculationExamples 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, todisplay today’s date in your report, you would write this formula:

CurrentDate

Addition and subtraction

298 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 319: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Date Calculations

You can add days to date fields by adding a number. For example, if you know anorder should be shipped five days after the order was placed, you would find theexpected 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, ifyou want to find the number of days it took to ship an order, if the order date was fivedays 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 betweentwo date fields. For example, if you want to find the number of days it took to shipan order, you would use this formula:

{Orders.Ship Date} – {Orders.Order Date}

If the Orders.Ship Date was January 20 and the Orders.Order Date was January10, 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 the Year ( ), Month ( ), or Day ( ) function.For example, if you were looking for monthly trends in your ordering cycle, youcould use the Month ( ) function to extract the month portion of your order date fieldsusing this formula:

Month ({Orders.Order Date})

If the Orders.Order Date was January 10, then this formula would return 1.00.

Hint: Commas and decimal places are the default display for numbers inCrystal Reports.

2011 © 2011 SAP AG. All rights reserved. 299

SAP Class Week of February 13, 2012

Page 320: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

300 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 321: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Date Calculations

Exercise 22: Apply Date Calculations

Exercise ObjectivesAfter completing this exercise, you will be able to:• Create formulas that involve date calculations

Business ExampleYou want to analyze the report data based on date calculations.

Task: Create Date Calculation FormulasCalculate the number of days to process each order from the date it was ordered to thedate it was shipped. Calculate the month in which it was ordered. This can be usefulfor sorting or grouping. Calculate the number of days since the order was shipped.Show the results on the report.

1. Open the report, Applying an If-Then-Else formula.rpt.

2. Create a new formula named Order Process Time to display the number of daysto process each order the date it was ordered to the time it was shipped.

3. Create a new formula namedMonth Ordered to display the month in the formof a number. This formula is useful if you want to analyze trends of the busiestorder months over several years.

4. Create a new formula named Days Since Shipped to display the number of dayssince the order was shipped. The values returned by this formula will changebased on the current date on the actual computer being used.

5. Add the new formula fields to the report and format them.

6. Remove the Country group from the report.

2011 © 2011 SAP AG. All rights reserved. 301

SAP Class Week of February 13, 2012

Page 322: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Solution 22: Apply Date CalculationsTask: Create Date Calculation FormulasCalculate the number of days to process each order from the date it was ordered to thedate it was shipped. Calculate the month in which it was ordered. This can be usefulfor sorting or grouping. Calculate the number of days since the order was shipped.Show the results on the report.

1. Open the report, Applying an If-Then-Else formula.rpt.

a) Navigate to My Documents to find and open the report.

2. Create a new formula named Order Process Time to display the number of daysto process each order the date it was ordered to the time it was shipped.

a) Click Report -> Formula Workshop.

b) From the Formula Workshop dialog box, select the icon for New. ClickFormula.

c) When prompted, type the formula name, Order Process Time. ClickOK.

d) From the Formula Editor dialog box, expand the Report Fields node to findthe Ship Date and the Order Date fields. Write a formula the calculates thedifference between the values from these fields.

The formula should look similar to this:{Orders.Ship Date} - {Orders.Order Date}

e) Click Save. Remain in the Formula Workshop.

3. Create a new formula namedMonth Ordered to display the month in the formof a number. This formula is useful if you want to analyze trends of the busiestorder months over several years.

a) From the Formula Workshop, click the icon for New. Click Formula.

b) When prompted, type the formula name, Month Ordered. Click OK.

c) From the Formula Editor, use the month function to determine the numericmonth value (1 to 12) from the Order Date field.

The formula should look similar to this:month({Orders.Order Date})

d) Click Save. Remain in the Formula Workshop.

Continued on next page

302 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 323: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Date Calculations

4. Create a new formula named Days Since Shipped to display the number of dayssince the order was shipped. The values returned by this formula will changebased on the current date on the actual computer being used.

a) From the Formula Workshop, click the icon for New. Click Formula.

b) When prompted, type the formula name, Days Since Shipped. ClickOK.

c) From the Formula Editor, use the currentdate function to calculate thedifference from the Ship Date field.

The formula should look similar to this:currentdate - {Orders.Ship Date}

d) Click Save and Close.

5. Add the new formula fields to the report and format them.

a) Click View -> Field Explorer.

b) Expand the Formula Fields node to see the list of available formulas.

c) Hold the Shift key down and select multiple formulas: Order ProcessTime, Month Ordered, and Days Since Shipped. Drag all three formulafields to the Details section of the report.

d) Select one of the vertically aligned field headings from the Page Header.Click Format Painter. Click one of the new field headings. Repeat until allthe field headings are similarily vertically aligned.

e) Right-click the Order Process Time field and select Format Field.

f) From the Number tab, select a format that displays no decimals, -1123.Click OK. Repeat the same number format for Month Ordered and DaysSince Shipped.

6. Remove the Country group from the report.

a) Click Report -> Group Expert.

b) Select Country from the Group by list. Click the left arrow <. Click OK.

When you preview the report, the data is no longer grouped by Countryand the three new formula fields the results of the date calculations in theDetails section.

c) Save the report as Applying date calculations.rpt.

2011 © 2011 SAP AG. All rights reserved. 303

SAP Class Week of February 13, 2012

Page 324: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Lesson Summary

You should now be able to:• Describe a date calculation• Create a date calculation

304 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 325: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Numeric Calculations

Lesson: Applying Numeric Calculations

Lesson OverviewDatabase fields that contain numeric values can be calculated in formulas.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Describe a numeric calculation• Create a numeric calculation

Business ExampleYou want to use a numeric database field in a formula. For example, you want todisplay Last Year's Sales with a 10% projected increase. Display these as sum totalof sales per region.

Numeric calculationsFormulas using numeric fields perform mathematical computations on your data.

Creating a numeric calculationNumeric calculations can include:

• Arithmetic• Sum• Count• Distinct count

Arithmetic

Some arithmetic operators available for use in a formula are:

• addition (+)• subtraction (-)• multiplication (*)• division (/)

2011 © 2011 SAP AG. All rights reserved. 305

SAP Class Week of February 13, 2012

Page 326: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

For example, you can use the multiplication symbol to find the sales tax charged on aparticular order. If you wanted a sales tax amount of 7% on order amount field, theformula would look like this:

{Orders.Order Amount} * .07

Sum(number, field)

Summary fields are normally created using the Insert Summary dialog box. They thenappear in the Available Fields tree, and can be used in a formula by double–clickingthere. However, they do not need to be created in this way. You can create a summaryfield exclusively for use by your formula by appropriately filling in the arguments toone of the functions in the Summary functions section. However, any groups in thereport 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 forthe entire report.

• Sum ({Orders.Order Amount}, {Customer.Region}) Returns atotal of the order amounts for each region.

Hint: A number of options exist for summarizing your data. Sum( ), Count (), and Average ( ) are the most common. Refer to Summary Functions in theonline Help for more information.

Count

This function enables you to count the values that appear in your report (for a specifiedfield). Some examples include these scenarios:

• If a sales report includes all orders made and the amount of each order, you cancompute 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 thatthey come from), you can compute the number of orders per group (in thisexample, per region).

• If you break orders into date or Boolean groups (for example, orders groupedby the month in which they were placed), you can compute the number oforders per group based on a particular change in the date or Boolean field (inthis case, per month).

DistinctCount

This function enables you to get a distinct count of the values that appear in yourreport. A distinct count means that duplicate records are not used in the calculation.

306 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 327: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Numeric Calculations

Some examples include:

• If a sales report includes all orders made by customers, you can compute the totalcount of distinct customers in the report (as grand total distinct count), excludingany duplicate records. If a customer made more than one order, the duplicateoccurrences of that customer are ignored.

• If you break orders into groups (for example, orders grouped by the region thatthey come from), you can compute the count of distinct customers per group (inthis case, per region). Any customers that made more than one order and appearmore than once in a group are only counted once.

• If you break orders into date or Boolean groups (for example, orders groupedby the month in which they were placed), you can compute count of distinctcustomers in each group based on a particular change in the date or Booleanfields (in this case, the count of customers that placed orders each month). If acustomer placed more than one order within the month, duplicate instancesof that customer are ignored.

2011 © 2011 SAP AG. All rights reserved. 307

SAP Class Week of February 13, 2012

Page 328: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

308 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 329: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Numeric Calculations

Exercise 23: Apply Numeric Calculations

Exercise ObjectivesAfter completing this exercise, you will be able to:• Create numeric calculation formulas

Business ExampleYou need to calculate numeric values and display their results on a report.

Task: Create Numeric Calculation FormulasBased on the Order and Customer data, calculate the order tax, grand totals andsubtotals. Display the results on a report.

1. Open the report, Applying date calculations.rpt and group by Customer Name.

2. Create a new formula named Order Plus Tax to calculate the Order Amountplus a 7% tax for each order.

3. Create a new formula named GT Order Amount to calculate the grand total ofthe order amount for all orders.

4. Create a new formula named GT Order Amount Plus Tax to calculate thegrand total of the order amount for all orders plus tax.

5. Create a new formula named ST Order Amount to calculate the subtotal of theorder amount per customer.

6. Create a new formula named ST Order Amount Plus Tax to calculate thesubtotal of the order amount plus tax per customer.

7. Place the numeric calculation formulas on the report.

2011 © 2011 SAP AG. All rights reserved. 309

SAP Class Week of February 13, 2012

Page 330: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Solution 23: Apply Numeric CalculationsTask: Create Numeric Calculation FormulasBased on the Order and Customer data, calculate the order tax, grand totals andsubtotals. Display the results on a report.

1. Open the report, Applying date calculations.rpt and group by Customer Name.

a) Navigate to My Documents to find and open the report.

b) Click Report -> Group Expert.

c) From the list of available fields, double-click Customer Name. Click OK.

d) Align the bottoms of the field headings in the Page Header section andremove the Customer Name field from the Details section.

2. Create a new formula named Order Plus Tax to calculate the Order Amountplus a 7% tax for each order.

a) Click Report -> Formula Workshop.

b) From the Formula Workshop dialog box, click the icon for New. ClickFormula.

c) When prompted, type the formula name, Order Plus Tax. Click OK.

d) In the Formula Editor, select Order Amount to multiply by itself plus a7% tax.

The formula should look similar to this:{Orders.Order Amount} * 1.07

e) Click Save. Remain in the Formula Editor.

3. Create a new formula named GT Order Amount to calculate the grand total ofthe order amount for all orders.

a) In the Formula Editor, click the icon for New.

b) When prompted, type the formula name, GT Order Amount. Click OK.

c) Write a formula using the sum function applied to the Order Amount field.

The formula should look similar to this:sum({Orders.Order Amount})

d) Click Save. Remain in the Formula Editor.

Continued on next page

310 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 331: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Numeric Calculations

4. Create a new formula named GT Order Amount Plus Tax to calculate thegrand total of the order amount for all orders plus tax.

a) In the Formula Editor, click the icon for New.

b) When prompted, type the formula name, GT Order Amount PlusTax. Click OK.

c) Write a formula using the sum function applied to the Order Plus Taxformula.

The formula should look similar to this:sum({@Order Plus Tax})

d) Click Save. Remain in the Formula Editor.

5. Create a new formula named ST Order Amount to calculate the subtotal of theorder amount per customer.

a) In the Formula Editor, click the icon for New.

b) When prompted, type the formula name, ST Order Amount. Click OK.

c) Write a formula using the sum function applied to the Order Amount perCustomer Name.

The formula should look similar to this:sum({Orders.Order Amount},{Customer.CustomerName})

d) Click Save. Remain in the Formula Editor.

6. Create a new formula named ST Order Amount Plus Tax to calculate thesubtotal of the order amount plus tax per customer.

a) In the Formula Editor, click the icon for New.

b) When prompted, type the formula name, ST Order Amount PlusTax. Click OK.

c) Write a formula using the sum function applied to the Order Plus Taxformula per Customer.

The formula should look similar to this:sum({@Order Plus Tax},{Customer.Customer Name})

d) Click Save and Close. Exit the Formula Editor.

Continued on next page

2011 © 2011 SAP AG. All rights reserved. 311

SAP Class Week of February 13, 2012

Page 332: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

7. Place the numeric calculation formulas on the report.

a) From the Field Explorer, click and drag Order Plus Tax to the Detailssection.

b) Hold down the Shift key to select and drag ST Order Amount and STOrder Amount Plus Tax to the Group Footer section.

c) Hold down the Shift key to select and drag GT Order Amount and GTOrder Amount Plus Tax to the Report Footer section.

d) Format all the numeric calculation formulas to display with a dollar sign.

e) Create text labels for the subtotals and grand totals.

f) Save the report as Applying numeric calculations.rpt.

312 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 333: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying Numeric Calculations

Lesson Summary

You should now be able to:• Describe a numeric calculation• Create a numeric calculation

2011 © 2011 SAP AG. All rights reserved. 313

SAP Class Week of February 13, 2012

Page 334: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Lesson: Applying String Manipulation

Lesson OverviewString fields contain only text, characters, numbers or punctuation. String fieldscannot be added or subtracted from each other like number fields. However, you canstill manipulate these string fields in a formula.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Describe a string manipulation formula• Create a string manipulation formula

Business ExampleYou want to display string field data in uppercase. Or, perhaps, you want to extract thefirst letter of the string field data to create groups based on this first letter.

String manipulationOften, when creating a report, you want to embed the information from several stringfields together as one field. For example, a customer’s first and last name fields canbe combined to be one complete name field. In this way, formatting and movingthis single field around the report is easy.

By using formulas to manipulate the data contained in string fields you can get exactlywhat you need from your database.

Creating string manipulation formulasString manipulation formulas include:

• Subscript• Concatenation• Uppercase and Lowercase• Left• Mid• Right

314 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 335: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying String Manipulation

Subscript

When you want to use only a certain part of a string field, you can extract charactersfrom the string field using the subscript function.

For example, you may want to use only a first initial of a contact name instead of theentire name, or you may want to extract several characters from a string field. In thefirst example, you would create the formula:

• {Customer.Contact First Name} [1]Returns "A", where the Contact First Name isAnne-Marie.

When extracting several characters from a string field, you would create the formula:

• {Customer.Contact First Name} [1 to 4]Returns "Anne", where the Contact First Name is

Anne-Marie.

Concatenation

When you want to join two or more components together to form a singular continuousstring, 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 writethe 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 theUppercase ( ) or Lowercase ( ) functions. For example, to convert all customer namesto uppercase, you would write the formula:

Uppercase ({Customer.Customer Name})

This example would return EDWARD SMITH, where the customer name is EdwardSmith.

Left (str, length)

2011 © 2011 SAP AG. All rights reserved. 315

SAP Class Week of February 13, 2012

Page 336: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

The Left function consists of a text string (str) and length (length) and obtains a certainnumber of characters from the left end of a text string. For instance, you could use theLeft function to obtain just the area code from the values in a field containing phonenumbers. You would write the formula:

Left ({Customer.Phone}, 3)

This formula would retrieve the first three numbers from the phone number, which istypically the area code.

Mid (str, start) or Mid (str, start, length)

The Mid function returns a specified number of characters from a string. The secondargument is the character position where the part to be taken begins. The optional thirdargument is the length of the string you want to be taken out. If the third argument isnot 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 inthe middle of a text string. For example, you may need to extract the middle twocharacters 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 startingwith 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 sideof the specified string. Use this function to obtain just the right part of the string.For example, you

may need to obtain the last four digits of social security numbers stored in a field asan employee identifier.

Right({table.SSNUM}, 4)

This formula returns the last four digits of the social security number as a string.

Debrief: Creating basic formulasReview the formulas created in this lesson.

Name Syntax

Check for USA {Customer.Country}="USA"

Domestic or International if {Customer.Country}="USA" then"Domestic" else "International"

316 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 337: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying String Manipulation

Order Process Time {Order.Ship Date} - {Orders.OrderDate}

Month Ordered month({Orders.Order Date})

Days Since Shipped currentdate - {Orders.Ship Date}

Order Plus Tax {Orders.Order Amount} * 1.07

GT Order Amount Sum({Orders.Order Amount})

GT Order Amount Plus Tax Sum({@Order Plus Tax})

ST Order Amount Sum({Orders.Order Amount},{Customer.CustomerName})

ST Order Amount Plus Tax Sum({@Order Plus Tax},{Customer.CustomerName})

1st Customer Letter {Customer.CustomerName} [1]

Uppercase Customer Name UpperCase ({Customer.Customer-Name})

Display Subtotal "The subtotal for " & {Customer.Cus-tomerName} & " is "& {@ST OrderAmount} & "."

2011 © 2011 SAP AG. All rights reserved. 317

SAP Class Week of February 13, 2012

Page 338: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

318 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 339: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying String Manipulation

Exercise 24: Apply String ManipulationFormulas

Exercise ObjectivesAfter completing this exercise, you will be able to:• Create string manipulation formulas

Business ExampleYou need to manipulate string characters or text-based report data. By creatingformulas to manipulate text values, you can extract the first letter of the customernames or change the appearance to display as all capitalized.

Task 1: Group By Formula ResultsCreate a formula that extracts the first letter from the Customer Name data. Group thereport data based on this formula.

1. Open the report, Applying numeric calculations.rpt.

2. Create a new formula named 1st Customer Letter, which extracts the first letterfrom the Customer Name field.

3. Insert a group based on the 1st Customer Letter formula field.

Task 2: Display Customer Name Groups as All CapitalizedCreate a formula to display the Customer Name groups in uppercase.

1. Create a new formula named UppercaseCustomerName to capitalize theCustomer Name groups on the report.

Task 3: Create a Sentence FormulaCreate a formula to display a sentence that includes the customer name and thesubtotal of their order amount.

1. Create a new formula named DisplaySubtotal to display a sentence includingthe Customer Name field and the@ST Order Amount formula field.

2011 © 2011 SAP AG. All rights reserved. 319

SAP Class Week of February 13, 2012

Page 340: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Solution 24: Apply String ManipulationFormulasTask 1: Group By Formula ResultsCreate a formula that extracts the first letter from the Customer Name data. Group thereport data based on this formula.

1. Open the report, Applying numeric calculations.rpt.

a) Navigate to My Documents to open and find the report.

2. Create a new formula named 1st Customer Letter, which extracts the first letterfrom the Customer Name field.

a) Click Report -> Formula Workshop.

b) From the Formula Workshop, select the icon for New. Click Formula.

c) When prompted, type the formula name, 1st Customer Name. ClickOK.

d) In the Formula Editor, write a string formula to extract the first characterfrom the Customer Name.

The formula should look similar to this:{Customer.Customer Name}[1]

e) Click Save and Close.

3. Insert a group based on the 1st Customer Letter formula field.

a) Click Report -> Group Expert.

b) Select 1st Customer Letter from the list of available fields. Click the arrowto move this field to the Group By list.

c) Move up the 1st Customer Letter group to the highest group level.

All customers are grouped together based on the first letter of their name.

d) Click OK.

e) Format the 1st Customer Letter field in a different color so it stands outon the report.

Continued on next page

320 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 341: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying String Manipulation

Task 2: Display Customer Name Groups as All CapitalizedCreate a formula to display the Customer Name groups in uppercase.

1. Create a new formula named UppercaseCustomerName to capitalize theCustomer Name groups on the report.

a) Click Report -> Formula Workshop.

b) From the Formula Workshop, select the icon for New. Click Formula.

c) When prompted, type the formula name, UppercaseCustomerName.Click OK.

d) In the Formula Editor, apply the Uppercase string function to CustomerName.

The formula should look similar to this:uppercase({Customer.Customer Name})

e) Click Save and Close.

Task 3: Create a Sentence FormulaCreate a formula to display a sentence that includes the customer name and thesubtotal of their order amount.

1. Create a new formula named DisplaySubtotal to display a sentence includingthe Customer Name field and the@ST Order Amount formula field.

a) Click Report -> Formula Workshop.

b) From the Formula Workshop, select the icon for New. Click Formula.

c) When prompted, type the formula name, DisplaySubtotal. Click OK.

d) In the Formula Editor, write a sentence that includes Customer Name andST Order Amount fields.

The formula should look similar to this:"The subtotal for " &{Customer.Customer name]& "is " &{@ST Order Amount} & "."

e) Click Save and Close.

f) Replace the Subtotal text object and @ST Order Amount with the newsentence formula, @DisplaySubtotal.

g) Format the field to ensure the it can grow if necessary.

h) Save the report as Applying string manipulation.rpt.

2011 © 2011 SAP AG. All rights reserved. 321

SAP Class Week of February 13, 2012

Page 342: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

322 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 343: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying String Manipulation

Exercise 25: Faciliated Discussion: CreatingBasic Formulas

Exercise ObjectivesAfter completing this exercise, you will be able to:• Create basic formulas using Crystal syntax

Business ExampleYou need to perform calculations and manipulate data in a report.

Task: Review Basic FormulasReview the basic formulas created in this unit.

1. Review the formulas to ensure that you understand each one. Discuss questionsthat arise from these formulas.

Name Syntax

Check for USA {Customer.Country}=“USA”

Domestic or International if {Customer.Country}=“USA”then “Domestic” else“International”

Order Process Time {Order.Ship Date} - {Or-ders.Order Date}

Month Ordered month({Orders.Order Date})

Days Since Shipped currentdate - {Orders.ShipDate}

Order Plus Tax {Orders.Order Amount} * 1.07

GT Order Amount Sum({Orders.Order Amount})

GT Order Amount Plus Tax Sum({@Order Plus Tax})

ST Order Amount Sum({Orders.Order Amount},{Customer.CustomerName})

ST Order Amount Plus Tax Sum({@Order Plus Tax},{Customer.CustomerName})

Continued on next page

2011 © 2011 SAP AG. All rights reserved. 323

SAP Class Week of February 13, 2012

Page 344: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

1st Customer Letter {Customer.CustomerName}[1]

Uppercase Customer Name UpperCase({Customer.Customer-Name})

Display Subtotal “The subtotal for ” &{Customer.CustomerName} &“is ” & {@ST Order Amount} &“.”

324 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 345: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Applying String Manipulation

Solution 25: Faciliated Discussion: CreatingBasic FormulasTask: Review Basic FormulasReview the basic formulas created in this unit.

1. Review the formulas to ensure that you understand each one. Discuss questionsthat arise from these formulas.

Name Syntax

Check for USA {Customer.Country}=“USA”

Domestic or International if {Customer.Country}=“USA”then “Domestic” else“International”

Order Process Time {Order.Ship Date} - {Or-ders.Order Date}

Month Ordered month({Orders.Order Date})

Days Since Shipped currentdate - {Orders.ShipDate}

Order Plus Tax {Orders.Order Amount} * 1.07

GT Order Amount Sum({Orders.Order Amount})

GT Order Amount Plus Tax Sum({@Order Plus Tax})

ST Order Amount Sum({Orders.Order Amount},{Customer.CustomerName})

ST Order Amount Plus Tax Sum({@Order Plus Tax},{Customer.CustomerName})

1st Customer Letter {Customer.CustomerName}[1]

Uppercase Customer Name UpperCase({Customer.Customer-Name})

Display Subtotal “The subtotal for ” &{Customer.CustomerName} &“is ” & {@ST Order Amount} &“.”

2011 © 2011 SAP AG. All rights reserved. 325

SAP Class Week of February 13, 2012

Page 346: BOC310 Col96 Part(Crystal Reports)

Unit 7: Creating Basic Formulas BOC310

Lesson Summary

You should now be able to:• Describe a string manipulation formula• Create a string manipulation formula

326 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 347: BOC310 Col96 Part(Crystal Reports)

BOC310 Unit Summary

Unit SummaryYou should now be able to:• Describe a formula• Describe the components of a formula• Explain Crystal syntax• Describe SAP Crystal Reports data• Work with formulas in the Field Explorer• Define the methods to create formulas• Create a formula using the Formula Workshop• Create a formula using the Formula Editor• Create an If-Then-Else formula• Describe a Boolean formula• Create a Boolean formula• Describe a date calculation• Create a date calculation• Describe a numeric calculation• Create a numeric calculation• Describe a string manipulation formula• Create a string manipulation formula

2011 © 2011 SAP AG. All rights reserved. 327

SAP Class Week of February 13, 2012

Page 348: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

328 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 349: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 350: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 351: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

329 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 352: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

330 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 353: BOC310 Col96 Part(Crystal Reports)

Unit 8Applying Conditional Reporting

Unit OverviewThis unit explores how to apply conditional formatting in SAP Crystal Reports.Formatting in the report will only be applied when specified conditions are met..

Unit ObjectivesAfter completing this unit, you will be able to:

• Describe conditional formatting• Apply on or off properties• Apply attribute properties• Apply conditional formatting functions• Use the Highlighting Expert

Unit ContentsLesson: Formatting Data Conditionally .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .332

Exercise 26: Conditionally Format Data ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .337Lesson: Adding Key Performance Indicators .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .340

Exercise 27: Use the Highlighting Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .345

2011 © 2011 SAP AG. All rights reserved. 331

SAP Class Week of February 13, 2012

Page 354: BOC310 Col96 Part(Crystal Reports)

Unit 8: Applying Conditional Reporting BOC310

Lesson: Formatting Data Conditionally

Lesson OverviewConditionally formatting is formatting that applies only under certain conditionsthat you specify.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Describe conditional formatting• Apply on or off properties• Apply attribute properties• Apply conditional formatting functions

Business ExampleYou want records to stand out or to be formatted in a certain way when the data valuemeets a specific condition. For example, you can highlight the background color of arecord when the sales for the customer exceeds 10000.

Conditional formattingAbsolute formatting is formatting that applies under any condition and is used whenyou want the same result in all situations. When you need to format objects onlyin certain cases or apply the formatting differently for different situations, you useconditional formatting.

With absolute formatting, you follow a “select then apply” procedure. You select thefield and apply the formatting. For conditional formatting you follow the same generalprocedure, but you go a step further and set conditions that determine whether or notthe formatting will be applied. You specify those conditions using simple formulas.You can apply formatting based on a condition any time the conditional button appearsbeside an option. For example, conditional formatting can be used to display negativeamounts in red or to suppress a field only in a certain situation.

332 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 355: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Data Conditionally

Conditional formatting takes precedence over fixed settings. For example, you mayhave 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 blackin all other cases, this change overrides the original setting. The sales field will appearin red or black in the Preview window only.

Hint: Each time you see the formula button next to a property or attribute,that property or attribute can be conditionally formatted.

A conditional property tests to see which of two or more conditions was met andapplies the formatting appropriate to the condition. How you conditionally format anattribute differs between on or off properties and attribute properties.

Applying on or off propertiesAn on or off property uses a check box. When the check box is turned on, the propertyis always applied. When the check box is turned off, the property is never applied.The Drop Shadow property for a Border is an example of an on or off property. Whenyou conditionally apply an on or off property, the program applies the attribute whenthe 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 returnsyes for every value to which you want to apply the attribute. Whenever the result ofthe formula is no, the attribute is set to off.

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.

2011 © 2011 SAP AG. All rights reserved. 333

SAP Class Week of February 13, 2012

Page 356: BOC310 Col96 Part(Crystal Reports)

Unit 8: Applying Conditional Reporting BOC310

Applying attribute propertiesA 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 inblack. The program tests to see whether the value is under quota or not. If it is underquota, 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 selectionof attributes into the Functions list in the Formula Workshop. Double-click anyof these attributes to add them to a formula. For example, if you are settinghorizontal alignment conditionally, the Functions list contains attributes such asDefaultHorAligned, LeftAligned, and Justified. If you are setting borders conditionally,the Functions list contains attributes such as NoLine, SingleLine, and DashedLine.

Note: Always include the Else keyword in conditional formulas; otherwise,values that don’t meet the If condition may not retain their original format.To retain the original format of values that don’t meet your If condition, usethe DefaultAttribute function.

The program tests each record to see which of two or more conditions was met andapplies the formatting appropriate to the condition. All attribute property options arelisted within the Format Formula Editor for your use.

The ability to conditionally format fields and objects gives you more control over thepresentation of your data in the report.

Applying conditional formatting functionsConditional formatting functions are found at the top of the Functions tree in theFormula Workshop whenever appropriate. You can create more complex conditionalformatting formulas in the Formula Workshop using these built-in procedures orsubroutines.

334 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 357: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Data Conditionally

Two useful examples of conditional formatting functions are:

• CurrentFieldValue

This function is available only when entering field formatting formulas. The fieldcan be any type (string, number, Boolean, date, and so on). CurrentFieldValuereturns the current value of the field about to be printed and is especiallyuseful when conditionally formatting cross-tabs. For example, the formulaif CurrentFieldValue = 0 then Red can be used to format the font color in across-tab. This function depends on context (that is, if formatting a stringfield, then CurrentFieldValue is a string type; if formatting a date field, thenCurrentFieldValue is a date type, and so on).

• DefaultAttribute

This function is available when entering formatting formulas including sectionformatting formulas, text object formatting formulas, and so on. The valuereturned by DefaultAttribute depends on the value selected for the attributebeing formatted. For example, if you create a formatting formula for the fontcolor, and the font color combination box is set to blue, then DefaultAttribute isblue. If you create a formatting formula for a Boolean attribute such as Suppress,and if Suppress is checked, then the DefaultAttribute is true. If Suppress is notchecked, 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 theshortcut menu.

2. Click the appropriate tab and add a formula by clicking the conditionalformatting button next to the option you want to change.

Note: You can also use summary values as conditions. For example, youcould change the font color to red if the value is less than the averagefor 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.

2011 © 2011 SAP AG. All rights reserved. 335

SAP Class Week of February 13, 2012

Page 358: BOC310 Col96 Part(Crystal Reports)

Unit 8: Applying Conditional Reporting BOC310

336 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 359: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Data Conditionally

Exercise 26: Conditionally Format Data

Exercise ObjectivesAfter completing this exercise, you will be able to:• Apply conditional formatting to report data

Business ExampleYou want to highlight report data based on specified conditions. Format the field byapplying a conditional formula to the formatting option.

Task: Apply Conditional FormattingApply conditional formatting to Customer Name data. When the order amount is $100or less, display the customer name with a red background and white font. As well,when the order amount is greater than $5000, format the customer name with a dropshadow. Suppress duplicate customer names so only unique values are displayedon the report.

1. Open the report, Using the Highlighting Expert.rpt.

2. Suppress the duplicates of customer names.

3. Specify conditions to formatting options for Customer Name.

2011 © 2011 SAP AG. All rights reserved. 337

SAP Class Week of February 13, 2012

Page 360: BOC310 Col96 Part(Crystal Reports)

Unit 8: Applying Conditional Reporting BOC310

Solution 26: Conditionally Format DataTask: Apply Conditional FormattingApply conditional formatting to Customer Name data. When the order amount is $100or less, display the customer name with a red background and white font. As well,when the order amount is greater than $5000, format the customer name with a dropshadow. Suppress duplicate customer names so only unique values are displayedon the report.

1. Open the report, Using the Highlighting Expert.rpt.

a) Navigate to My Documents to find and open the report.

2. Suppress the duplicates of customer names.

a) Right-click the Customer Name field in the Details section. Click FormatField.

b) In the Format Editor, from the Common tab, select the Suppress ifDuplicated checkbox.

3. Specify conditions to formatting options for Customer Name.

a) From the Border tab, select x+2 beside the Drop Shadow option. Type thefollowing into the Format Formula Editor: {Orders.Order Amount}> 5000. Click Save and Close.

b) Select x+2 beside the Background option. Type the following into theFormat Formula Editor: if {Orders.Order Amount} < 100then crred else crnocolor. Click Save and Close.

c) From the Font tab, select x+2 beside the Color option. Type the followinginto the Format Formula Editor: if {Orders.Order Amount} <100 then crwhite else crblack. Click Save and Close.

d) Click OK to exit the Format Editor.

e) Save the report as Formatting data conditionally.rpt.

338 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 361: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Formatting Data Conditionally

Lesson Summary

You should now be able to:• Describe conditional formatting• Apply on or off properties• Apply attribute properties• Apply conditional formatting functions

2011 © 2011 SAP AG. All rights reserved. 339

SAP Class Week of February 13, 2012

Page 362: BOC310 Col96 Part(Crystal Reports)

Unit 8: Applying Conditional Reporting BOC310

Lesson: Adding Key Performance Indicators

Lesson OverviewIn SAP Crystal Reports, you can determine trends in data by highlighting recordswhen they meet specified conditions or fall within a range of parameters.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Use the Highlighting Expert

Business ExampleWhen you want to highlight certain information in a report in order to performan analysis of the data, you can quickly establish trends in the data by using theHighlighting Expert. For example, highlight the highs and lows of sales data based onmeeting a minimum and maximum amount.

Using the Highlighting ExpertThe Highlighting Expert enables you to apply conditional formatting to all types ofreport fields (Number, Currency, String, Boolean, Date, Time, and Date and Timefields). With the expert, you format the selected field either by specifying a conditionbased on that field’s value, or by specifying a condition based on the value of adifferent 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 fieldsWhen you need to conditionally format report fields, the Highlighting Expert isquicker and easier to use than the Formula Workshop. The Highlighting Expert is mostcommonly used to highlight field values that are in some way distinguished from othervalues in the report. You might, for example, highlight your key customers by printing

340 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 363: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding Key Performance Indicators

the {Customer.Last Year’s Sales} field with a red background whenever the sales valueexceeds $50,000. Alternatively, to draw attention to outstanding orders, you mightbold the {Product.Product Name} field whenever the {Orders.Shipped} value is False.

Hint: You can undo highlighting with the Undo button on the Standardtoolbar to cancel the formatting.

Think of the Highlighting Expert as an advanced formula editor that runs the followingequation: If condition is True, then apply these formatting specifications. For thispurpose, the dialog box is divided into two sections, the Item list section, whichdisplays the formula, and the Item editor, which enables you to set the formula. TheItem editor includes a Sample view to illustrate the formatting specifications applied.

Figure 35: Highlighting Expert

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 thePriority arrow buttons to specify the order of priority for each formula.

Hint: The changes in the formatting are seen in the Preview window only.

Setting highlighting prioritiesThe Priority buttons in the Item list area of the Highlighting Expert allow you to setpriorities for your formulas. This is useful when you have two or more formulas thatcould offer conflicting results in some situations.

2011 © 2011 SAP AG. All rights reserved. 341

SAP Class Week of February 13, 2012

Page 364: BOC310 Col96 Part(Crystal Reports)

Unit 8: Applying Conditional Reporting BOC310

For example, suppose that you highlight the Unit Price field on the report. Youassign to this field a highlighting formula that shows a yellow background whena unit price is greater than $100. Then, on this same report, you create anotherhighlighting 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 withyellow backgrounds when, in fact, those fields should have red backgrounds. Inother words, a unit price of $300 could receive either a red or a yellow background,depending on which formula has been assigned priority.

Figure 36: Apply Conditional Formatting

To use the Highlighting Expert

1. Right-click the field you want to format and select Highlighting Expert fromthe shortcut menu.

You can also start the expert by clicking the Highlighting button on the ExpertTools toolbar, or by clicking Highlighting Expert on the Format menu.

When opened, the expert is set to format the field that is currently selected onthe report.

2. In the Highlighting Expert, click New to create a new conditional formula withdefault settings.

3. In the Item editor area, click the Value of list drop-down arrow and select thefield that you want to base your condition on.

The field chosen here is the field upon which your condition is based; this fieldneed not be the field that is being formatted. To create a condition based onthe values of the field that is being formatted, select the desired field from the

342 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 365: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding Key Performance Indicators

list. To base your condition on a different report field, select it from the list ofavailable fields. The Value of list displays only those fields that you have addedto 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 formulacreated 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 boxturns 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 formattingchanges 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 tothe selected field.

Note: You can use the expert’s Remove button to delete highlightingformulas from the list.

8. Use the Priority arrows to specify the order in which you want Crystal Reportsto apply your conditions.

Note: A formula has priority over another formula when it is higherin the Items list area.

9. Click OK to return to your report.

2011 © 2011 SAP AG. All rights reserved. 343

SAP Class Week of February 13, 2012

Page 366: BOC310 Col96 Part(Crystal Reports)

Unit 8: Applying Conditional Reporting BOC310

344 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 367: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding Key Performance Indicators

Exercise 27: Use the Highlighting Expert

Exercise ObjectivesAfter completing this exercise, you will be able to:• Highlight report data to determine trends by using the Highlighting Expert

Business ExampleYou want report data to stand out when they meet specified conditions.

Task: Specify Highlighting ConditionsHighlight report data based on the following conditions:- When the order amount is $100 or less, display that data in red- When the order amount is $5000 and greater, display that data in blue- When the order amount is $10000 and greater, display that data in purple

1. Open the report, Conditional Reporting-1.rpt.

2. Format the Order Amount field using the Highlighting Expert.

2011 © 2011 SAP AG. All rights reserved. 345

SAP Class Week of February 13, 2012

Page 368: BOC310 Col96 Part(Crystal Reports)

Unit 8: Applying Conditional Reporting BOC310

Solution 27: Use the Highlighting ExpertTask: Specify Highlighting ConditionsHighlight report data based on the following conditions:- When the order amount is $100 or less, display that data in red- When the order amount is $5000 and greater, display that data in blue- When the order amount is $10000 and greater, display that data in purple

1. Open the report, Conditional Reporting-1.rpt.

a) Navigate to My Documents to find and open the report.

2. Format the Order Amount field using the Highlighting Expert.

a) Right-click Order Amount from the Details section. Click HighlightingExpert.

b) In the Highlighting Expert, click New.

c) In the Item Editor, specify: this field, is less than or equal to, $100 and thefont color is red. Click New to add another condition.

d) For the second condition, specify: this field, is greater than or equal to,$5000 and the font color is blue. Click New to add another condition.

e) For the third condition, specify: this field, is greater than or equal to$10000.

f) Move the third condition up to a higher priority. Click OK.

When you preview the report, you will see order amounts highlighted inred, blue or purple font.

g) Save the report as Using the Highlighting Expert.rpt.

346 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 369: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Adding Key Performance Indicators

Lesson Summary

You should now be able to:• Use the Highlighting Expert

2011 © 2011 SAP AG. All rights reserved. 347

SAP Class Week of February 13, 2012

Page 370: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

Unit SummaryYou should now be able to:• Describe conditional formatting• Apply on or off properties• Apply attribute properties• Apply conditional formatting functions• Use the Highlighting Expert

348 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 371: BOC310 Col96 Part(Crystal Reports)

BOC310 Test Your Knowledge

Test Your Knowledge

1. When you need to format objects only in certain cases orapply formatting differently for different situations, you use

.Fill in the blanks to complete the sentence.

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?

2011 © 2011 SAP AG. All rights reserved. 349

SAP Class Week of February 13, 2012

Page 372: BOC310 Col96 Part(Crystal Reports)

Test Your Knowledge BOC310

Answers

1. When you need to format objects only in certain cases or apply formattingdifferently for different situations, you use conditional formatting.

Answer: 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 ofthe Functions tree in the Formula Workshop) when you needed to create morecomplex conditional formatting than is available in the Highlighting Expert.

350 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 373: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 374: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 375: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

351 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 376: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

352 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 377: BOC310 Col96 Part(Crystal Reports)

Unit 9Representing Data Visually

Unit OverviewThis unit provides the skills needed to add sophisticated, colorful charts in SAPCrystal Reports.

Unit ObjectivesAfter 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• Drill down on a chart• Chart on detail or formula information• Edit a chart using the Chart Option menu items• Use the zooming features with bar and line charts• Auto-arrange a chart

Unit ContentsLesson: Creating a Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .354

Exercise 28: Chart on Summary Data ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .365Lesson: Charting on Details or Formula Information... . . . . . . . . . . . . . . . . . . . . . . . .369

Exercise 29: Chart on Detail Information... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .373Lesson: Customizing a Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .376

Exercise 30: Customize a Chart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .379

2011 © 2011 SAP AG. All rights reserved. 353

SAP Class Week of February 13, 2012

Page 378: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

Lesson: Creating a Chart

Lesson OverviewMany people find it easier to understand information if it is presented graphicallyin a chart format.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Choose a chart location and type• Create a chart using the Chart Expert• Chart on summary data• Drill down on a chart

Business ExampleYou want to display the sales data so that the viewer can see the results at a glance.A pie chart based on region and sums of last year's sales can easily show you whichregion has a bigger slice of the pie.

Choosing a chart location and typeCrystal 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. Eachchart 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 salesfor each state would make a good pie chart but a meaningless stacked bar chart, sinceonly one series of data exists. On the other hand, if you had a report that showedinventory levels of certain items for each quarter of the year, that information wouldmake an excellent stacked bar chart, but not work in a single pie chart.

354 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 379: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating a 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 includesdata 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 ExpertThe Chart Expert dialog box allows you to choose the type of chart to display, selectthe data on which the chart is based, apply conditional color highlighting, as well ascustomize the options 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 thatsome options are not for use with some types of chart.

The tabs in the Chart Expert are:

• 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 Toolstoolbar.

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 automaticallyor you may need to right-click the chart once it is placed and select the ChartExpert 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

2011 © 2011 SAP AG. All rights reserved. 355

SAP Class Week of February 13, 2012

Page 380: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

The first tab in the Chart Expert offers different predefined chart styles to choosefrom. To select a particular style, double-click the icon for the desired report.

Figure 37: Chart Expert

The most common chart types are:

• Bar

A side-by-side bar chart displays a series of vertical bars and is best suited forshowing data for several years over a period of time. A stacked bar chart alsodisplays data as a series of vertical bars and is best suited for representing threeseries of data with each series displayed as a different color stacked in a singlebar.

• Pie

A pie chart displays data as a pie, split and filled with color or patterns, and canonly 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 bestsuited 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 suitedfor showing data for a limited number of groups.

• Doughnut

356 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 381: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating a Chart

A doughnut chart is similar to a pie chart, displaying data as sections of a circleor 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 doughnutand the regions as colored sections of the doughnut. As with the pie chart, youhave 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 upside by side in a three-dimensional plane. The 3D riser chart shows the extremesin your report data. For example, the difference in sales between countries isvisually dynamic when presented in this chart.

• 3D Surface

A 3D surface chart presents a topographic view of multiple sets of data. If, forexample, you need a chart to show the number of sales by customer by countryin 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 datain a pool of information. The XY scatter chart enables you to consider a largerscope of data for the purpose of determining trends. For example, if you inputcustomer information, including sales, products, countries, months, and years,you would have a collective of plotted points that represents the pool of customerinformation. Viewing all of this data on an XY scatter chart would enable youto speculate why certain products were selling better than others or why certainregions were purchasing more than others.

• Radar

A radar chart positions group data, such as customers or countries, at theperimeter of the radar. The radar chart then places numeric values, increasingin value, from the center of the radar to the perimeter. In this way, you candetermine, at a glance, how specific group data relates to the whole of the groupdata.

• Bubble

A bubble chart displays data as a series of bubbles, where the size of the bubbleis proportional to the amount of data. A bubble chart is effective with the numberof products sold in a certain region; the larger the bubble, the greater number ofproducts sold in that region.

• Stock

A stock chart presents high and low values for data. With this ability, the stockchart is useful for monitoring financial or sales activities.

2011 © 2011 SAP AG. All rights reserved. 357

SAP Class Week of February 13, 2012

Page 382: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

• Numeric Axis

A numeric axis chart is a bar, line, or area chart that uses a numeric field or adate/time field as its “On change of” field (instead of a string field). Numericaxis charts provide a way of scaling your X-axis values, thus creating a truenumeric 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, thepercentage of sales for the entire inventory).

• Gantt

A Gantt chart is a horizontal bar chart often used to provide a graphicalillustration of a schedule. The horizontal axis shows a time span, while thevertical axis shows a series of tasks or events. Horizontal bars on the chartrepresent 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 canalso be useful in identifying potential problem areas in an organization’s salesprocesses. A funnel chart is similar to a stacked bar in that it represents 100% ofthe summary values for the groups included in the chart.

• Histogram

A histogram chart shows the frequency of occurrence of data elements in adata 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 intothat interval.

Hint: Not all data ranges work with all chart styles. A summary reportshowing the total sales for each region would make a good pie chart. Thesame report showing the same regions over several years would make a goodmultiple pie chart.

Exploring the Data tab

In the Data tab, you select the chart layout type you want to use.

358 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 383: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating a Chart

The charting layout types are:

• Advanced

Use the Advanced layout when you have multiple chart values or when you donot have any group or summary fields in the report.

The Advanced chart layout supports one or two condition fields; with thesecondition fields, you can create a 2D or 3D chart. Other specific functions withthe Advanced layout include:

– Values can be grouped in ascending, descending, or specified order, as wellas 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 isalready displaying all the data for that field.

• Group

With this option, you can create charts based on any group summary or subtotalvalues.

Note: In order to create a chart using the Group layout, you must have atleast 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 andenables you to present the data in the cross-tab graphically. A Cross-Tab chartuses the fields in the cross-tab for its condition and summary fields.

• OLAP

On-Line Analytical Processing (OLAP) is a business intelligence tool with theability to perform “slice and dice” operations for multi-dimensional viewing andmanipulation 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 chartand a group chart.

Once you have selected your chart type, the appropriate choices are presented withinthe Data tab. If you have running totals in your report, you can select running totalsfields to display them in the chart. Also, if you want to chart on all records so that the

2011 © 2011 SAP AG. All rights reserved. 359

SAP Class Week of February 13, 2012

Page 384: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

grand totals display, then select For all records from the drop-down list on the rightside of the dialog box and specify a chart placement of Once per report. You alsoselect 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 frequencyof data that divides axes on your chart.

By default, the data axis is not scaled automatically and always starts at zero. Ifyou 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 ordoughnut chart, you can choose to display the data in percentages or in amounts.

Figure 38: Chart Options

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 conditionsand the Item editor area is where you create the formula conditions.

Note: If your chart type is line, the chart must have data markers before youcan see conditional formatting. An area chart must have two On change ofvalues for conditional formatting to appear.

360 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 385: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating a Chart

Exploring the Text tab

The Text tab lets you specify different titles to be placed on your report explaining thevarious components. This tab always presents all options, even though some chartsmay not use them. For example, a pie chart would not have a group title or datatitle as available text options.

If you accidentally exit the Chart Expert, you can return at any time by right-clickingthe chart in your report and selecting Chart Expert from the shortcut menu.

The chart you see in the Design window is a placeholder that prints the actual chartinformation when you switch to the Preview window. Therefore, the chart in theDesign window will probably be different from what you were expecting based onyour 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 detailedinformation appears. For example, a chart that shows sales for different countrieswould 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 thesame.

Charting on summary dataCharting summary and subtotal information (Group layout) is the most commontype of chart. Before you can create a chart, you must have at least one group andone summary or subtotal in your report. A chart built on summary data offers thebenefit of drill-down capability, the ability to access multiple summaries with thedouble-click of a mouse button.

2011 © 2011 SAP AG. All rights reserved. 361

SAP Class Week of February 13, 2012

Page 386: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

To create a summary chart

1. On the Insert menu, click Chart.

The Chart Expertappears.

Hint: Another way to do this is to click the Insert Chart button on theInsert 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 automaticallyor you may need to right-click the chart once it is placed and select the ChartExpert from the shortcut menu.

3. On the Type tab, in the Chart type list, select a chart type and then click the chartsubtype 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 todisplay on your chart.

7. If the Axes and Options tabs appear, you can customize some of the chart’sproperties, such as 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, dependingon your selection in Step 6. You may have to refresh your report to previewthe finished chart.

When your chart is inserted, it may cover a portion of the report. Move andresize the chart so that it fits properly within the report.

Drilling down on a chartDrill-down is a process where the details behind summary information can be revealedby clicking the summary information contained in a report.

362 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 387: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating a Chart

A chart that is based upon summary fields is a candidate for drill-down. For each levelof grouping and summarizing that make up the chart, you can drill down into the datato 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 candrill down on individual groups through the chart legend. Double-click the cursor onthe 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 basedon those subtotals, double-clicking a pie slice opens a drill-down tab showing theindividual entries that make up that subtotal.

When viewing a chart in the Preview window, the cursor changes to a magnifyingglass. When you double-click with this magnifying glass, a new Preview tab opensup and the details behind that summary are displayed.

You can double-click as many summaries as you want as each one opens its owndrill-down tab.

Note: You cannot drill down on an advanced chart because the chart is alreadydisplaying all the data 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 todrill-down, double-click with the magnifying glass.

A new drill-down tab is created for the information you clicked.

Hint: Closing the drill-down tabs does not close the report. However,closing the Preview tab closes all drill-down tabs. If you made anychanges since the last save and you close the report, you will beprompted to save those changes.

2011 © 2011 SAP AG. All rights reserved. 363

SAP Class Week of February 13, 2012

Page 388: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

364 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 389: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating a Chart

Exercise 28: Chart on Summary Data

Exercise ObjectivesAfter completing this exercise, you will be able to:• Add a chart that is based on summarized data

Business ExampleYou want to add a visual element to the report to represent summarized data.

Task 1: Summarize DataSummarize the order amounts per order date group.

1. Create a new report that includes these fields in the Details section: CustomerName, Order ID, and the Order Amount.

2. Insert a group based on the order date and set the group options to be displayedby year.

3. Insert a group summary for Order Amount.

Task 2: Insert a ChartInsert a bar chart named Order Amounts Per Year in the Report Header using thegroup layout to compare order amount per year.

1. Insert a bar chart in the Report Header.

2011 © 2011 SAP AG. All rights reserved. 365

SAP Class Week of February 13, 2012

Page 390: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

Solution 28: Chart on Summary DataTask 1: Summarize DataSummarize the order amounts per order date group.

1. Create a new report that includes these fields in the Details section: CustomerName, Order ID, and the Order Amount.

a) Click File -> New.

b) From the Customer and Orders tables, select the fields.

2. Insert a group based on the order date and set the group options to be displayedby year.

a) Click Report -> Group Expert.

b) Select Order Date from the list of available fields. Click the arrow > tomove it to the Group by list.

c) Click Options.

d) From the Common tab, select the option for each year to specify for whichperiod the section will be printed. Click OK.

e) Click OK to exit the Group Expert.

3. Insert a group summary for Order Amount.

a) Click Insert -> Summary.

b) Select Order Amount as the field to summarize. Calculate based on sum.Select the summary location as the Order Date group. Click OK.

Continued on next page

366 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 391: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Creating a Chart

Task 2: Insert a ChartInsert a bar chart named Order Amounts Per Year in the Report Header using thegroup layout to compare order amount per year.

1. Insert a bar chart in the Report Header.

a) Click Insert -> Chart. Place it in the Report Header section.

b) Right-click the chart object. Select Chart Expert.

c) From the Type tab, select the side by side bar chart.

d) From the Data tab, select on change of Order Amount and show Sum ofOrder Amount.

e) From the Text tab, remove the auto-text selection for Title checkbox. TypeOrder Amounts Per Year.

f) Click OK.

g) Preview the report. Drill down on the chart to view the 2004 information.

h) Save the report as Charting on summary data.rpt.

2011 © 2011 SAP AG. All rights reserved. 367

SAP Class Week of February 13, 2012

Page 392: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

Lesson Summary

You should now be able to:• Choose a chart location and type• Create a chart using the Chart Expert• Chart on summary data• Drill down on a chart

368 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 393: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Charting on Details or Formula Information

Lesson: Charting on Details or Formula Information

Lesson OverviewIn SAP Crystal Reports, you can create a chart based on the details or formulainformation, not just the summary values.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Chart on detail or formula information

Business ExampleYou want to graphically display the records from the Details section. You can create achart for each group to show the details.

Charting on detail informationThe Advanced layout enables you to create a chart based on specific values (details orformula data). Charts are often based on a summary field in your report in which thevalues plotted in the chart depend on the values in the summary field. However, youcan also create a chart that does not have a summary field to chart on. Instead, thesetypes of charts use values that appear in 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 isplotted, it is plotted at the point representing the corresponding value. Forexample, a chart showing last year’s sales for your customers uses the CustomerName field as the condition. Each time the condition changes (that is, thecustomer name changes), a point is plotted. You also have the option of plottinga 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. Eachtime a point is plotted, it is plotted at the point representing the correspondingvalue.

2011 © 2011 SAP AG. All rights reserved. 369

SAP Class Week of February 13, 2012

Page 394: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

To chart on details information

1. On the Insert menu, click Chart.

Hint: Another way to do this is to click the Insert Chart button on theInsert 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 ChartExpert 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 fieldsin the box underneath the list.

The arrow buttons on the Chart Expert dialog box allow you to move fieldsfrom one list to the other. Single arrows move only the selected field; doublearrows move all fields at the same time.

9. Add the database fields you want to use as values to the Show value(s) list.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. 111. 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.

370 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 395: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Charting on Details or Formula Information

Your chart is placed in the location of the insertion frame. You may have torefresh 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.

2011 © 2011 SAP AG. All rights reserved. 371

SAP Class Week of February 13, 2012

Page 396: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

372 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 397: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Charting on Details or Formula Information

Exercise 29: Chart on Detail Information

Exercise ObjectivesAfter completing this exercise, you will be able to:• Insert a chart that is based on the details data by using the Chart Expert

Business ExampleInsert a chart that represents the detail information on the report.

Task: Insert a Pie ChartInsert a pie chart with 3D visual effects using the Advanced Layout to show last year'ssales per customer. Place the chart in the Report Header section. The legend shoulddisplay the percentage of last year's sales.

1. Open the report, Charting-1.rpt.

2. Insert a pie chart with 3D effect.

2011 © 2011 SAP AG. All rights reserved. 373

SAP Class Week of February 13, 2012

Page 398: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

Solution 29: Chart on Detail InformationTask: Insert a Pie ChartInsert a pie chart with 3D visual effects using the Advanced Layout to show last year'ssales per customer. Place the chart in the Report Header section. The legend shoulddisplay the percentage of last year's sales.

1. Open the report, Charting-1.rpt.

a) Navigate to My Documents to find and open the report.

2. Insert a pie chart with 3D effect.

a) Click Insert -> Chart. Place the chart object in the Report Header.

b) Right-click the chart object, select Chart Expert.

c) From the Type tab, select Pie Chart and the Use the depth effect checkbox.

d) From the Data tab, select on change of Customer Name to show the valuesof Last Year's Sales.

e) From the Options tab, select to show the legend with the placement to theleft and the layout as percentage.

f) Click OK to exit the Chart Expert.

g) Preview the report. Expand the chart size.

h) Save the report as Charting on detail information.rpt.

374 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 399: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Charting on Details or Formula Information

Lesson Summary

You should now be able to:• Chart on detail or formula information

2011 © 2011 SAP AG. All rights reserved. 375

SAP Class Week of February 13, 2012

Page 400: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

Lesson: Customizing a Chart

Lesson OverviewIn SAP Crystal Reports, you can customize a chart with numerous options.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Edit a chart using the Chart Option menu items• Use the zooming features with bar and line charts• Auto-arrange a chart

Business ExampleYou have inserted a chart into the Report Header section and now you want tocustomize the chart.

Editing charts in the Chart Options dialog boxThe Chart Options dialog box contains many advanced formatting options. To openthe Chart Options dialog box, right-click any chart and select Chart Options. Each tabin 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, theAppearance tab allows you to change the overlap, gap width, depth, and direction ofthe boxes. After right clicking a pie chart and selecting Chart Options, the Appearancetab 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 approximationof how your edits will affect the chart.

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 thechart.

376 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 401: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Customizing a Chart

Depending on the chart type, the appearance tab offers different data elements. Forexample, you can change the degree of tilt of a pie chart, change the style of line in aline 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.

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 thedata fields used to build the pie name.

You can also specify the location and format of the values and labels you’ve chosento display.

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 forthe 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.

You can modify the gridlines for Group and Data axes. This tab may not be availablefor all chart types.

Exploring the Axes tab

On this tab, you can conceal or reveal the axis labels.

You can also toggle between time, ordinal, and numeric scales.

Using the zooming featuresOn the Preview tab, you can find commands for zooming bar charts and line chartswithin your report. You have the ability to zoom in and out on these chart types atany time, with each time being referred to as instance specific. If you decide to savethe instance of the chart that has been zoomed in or out, you must save the data withthe report.

2011 © 2011 SAP AG. All rights reserved. 377

SAP Class Week of February 13, 2012

Page 402: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

To zoom in and out on a bar or line chart

1. On the Preview tab, right-click the bar or line chart to bring up the shortcut menu.2. On the shortcut menu, click Zoom In.3. Drag the Zoom In cursor around a section of the chart to enclose it within the

tracking rectangle. The chart zooms in to the section you selected.4. Repeat the previous step to zoom in further.

Note: To see adjacent areas on a zoomed-in chart view (neighboringbars in a bar chart, for example), use the Pan option on the shortcutmenu. Pull the Pan cursor to the left or right to move in that direction.

5. To zoom out on a chart, right-click the chart to bring up the shortcut menu.6. On the shortcut menu, click Zoom Out, and then click the chart.

The chart zooms out one level of magnification.

7. Click the chart again to zoom out further.

Auto-arrange a chartIf you move or resize chart objects on the Preview tab, select the auto-arrange chartfeature to reset the chart.

To auto-arrange a chart

1. On the Preview tab, right-click the chart to bring up the shortcut menu.2. On the shortcut menu, click Auto-Arrange Chart.

Crystal Reports resets the chart to its original size and position.

378 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 403: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Customizing a Chart

Exercise 30: Customize a Chart

Exercise ObjectivesAfter completing this exercise, you will be able to:• Modify an existing chart by using Chart Options

Business ExampleYou need to format a chart to improve its appearance on the report.

Task: Format the ChartUsing Chart Options, remove the border around the legend, expand the pie depth to75, display last year's sales values a percentage around the pie and show the slices asseparated by 20%.

1. Open the report, Charting on detail information.rpt.

2. Format the chart options.

3. Increase the pie depth to 75.

4. Separate the pie slices from each other by 20%.

5. Remove the border around the legend.

6. Display Last Year's Sales as percentages around the pie.

2011 © 2011 SAP AG. All rights reserved. 379

SAP Class Week of February 13, 2012

Page 404: BOC310 Col96 Part(Crystal Reports)

Unit 9: Representing Data Visually BOC310

Solution 30: Customize a ChartTask: Format the ChartUsing Chart Options, remove the border around the legend, expand the pie depth to75, display last year's sales values a percentage around the pie and show the slices asseparated by 20%.

1. Open the report, Charting on detail information.rpt.

a) Navigate to My Documents to find and open the report.

2. Format the chart options.

a) Right-click the chart object. Select Chart Options.

3. Increase the pie depth to 75.

a) From the Appearance tab, type 75 for Depth.

4. Separate the pie slices from each other by 20%.

a) From the Appearance tab, type 20 for Explode.

5. Remove the border around the legend.

a) From the Legend tab, select No Frame as the Box Style.

6. Display Last Year's Sales as percentages around the pie.

a) From the Data Labels tab, select the Show Values checkbox with locationas Outside Pie.

b) Select the As percentage checkbox.

c) Select the Show Labels checkbox with location as Outside Pie.

d) Click OK to exit the Chart Options.

e) Save the report as Customizing a chart.rpt.

380 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 405: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Customizing a Chart

Lesson Summary

You should now be able to:• Edit a chart using the Chart Option menu items• Use the zooming features with bar and line charts• Auto-arrange a chart

2011 © 2011 SAP AG. All rights reserved. 381

SAP Class Week of February 13, 2012

Page 406: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

Unit SummaryYou should now be able to:• Choose a chart location and type• Create a chart using the Chart Expert• Chart on summary data• Drill down on a chart• Chart on detail or formula information• Edit a chart using the Chart Option menu items• Use the zooming features with bar and line charts• Auto-arrange a chart

382 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 407: BOC310 Col96 Part(Crystal Reports)

BOC310 Test Your Knowledge

Test Your Knowledge

1. What functionality would you use when you need to see the details behindsummary information in a bar chart?

2. What functionality would you use when you want to create a chart based ondetail information?

3. What functionality would you use when you want to set the appearance, titles,data lables, or legend of the chart?

2011 © 2011 SAP AG. All rights reserved. 383

SAP Class Week of February 13, 2012

Page 408: BOC310 Col96 Part(Crystal Reports)

Test Your Knowledge BOC310

Answers

1. What functionality would you use when you need to see the details behindsummary information in a bar chart?

Answer: You would use drill-down when you need to see the details behindsummary information in a bar chart.

2. What functionality would you use when you want to create a chart based ondetail information?

Answer: You would use a condition (when to plot the point) and a value (what isplotted as a point) when you want to create a chart based on detail information.

3. What functionality would you use when you want to set the appearance, titles,data lables, or legend of the chart?

Answer: You would use the Chart Options dialog box when you want to set theappearance, titles, data labels, or legend of the chart.

384 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 409: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 410: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 411: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

385 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 412: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

386 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 413: BOC310 Col96 Part(Crystal Reports)

Unit 10Distributing a Report

Unit OverviewThis unit explores the options for sharing and distributing an SAP Crystal report toother people in the organization. You will explore how to export a report into a morecommon file type and how to save a report to a web-based report management system.

Unit ObjectivesAfter completing this unit, you will be able to:

• Define exporting• Define exporting formats• Define exporting destinations• Define exporting to application formats• Save an export option• Export a report• Define viewing requirements in SAP BusinessObjects Business Intelligence

platform• Save a report to SAP BusinessObjects Business Intelligence platform• View a report in SAP BusinessObjects Business Intelligence platform

Unit ContentsLesson: Exporting a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .388

Exercise 31: Export a Report to Microsoft Excel . . . . . . . . . . . . . . . . . . . . . . . . . . .393Exercise 32: Export a Report to Microsoft Word ... . . . . . . . . . . . . . . . . . . . . . . . .395

Lesson: Saving to SAP BusinessObjects Business Intelligence Platform...398Exercise 33: Save a Report to SAP BusinessObjects Business IntelligencePlatform ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .405

2011 © 2011 SAP AG. All rights reserved. 387

SAP Class Week of February 13, 2012

Page 414: BOC310 Col96 Part(Crystal Reports)

Unit 10: Distributing a Report BOC310

Lesson: Exporting a Report

Lesson OverviewFinished reports can be exported to a number of popular spreadsheet and documentformats, as well as to HTML, ODBC, and common data interchange formats. Thismakes the distribution of information easier.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Define exporting• Define exporting formats• Define exporting destinations• Define exporting to application formats• Save an export option• Export a report

Business ExampleExport the report when want to use the report data to project trends in a spreadsheetpackage or enhance the presentation of data in a desktop publishing package.

Exporting reportsCrystal 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 thatyou placed between lines are moved to the closest line in the output. To alleviatethe formatting problems this behavior could cause, it is recommended that you useguidelines when designing your reports.

The exporting process requires you to specify a format and a destination. The formatdetermines the file type, and the destination determines where the file is located.

388 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 415: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Exporting a Report

Exporting formatsCrystal 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

In addition to the standard export format types installed on your machine you may findadditional export format types are available to you. These format types are determinedby 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, theprogram attempts to preserve as much formatting as the export format allows.

Note: The XML exporting functionality supports the use of transforms. Youcan export to XML and then use an industry-specific transform to present thedata in an industry-specific format. For example, you would use the JRDCtransform if you worked in the justice/law enforcement area.

2011 © 2011 SAP AG. All rights reserved. 389

SAP Class Week of February 13, 2012

Page 416: BOC310 Col96 Part(Crystal Reports)

Unit 10: Distributing a Report BOC310

Exporting destinationsThe destination determines the export location of your report. Crystal Reports enablesyou 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

Figure 39: Export Reports

1. With your report open, and saved if you have made changes, select the Exportbutton 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.

For example, if you selected mail as the destination, you will be prompted toenter the destination names, subject, and message.

Exporting a report to application formatsThe export formats supported by Crystal Reports can be broadly categorized in twogroups: Page-based formats and record-based formats.

390 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 417: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Exporting a Report

Page-based formats tend to produce a more exact output. The emphasis of theseformats is layout representation and formatting. Formatting refers to attributes such asfont style, text color, text alignment, background color, and so on. Layout refers toobject position, object size, and the relationship between these attributes and otherobjects. Depending on the format you choose, it may not be possible for the programto 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 andformatting. However, in some formats—such as Microsoft Excel - Data only—youwill notice that some formatting is exported. Some of the record-based formats areonly data-exchange formats.

Exporting a report to Microsoft Excel

Microsoft Excel format is a page-based format. This format converts your reportcontents into Excel cells on a page-by-page basis. Contents from multiple pages areexported to the same Excel worksheet. If a worksheet becomes full and there is moredata to export, the export program creates multiple worksheets to accommodate thedata. If a report object covers more than one cell, the export program merges cells torepresent 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 isnot exported. This export format retains most of the formatting, but it does not exportline and box objects from your report.

Microsoft Excel - Data only, as the name suggests, is a record-based format thatconcentrates on data. Even so, this format does export most of the formatting, too.Unlike Microsoft Excel format, Microsoft Excel - Data only format does not mergecells—each object is added to only one cell. This format can also export certain kindsof summaries in Crystal Reports as Excel functions. The summaries that are supportedare 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 TextFormat) file. The exported file contains text and drawing objects to represent reportobjects. Individual objects are placed in text frames. This format is intended for usein applications such as fill-out forms where the space for entering text is reserved asempty text objects. Almost all of the formatting is retained in this export format. Textobjects cannot, however, be placed outside the left edge of the page. Therefore, if youhave text objects in your report that are placed before the left edge of the printablearea, they will be pushed right. (This is most noticeable in reports with wide pages.)

The Microsoft Word - Editable (RTF) format is different from Microsoft Word (RTF)format; it is a page-based format, but not all of the layout and formatting are preservedin the output. This format converts all of the report object contents to text lines. Unlike

2011 © 2011 SAP AG. All rights reserved. 391

SAP Class Week of February 13, 2012

Page 418: BOC310 Col96 Part(Crystal Reports)

Unit 10: Distributing a Report BOC310

Microsoft Word (RTF) format, this format does not use text frames. Text formatting isretained, but attributes such as background color, fill pattern, and so on may not beretained. All images in your report are inlined with the textual content and, therefore,the images automatically shift to accommodate text when the document is edited inMicrosoft Word. This format does not export line and box objects from your report.

The Microsoft Word - Editable (RTF) format has an option to insert page breaks at theend of each report page. This option may not correspond to the page breaks created byMicrosoft Word; the option is used mainly to separate your report-page contents.

Saving an export option

You can save an export option for a report that will be exported to various formats.These export options are then saved in the report and used as the default export optionswhen viewing or scheduling a report in BusinessObjects Enterprise.

Figure 40: Save to SAP

To save report export options

1. Click File Export Report Export Options.

The Set Default Export Options dialog box appears.

2. Select the export format.3. Click OK.

392 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 419: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Exporting a Report

Exercise 31: Export a Report to MicrosoftExcel

Exercise ObjectivesAfter completing this exercise, you will be able to:• Export a report to Microsoft Excel and Excel (Data Only) to compare the

differences between the two exporting destinations

Business ExampleYou want to share the report data as a Microsoft Excel file.

Task: Export to ExcelExport the report Microsoft Excel (2007) and to Excel (Data Only)..

1. Open the report, Exporting Report-1.rpt.

2. Export the report to Microsoft Excel. Ensure that there are page breaks and pageheaders for each page. Convert the order date to be displayed as a string.

3. Export the same report again. This time select the Microsoft Excel (Data Only)format. Ensure that the Xtreme logo is also exported.

2011 © 2011 SAP AG. All rights reserved. 393

SAP Class Week of February 13, 2012

Page 420: BOC310 Col96 Part(Crystal Reports)

Unit 10: Distributing a Report BOC310

Solution 31: Export a Report to MicrosoftExcelTask: Export to ExcelExport the report Microsoft Excel (2007) and to Excel (Data Only)..

1. Open the report, Exporting Report-1.rpt.

a) Navigate to My Documents to find and open the report.

2. Export the report to Microsoft Excel. Ensure that there are page breaks and pageheaders for each page. Convert the order date to be displayed as a string.

a) Click File -> Export -> Export Report.

b) Select Microsoft Excel (2007) as the Format. Click OK.

c) In Excel Format Options, specify on each page for Export page headersand footers.

d) Select the Create page breaks for each page checkbox.

e) Select the Convert date values to strings checkbox. Click OK.

f) Save the output as Exporting to Excel.xls. Open this file to viewthe exported results.

3. Export the same report again. This time select the Microsoft Excel (Data Only)format. Ensure that the Xtreme logo is also exported.

a) Click File -> Export -> Export Report. Click OK.

b) In Excel Format Options, select Custom: Data is exported according toselected options.

c) Click Options.

d) Select the Export Images checkbox.

e) Save the output as Exporting to Excel Data only.xls. Openthis file to view the exported results.

394 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 421: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Exporting a Report

Exercise 32: Export a Report to MicrosoftWord

Exercise ObjectivesAfter completing this exercise, you will be able to:• Export a report to Rich Text Format (RTF) and Microsoft Word (Editable)

formats

Business ExampleYou want to export and save a Crystal report as an RTF or Word file.

Task: Export to RTF and WordExport a Crystal report to RTF and Word..

1. Open the report, Exporting a Report-1.rpt.

2. Export the report to an RTF file.

3. Export the report again. This time select Microsoft Word - Editable. Insert pagebreaks after each report page and save the output as a DOC file.

2011 © 2011 SAP AG. All rights reserved. 395

SAP Class Week of February 13, 2012

Page 422: BOC310 Col96 Part(Crystal Reports)

Unit 10: Distributing a Report BOC310

Solution 32: Export a Report to MicrosoftWordTask: Export to RTF and WordExport a Crystal report to RTF and Word..

1. Open the report, Exporting a Report-1.rpt.

a) Navigate to My Documents to find and open the report.

2. Export the report to an RTF file.

a) Click File -> Export -> Export Report.

b) Select Rich Text Format (RTF) as the format. Click OK.

c) Accept the default export options. Click OK.

d) Save the report as Exporting to RTF.rtf. Open this file to view it.

3. Export the report again. This time select Microsoft Word - Editable. Insert pagebreaks after each report page and save the output as a DOC file.

a) Click File -> Export -> Export Report.

b) Select Microsoft Word - Editable as the format. Click OK.

c) As an export option, select the Insert page break after each report pagecheckbox. Click OK.

d) Save the report as Exporting to Word - Editable.doc. Openthis file to view it.

396 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 423: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Exporting a Report

Lesson Summary

You should now be able to:• Define exporting• Define exporting formats• Define exporting destinations• Define exporting to application formats• Save an export option• Export a report

2011 © 2011 SAP AG. All rights reserved. 397

SAP Class Week of February 13, 2012

Page 424: BOC310 Col96 Part(Crystal Reports)

Unit 10: Distributing a Report BOC310

Lesson: Saving to SAP BusinessObjects BusinessIntelligence Platform

Lesson OverviewYou can organize and distribute a report by saving it to SAP BusinessObjects BusinessIntelligence platform.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Define viewing requirements in SAP BusinessObjects Business Intelligenceplatform

• Save a report to SAP BusinessObjects Business Intelligence platform• View a report in SAP BusinessObjects Business Intelligence platform

Business ExampleWhen users need real-time reporting of live data over the web, save the report to SAPBusinessObjects Business Intelligence platform.

Viewing requirements in SAP BusinessObjects BusinessIntelligence platformWhen 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, displaysummarized information, so each user can navigate the report quickly and thendrill down to access additional data. In this way, web traffic and response timesare minimized, because only the data requested by the user is transferred from thedatabase server.

398 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 425: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saving to SAP BusinessObjects Business Intelligence Platform

These are only a few of the benefits of designing user-driven reports:

• Report users gain interactive control over the type and quantity of informationthey view over the web.

• Data transfer and network traffic decrease, because only the informationrequested by users is returned from the database server.

• When users need real-time reporting of live data over the web, user-orientedreports respond quickly and communicate efficiently with the database server.

• Reports become more useful, because each user customizes the report’scontents, thereby creating a reporting solution specific to his or her particulardecision-making problem.

Some of the methods you can use to design optimized reports for viewing in SAPBusinessObjects Business Intelligence Platform 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 ofCrystal Reports is to save them in the latest Crystal Reports format. It is recommendedthat 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 Savefrom the File menu. The older version of the report will be replaced with the newerversion 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 thenewer version report.

Choosing between live and saved data

When reporting over the web, the choice to use live or saved data is one of the mostimportant decisions you’ll make. Whichever choice you make, Crystal Reportsdisplays the first page as quickly as possible, so you can see your report while the restof the data is being processed.

Live data

2011 © 2011 SAP AG. All rights reserved. 399

SAP Class Week of February 13, 2012

Page 426: BOC310 Col96 Part(Crystal Reports)

Unit 10: Distributing a Report BOC310

Live reporting gives users real-time access to live data, straight from the databaseserver. Use live data to keep users up-to-date on constantly changing data, so they canaccess information that’s accurate to the second. For instance, if the managers of alarge 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 whetheror not you want all of your users accessing the database server on a continual basis. Ifthe data isn’t rapidly or constantly changing, then all those requests to the databasedo little more than increase network traffic and consume server resources. In suchcases, 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 oncolumns or charts, they don’t access the database server directly; instead, they accessthe saved data. Consequently, reports with saved data not only minimize data transferover the network, but also lighten the database server’s workload.

You can schedule these reports within SAP BusinessObjects Business IntelligencePlatform, 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. Salesrepresentatives then always have access to current sales data, but they aren’t hittingthe database every time they open a report. Alternatively, you can refresh reportswith 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 selectedon the File menu and then save your report.

Designing summary reports

400 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 427: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saving to SAP BusinessObjects Business Intelligence Platform

Designing and distributing summary reports is a relatively easy way to ensure thatusers quickly find the data they need over the web. A summary report can include asmuch 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 locatethe desired data. Then, by drilling down on the report, users can request specific data,which is returned quickly without unnecessary records. This is especially importantto 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 thesummary fields you want to include in your report. Once you’ve grouped andsummarized your report data, hide the Details section (and any other large reportsections) so that users can easily navigate to the data that’s important to them.

Saving a report to SAP BusinessObjects BusinessIntelligence PlatformAnother way to distribute your reports is through BusinessObjects Enterprise. Whenyou publish a report to BusinessObjects Enterprise, you can deliver it to end users viaany web application—intranet, extranet, Internet, or corporate portal.

Crystal Reports facilitates the publication of reports through the Enterprise optionfound in the Open and Save As dialog boxes. When you choose the Enterprise optionin 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 itsoriginal location, or it lets you save a new report to an Enterprise folder, which, inessence, is the same as publishing the report to BusinessObjects Enterprise.

You can save Crystal reports to BusinessObjects Enterprise folders. Use the Save Asdialog box to save a modified report back to its original location, or use it to save anew report to an Enterprise folder. Saving a report to an Enterprise folder is the sameas publishing the report to BusinessObjects Enterprise.

You can also view the report in BusinessObjects Enterprise InfoView, the front-endinterface to BusinessObjects Enterprise.

Note: This functionality is available only with a BusinessObjects EnterpriseXI 3.0/3.1 server environment.

2011 © 2011 SAP AG. All rights reserved. 401

SAP Class Week of February 13, 2012

Page 428: BOC310 Col96 Part(Crystal Reports)

Unit 10: Distributing a Report BOC310

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’tdetect BusinessObjects Enterprise on your machine.

If you have not already logged onto BusinessObjects Enterprise, the Log On toBusinessObjects Enterprise dialog box appears.

Hint: You can also log onto a Central Management Server (CMS) fromthe File menu before you open a report.

3. In the System field, enter or select the name of the BusinessObjects Enterprisesystem that you want to connect to.special setup.

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 recognizedby Crystal Enterprise.

LDAP authentication requires a user name and password that is recognizedby an LDAP directory server.

Windows AD authentication requires a user name and password that isrecognized by Windows AD.

Windows NT authentication requires a user name and password that isrecognized by Windows NT.

Note: Enterprise authentication is the default method. LDAP, AD, andNT Authentication requires

6. When the Enterprise folders appear, select a folder to save your report in. Youcan 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 inBusinessObjects Enterprise.

9. Click Save to publish your report to BusinessObjects Enterprise.

402 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 429: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saving to SAP BusinessObjects Business Intelligence Platform

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 CrystalReports.

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 itsshortcut menu. You can then use the Find dialog box to enter thereport’s name or a part of its name.

• To limit the risk of expanding a folder than contains many hundredsof 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 selectedfolder.

- Last Batch displays the last 100 objects in the selected folder.

• Select the Update Repository Objects option to ensure that thereport’s repository objects are updated when the report is opened inthe future.

2011 © 2011 SAP AG. All rights reserved. 403

SAP Class Week of February 13, 2012

Page 430: BOC310 Col96 Part(Crystal Reports)

Unit 10: Distributing a Report BOC310

To view a report in SAP BusinessObjects Business Intelligence Platform

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.

404 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 431: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saving to SAP BusinessObjects Business Intelligence Platform

Exercise 33: Save a Report to SAPBusinessObjects Business IntelligencePlatform

Exercise ObjectivesAfter completing this exercise, you will be able to:• Save a report to SAP BusinessObjects Business Intelligence platform

Business ExampleYou need to save the report to a platform that is available enterprise-wide.

Task: Save a Report to SAP BusinessObjects BusinessIntelligence PlatformSave a report to your Favorites folder in SAP BusinessObjects Business Intelligence.

1. Open the report, Distributing a Report-1.rpt.

2. Save the report to My Favorites folder in SAP BusinessObjects BusinessIntelligence.

Hint: Save the report with data first to view the report from the BIlaunch pad later.

3. View the report you saved to My Favorites from SAP BusinessObjects BusinessIntelligence.

2011 © 2011 SAP AG. All rights reserved. 405

SAP Class Week of February 13, 2012

Page 432: BOC310 Col96 Part(Crystal Reports)

Unit 10: Distributing a Report BOC310

Solution 33: Save a Report to SAPBusinessObjects Business IntelligencePlatformTask: Save a Report to SAP BusinessObjects BusinessIntelligence PlatformSave a report to your Favorites folder in SAP BusinessObjects Business Intelligence.

1. Open the report, Distributing a Report-1.rpt.

a) Navigate to My Documents to find and open the report.

2. Save the report to My Favorites folder in SAP BusinessObjects BusinessIntelligence.

Hint: Save the report with data first to view the report from the BIlaunch pad later.

a) Click File -> Save As. Select Enterprise from the left panel.

b) Enter your logon details . For example, username train-## ,passwordtrain-##, authentication Enterprise.

c) Navigate to your folder. This folder is the same as your username train-##.

d) Click Save.

3. View the report you saved to My Favorites from SAP BusinessObjects BusinessIntelligence.

a) From the Windows Start menu, navigate to SAP BusinessObjectsEnterprise Client Tools, select Custom Link to BI Launchpad.

b) Enter your logon details . For example, username train-## ,passwordtrain-##, authentication Enterprise.

c) Click the Documents tab.

d) Click My Favorites.

e) Double-click Distributing a Report-1.rpt to view the report.

406 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 433: BOC310 Col96 Part(Crystal Reports)

BOC310 Lesson: Saving to SAP BusinessObjects Business Intelligence Platform

Lesson Summary

You should now be able to:• Define viewing requirements in SAP BusinessObjects Business Intelligence

platform• Save a report to SAP BusinessObjects Business Intelligence platform• View a report in SAP BusinessObjects Business Intelligence platform

2011 © 2011 SAP AG. All rights reserved. 407

SAP Class Week of February 13, 2012

Page 434: BOC310 Col96 Part(Crystal Reports)

Unit Summary BOC310

Unit SummaryYou should now be able to:• Define exporting• Define exporting formats• Define exporting destinations• Define exporting to application formats• Save an export option• Export a report• Define viewing requirements in SAP BusinessObjects Business Intelligence

platform• Save a report to SAP BusinessObjects Business Intelligence platform• View a report in SAP BusinessObjects Business Intelligence platform

408 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 435: BOC310 Col96 Part(Crystal Reports)

BOC310 Test Your Knowledge

Test Your Knowledge

1. The exporting process requires you to specify and.

Fill in the blanks to complete the sentence.

2. What are the two methods to access and view a report in SAP BusinessObjectsBusiness Intelligence?

3. When designing reports that will be viewed in SAP BusinessObjects Enterprise,what are some of the methods used to optimize reports?

4. What does it mean if the Enterprise button is not visible in SAP Crystal Reports?

5. What option would you use to ensure that the report's repository objects areupdated when the report is opened in the future?

2011 © 2011 SAP AG. All rights reserved. 409

SAP Class Week of February 13, 2012

Page 436: BOC310 Col96 Part(Crystal Reports)

Test Your Knowledge BOC310

Answers

1. The exporting process requires you to specify format and destination.

Answer: format, destination

2. What are the two methods to access and view a report in SAP BusinessObjectsBusiness Intelligence?

Answer:

• Enterprise Folders• InfoView

3. When designing reports that will be viewed in SAP 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 SAP Crystal Reports?

Answer: The Enterprise button is not visible if SAP Crystal Reports doesn'tdetect SAP BusinessObjects Business Intelligence from your computer.

5. What option would you use to ensure that the report's repository objects areupdated when the report is opened in the future?

Answer: Select the Update Repository Objects option to ensure that the report'srepository objects are updated when the report is opened in the future.

410 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 437: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 438: BOC310 Col96 Part(Crystal Reports)

SAP Class Week of February 13, 2012

Page 439: BOC310 Col96 Part(Crystal Reports)

Test Your Knowledge BOC310

411 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 440: BOC310 Col96 Part(Crystal Reports)

Course Summary BOC310

Course SummaryYou should now be able to:

• Plan and create a report• Organize and format data• Apply record selection• Create formulas and apply conditional reporting• Export and distribute reports

412 © 2011 SAP AG. All rights reserved. 2011

SAP Class Week of February 13, 2012

Page 441: BOC310 Col96 Part(Crystal Reports)

FeedbackSAP AG has made every effort in the preparation of this course to ensure the accuracyand completeness of the materials. If you have any corrections or suggestions forimprovement, please record them in the appropriate place in the course evaluation.

2011 © 2011 SAP AG. All rights reserved. 413

SAP Class Week of February 13, 2012