BOC310
SAP Crystal Reports: Fundamentals
of Report Design
SAP BusinessObjects - Business Intelligence
Date Training Center Instructors Education Website
Participant Handbook
Course Version: 96Course Duration: 2 Day(s) Material Number: 50103384
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express 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 software components of other software vendors.
Trademarks
• Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® and SQL Server® are registered 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 of Citrix Systems, Inc.
• HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C®, World Wide Web 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 are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other products mentioned are trademarks or registered trademarks of their respective companies.
Disclaimer
THESE MATERIALS ARE PROVIDED BY SAP ON AN "AS IS" BASIS, AND SAP EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR APPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THESE MATERIALS AND THE SERVICE, INFORMATION, TEXT, GRAPHICS, LINKS, OR ANY OTHER MATERIALS AND PRODUCTS CONTAINED HEREIN. IN NO EVENT SHALL SAP BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES OF ANY KIND WHATSOEVER, INCLUDING WITHOUT LIMITATION LOST REVENUES OR LOST PROFITS, WHICH MAY RESULT FROM THE USE OF THESE MATERIALS OR INCLUDED SOFTWARE COMPONENTS.
About This Handbook
This handbook is intended to complement the instructor-led presentation of this course, and serve as a source of reference. It is not suitable for self-study.
Typographic Conventions
American English is the standard used in this handbook. The following typographic conventions are also used.
Type Style Description
Example text Words or characters that appear on the screen. These include field names, screen titles, pushbuttons as well as menu names, paths, and options.
Also used for cross-references to other documentation both internal and external.
Example text Emphasized words or phrases in body text, titles of graphics, and tables
EXAMPLE TEXT Names of elements in the system. These include report names, program names, transaction codes, table names, and individual key words of a programming language, when surrounded by body text, for example SELECT and INCLUDE.
Example text Screen output. This includes file and directory names and their paths, messages, names of variables and parameters, and passages of the source text of a program. Example text Exact user entry. These are words and characters that
you enter in the system exactly as they appear in the documentation.
<Example text> Variable user entry. Pointed brackets indicate that you replace these words and characters with appropriate entries.
Icons in Body Text
The 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's presentation.
Contents
Course Overview ... vii
Course Goals...vii
Course Objectives ...vii
Unit 1: Planning a Report ...1
Defining Database Concepts... 2
Planning and Developing a Report Prototype... 5
Unit 2: Creating a Report ... 19
Creating a Report ... 21
Adding Tables ... 26
Design Environment... 30
Inserting Objects on a Report ... 37
Previewing a Report... 45
Saving a Report... 51
Positioning and Sizing Objects... 65
Formatting Objects ... 74
Unit 3: Selecting Records ... 89
Select Expert ... 91
Determining the Criteria for Record Selection ... 95
Saved versus Refreshed Data ... 100
Applying Record Selection ... 104
Setting Additional Criteria... 108
Modifying Record Selection ... 114
Applying Time-Based Record Selection ... 120
Unit 4: Organizing Data on a Report ...131
Sorting Records... 133
Grouping Records ... 143
Creating Nested and Multiple Groups... 153
Adding a Specified Order Group... 158
Grouping on Time-Based Data ... 163
Unit 5: Formatting a Report ...191
Adding Graphical Elements ... 193
Applying Specialized Formatting ... 203
Combining Text Objects with Database Fields... 215
Inserting Fields with Pre-Built Functions... 220
Unit 6: Applying Section Formatting...237
Formatting Sections ... 238
Creating Summary Reports ... 253
Unit 7: Creating Basic Formulas ...265
Defining a Formula ... 267
Creating Formulas ... 276
Applying an If-Then-Else Formula ... 284
Applying Boolean Formulas ... 291
Applying Date Calculations ... 298
Applying Numeric Calculations ... 305
Applying String Manipulation ... 314
Unit 8: Applying Conditional Reporting ...331
Formatting Data Conditionally ... 332
Adding Key Performance Indicators... 340
Unit 9: Representing Data Visually ...353
Creating a Chart ... 354
Charting on Details or Formula Information ... 369
Customizing a Chart... 376
Unit 10: Distributing a Report ...387
Exporting a Report... 388
Course Overview
SAP Crystal Reports 2011 is a powerful, dynamic, actionable reporting solution that helps you design, explore, visualize, and deliver reports via the web or embedded in enterprise applications. This two-day instructor led course is designed to give you comprehensive skills and in-depth knowledge to plan and create reports that will help you analyze and interpret data.
As a business benefit, you will find that this course is an in-depth approach to the entire report creation cycle from planning a report prototype to distributing a report.
Target Audience
This course is intended for the following audiences: • Business Analysts • Report Writers • Report Designers • Application Developers • BI System Administrators
Course Prerequisites
Required Knowledge• Basic knowledge of database concepts
Recommended Knowledge
• SAP Crystal Reports 2011: Report Design II – Business Reporting Solutions
Course Goals
This course will prepare you to:
• Gain the fundamentals of report design
• Acquire the basis for more advanced courses in the SAP BI curriculum
Course Objectives
• Plan and create a report • Organize and format data • Apply record selection
• Create formulas and apply conditional reporting • Export and distribute reports
Unit 1
Planning a Report
Unit Overview
This unit provides the getting started fundamentals of planning and developing a report in SAP Crystal Reports.
Unit Objectives
After 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 Contents
Lesson: Defining Database Concepts... 2 Lesson: Planning and Developing a Report Prototype ... 5 Exercise 1: Develop a Report Prototype ... 9
Lesson: Defining Database Concepts
Lesson Overview
By understanding basic database concepts, you will be better prepared to understand what’s needed when planning a report.
Lesson Objectives
After completing this lesson, you will be able to: • Define database terms
Business Example
You need to know where your information is stored and in what form before you can determine the reporting requirements.
Database terms and definitions
Term Definition
Database A database is a bank of data that provides the information for a report. A database is also referred to as a data source.
Table A table is a container of information that
can hold many pieces of data, such as records. Tables are stored in databases. Record In a database, a record is a complete unit
of related information. Each record is made up of one or more fields, and each field can hold one piece of data (known as a value).
Field A field is the basic building block of a
record. A field can be empty (NULL) or contain a value.
BOC310 Lesson: Defining Database Concepts
Relational database A relational database contains tables that can be linked together based on the relationship between the fields in two or more tables.
Report A report is an organized presentation
of data. A comprehensive, customized, and attractive report can provide management with the information it needs to run an organization effectively.
Link A link is a field that is common to
two or more tables and that serves as a connecting point between those two tables. Linking means that records are matched up from two or more table(s) and ensures that all the data in each row of multiple tables refers to the same customer (transaction, invoice, and so on) on a report.
Lesson Summary
You should now be able to: • Define database termsBOC310 Lesson: Planning and Developing a Report Prototype
Lesson: Planning and Developing a Report Prototype
Lesson Overview
As a starting point in the report design process, outline the information that the report is required to provide.
Lesson Objectives
After completing this lesson, you will be able to: • Determine the layout and content of a report • Develop a prototype of a report
Business Example
You need to understand the basic concepts of report design, so you can plan what information to include on the report.
Report prototype layouts
By taking a systems-oriented approach to reporting and developing a prototype, you will produce clearer and more readable reports.
Hint: With the paper prototype in hand, you can put your full effort into learning and using the program, rather than trying to design and learn at the same time. For more details on the report planning process, see the Crystal
Reports User’s Guide.
Developing a report prototype
To develop a report prototype, gather the information on which the report will be based. This stage of the report planning process, referred to as requirements gathering, consists of the report designer asking the report requestor a series of targeted
questions, sometimes in the form of a checklist.
After determining the outline of the report request, you develop the prototype by: • Sketching the report on a blank piece of paper, usually the size the report will
Sketching the report helps if you need to see the report visually; however, a form with all the categories listed enables you to develop the prototype without missing a section. As well, the form is more professional than a quickly sketched visual and can be used as a sign-off point in a report request. Having a list of questions (based on the Report Requirements Checklist) can also help to keep you on track.
Note: The Report Requirements Checklist is based on Crystal Reports terminology. Use this checklist as a starting point for a version specific to your organization’s needs.
Report Requirements Checklist
You can use these guidelines to jumpstart the planning process. • Define the overall purpose of the report.
The purpose statement helps you focus on your primary needs, and it gives the report both a starting point and a goal.
• Define the readers of the report. Plan the report so it includes the information each user is looking for.
• Define the data used in the report.
What type of data source will you need to connect to? • Determine the report title.
Write out a working title for the report. You may decide to change it later, but at least 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 title of the report. Page numbers usually appear in footers.
• Define specific data that should appear in the body of the report.
The body should contain all the data needed to fulfill the statement of purpose you wrote for the report. It should also contain all of the data needed by the various users that you have identified.
• Determine if the data is organized into groups.
How? By customer? By date? By hierarchy? Or by other criteria? • Determine if the data is sorted based on record or group values.
Data can be sorted based on a specific record or on a group. • Determine if the data exists or if it needs to be calculated.
BOC310 Lesson: Planning and Developing a Report Prototype
Some report information can be drawn directly from data fields; other information will have to be calculated based on data field values. • Determine if the report is to contain only specific records or groups.
You can base a report on all records in a given database, or on a limited set of records from the database.
• Determine if the data needs to be summarized.
Do you want to total, average, count, or determine the maximum or minimum value included in all the values in any column on the report? Do you want to include a grand total at the bottom of a selected column?
• Define how to identify key information through formatting options. What formatting options can be used to highlight key data on a report?
BOC310 Lesson: Planning and Developing a Report Prototype
Exercise 1: Develop a Report Prototype
Exercise Objectives
After completing this exercise, you will be able to:
• Determine the content and layout for a report and then develop a prototype
Business Example
As a report designer, you are requested to build a report for the organization. Based on the report requirements provided in the business scenario, you will need to determine the content and layout. Then, it is recommended that you develop a prototype prior to building the report.
Task: Determine Report Requirements
Read 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 company called the Xtreme Bike Company. Your first assignment is to create a report that will display orders placed by each customer of the organization.
The database administrator tells you that the customer information and the order information are stored in two separate tables in the Xtreme company database. You are advised to use an ODBC connection to the database.
The sales manager tells you that the standard is to use the company logo AT THE OF THE REPORT as well as a title and print data that is labeled. Other corporate standards include a page number that is labeled at the bottom of the report and copyright information.
The main section of the report should contain the customer's name and city. The customer's order information should include the date the order was placed, the amount of the order, and the order ID number.
For this report, the Sales team needs to see records selected from the country of the USA and for 2004 only. The customers and the cities should be sorted alphabetically, starting with “A.”
The report should display USA as the only country group. The only regional groups required are Western Sales Territory and the Eastern Sales Territory. All other regions can be listed under Unassigned Regions. Also, the Sales team wants to see information grouped on the dates that orders were placed with the order dates sorted with the most recent information first.
The Sales team also needs to see such summarized data as the number of orders for each order date group. Include the subtotal of the order amount for each order date group as well as a report grand total for the order amount. As well, include a percentage of the order amount based on each month's subtotal compared to the grand total. The Sales team also needs to see the number of unique customers.
To highlight key information with specialized formatting options, ensure the order date group as well as the subtotal and grand total is easily found on the report. Format the column headings, so that navigating the report is easier. Use two different font styles for the report title for contrast.
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 the following Report Prototype Form as an aid in this activity or sketch the report prototype on a piece of paper.
Report Prototype Form Report Prototype Form Purpose
Audience Report title
Database information
Header information Footer information
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 a specific order)
Record selection (Specific records to be 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.
Result
You now have a list of report requirements and a prototype of the content and layout.
Solution 1: Develop a Report Prototype
Task: Determine Report Requirements
Read 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 company called the Xtreme Bike Company. Your first assignment is to create a report that will display orders placed by each customer of the organization.
The database administrator tells you that the customer information and the order information are stored in two separate tables in the Xtreme company database. You are advised to use an ODBC connection to the database.
The sales manager tells you that the standard is to use the company logo AT THE OF THE REPORT as well as a title and print data that is labeled. Other corporate standards include a page number that is labeled at the bottom of the report and copyright information.
The main section of the report should contain the customer's name and city. The customer's order information should include the date the order was placed, the amount of the order, and the order ID number.
For this report, the Sales team needs to see records selected from the country of the USA and for 2004 only. The customers and the cities should be sorted alphabetically, starting with “A.”
The report should display USA as the only country group. The only regional groups required are Western Sales Territory and the Eastern Sales Territory. All other regions can be listed under Unassigned Regions. Also, the Sales team wants to see information grouped on the dates that orders were placed with the order dates sorted with the most recent information first.
The Sales team also needs to see such summarized data as the number of orders for each order date group. Include the subtotal of the order amount for each order date group as well as a report grand total for the order amount. As well, include a percentage of the order amount based on each month's subtotal compared to the grand total. The Sales team also needs to see the number of unique customers.
BOC310 Lesson: Planning and Developing a Report Prototype
To highlight key information with specialized formatting options, ensure the order date group as well as the subtotal and grand total is easily found on the report. Format the column headings, so that navigating the report is easier. Use two different font styles for the report title for contrast.
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 the following Report Prototype Form as an aid in this activity or sketch the report prototype 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)
Sorting (Information to be sorted in a specific order)
Record selection (Specific records to be 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 system landscape. Click Start -> My Documents -> BOC310.
As a solution, refer to the following files:
• ReportProtoype.SWF as an interactive Flash file on developing a
report prototype
• Report Prototype Form.pdf as a job aid
Result
You now have a list of report requirements and a prototype of the content and layout.
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
Unit Summary
You should now be able to: • Define database terms• Determine the layout and content of a report • Develop a prototype of a report
Unit 2
Creating a Report
Unit Overview
This unit provides the knowledge of creating a basic report using SAP Crystal Reports.
Unit Objectives
After 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 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 Contents
Lesson: Creating a Report... 21 Lesson: Adding Tables ... 26 Lesson: Design Environment... 30 Lesson: Inserting Objects on a Report... 37 Lesson: Previewing a Report... 45 Lesson: Saving a Report... 51 Exercise 2: Build a Report ... 59 Lesson: Positioning and Sizing Objects ... 65 Lesson: Formatting Objects ... 74 Exercise 3: Position, Size, and Format Report Objects ... 79
BOC310 Lesson: Creating a Report
Lesson: Creating a Report
Lesson Overview
In order to create a report, you must first connect to the database that contains that data required.
Lesson Objectives
After completing this lesson, you will be able to: • Create a report using different methods report • Choose a data source type
Business Example
Depending on the complexity of the report requirements and your familiarity with creating a report, you can use one of three methods to create a report.
• Report Wizard • Blank Report • Another Report
Starting a New Report
The Start Page includes links to recent reports you’ve opened, report creation methods, the Help system, a search functionality, sample reports, and an update service. You can create a new report with Crystal Reports using these methods:
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 is rushed, will find it easier to design a report using one of the Wizards, sometimes referred to as Experts. You step through the report-building process of a specific type of report when using an Expert.
• 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 report and 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. This existing report can be used as a template since it may already contain much of the information and formatting you need. After you open the report you want to use as a template, save it to a new file using the Save As command on the File menu. The Start Page also contains dynamic content from Business Objects.
After you select the type of report, you want to build from the Start Page, you choose the data source you will use to create the report.
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 the
Start Page, the dialog box that displays will be one of several Data dialog boxes that
allow you to specify the data source from either an existing connection or by creating a new connection.
If you choose to use a blank report as the basis of your new report, the Database
Expert opens automatically.
The options in the Database Expert are: • My Connections
This option shows all data sources that you are currently connected to. • Create New Connection
The data you use to create reports in your organization is stored in either a client-server database such as MS SQL Server, or a PC-type database such as Microsoft Access. You access sources through either an ODBC layer or directly through native drivers. ODBC stands for Open Database Connectivity. It is an interface that gives applications the ability to retrieve data in data management systems.
Note: Salesforce.com is an on-demand customer relationship management (CRM) company. A salesforce.com driver included with Crystal Reports allows for access to customer data. Reports that use a salesforce.com driver refresh when deployed to crystalreports.com.
To connect to an ODBC data source
1. From the Database Expert, select Create New Connection. 2. Expand the Create New Connection list and locate ODBC (RDO). 3. Click ODBC (RDO) . The ODBC (RDO) dialog box opens.
4. Locate and then click the appropriate data source, and then click Next. The second window of the ODBC (RDO) dialog box appears, displaying the connection information needed to log onto the selected data source.
5. In the Connection Information section of the ODBC (RDO) dialog box, enter your user ID and password, if required, and then click Finish.
Hint: In your organization the database may be secure, meaning you might be prompted for a user ID and password. For this course, the sample database has not been secured.
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
Lesson: Adding Tables
Lesson Overview
From the data source connection, you can add the available tables and fields to a report.
Lesson Objectives
After completing this lesson, you will be able to: • Add tables to a report
• Describe linking
Business Example
After connecting to a data source, you will see the available data. You can then specify which tables to use for the report.
Adding tables to a report
After selecting the data source, you can add one or more tables to base your report on. To add tables to a report
Figure 4: Adding tables to a report
Linking database tables
If your report contains data from two or more database tables, you will need to link the tables when creating your reports. Linking requires that you use a field that is common to both tables. You link database tables so records from one table match related records from another. You define the linking setup in the Links tab of the Database Expert.
BOC310 Lesson: Adding Tables
Auto Link in the Database ExpertLinks tab automatically chooses links for your
tables based on common fields in tables or indexed fields (if your database supports indexed fields).
Note: The color flags indicate that these fields are indexed. Indexed fields can increase the speed of data access and reduce the time it takes for the program to evaluate data
The other options in the Links tab include: • Links display area
The display area shows all the tables currently in your report along with links and indexes.
• Auto-Arrange
When you click this button, the program arranges the tables to fit in the most efficient manner inside the Links display area.
• Auto-Link
Use this area to choose a method of linking tables. Click By Name to link tables by their names or By Keyto use foreign key information. Click the Link button to link 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 the link processing order you want for the available linked tables.
• Clear Links
This option removes all the links in the tables. • Delete Link
This option removes the selected link • Link Options
This option opens the Link Options dialog box when you click a link line to select it.
• Index Legend
This option opens the Index Legend dialog box so you can see a key to the index indicators (arrows) used in the Links display area. The numbering of the index indicators reflects the sequence in which the indexes were created. If a field is part of several indexes, the index indicator in front of the field shows the colors of the indexes the field is part of.
To link tables
1. Confirm the tables are linked correctly. 2. Click OK.
BOC310 Lesson: Adding Tables
Lesson Summary
You should now be able to: • Add tables to a report • Describe linkingLesson: Design Environment
Lesson Overview
The Design view is the environment in which you will build a report.
Lesson Objectives
After completing this lesson, you will be able to: • Build a report from the Design view • Navigate toolbars
Business Example
When creating a report, you begin in the Design view, also referred to as the Design tab.
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 initial formatting; place objects in the sections where you want them to appear; specify sorting, grouping, and totaling needs; and so forth.
BOC310 Lesson: Design Environment
While working in the Design tab you manipulate “representative” for placeholders of objects, not the objects themselves. The Design tab offers faster previewing of information and layout because you are not working with the actual data itself. When a field is placed on the report, the program uses a frame to identify the field on the tab; it does not retrieve the data yet. Thus, you can add and delete fields and other objects, move them around, set up complex formulas, and more, without tying up the computer or network resources needed to gather the data.
The report created in the Design tab is a kind of virtual report; it has the structure and instructions for creating the final report, but it is not the report itself. To turn the
Design tab report into a final report or into a report that you can fine-tune, you add
data. Data adding occurs whenever you preview the report, print it, or output it in any other way. The actual data appears in the report.
When you begin creating a report, Crystal Reports automatically creates five areas or sections in the Design window.
Figure 6: Design View
• Report Header
This section is used for the report title and other information you want to appear at the beginning of the report. It can also be used for charts and cross-tabs that include data for the entire report. Items placed in the Report Header print only on the first page of the report. Often the name of the report, the print date, company logo, or “title page” information is included in the Report Header.
• Page Header
This section is used for information that you want to appear at the top of each page. This can include such things as chapter names, the name of the document, and other similar information. This section can also be used to display field titles above the fields on a report. Objects in the Page Header print at the top of every page of the report. Column headings, print dates, and page numbers are common entries in the Page Header.
• Details
This section is used for the body of the report and is printed once per record. The bulk of the report data appears in this section. Place the data fields on which you want to report in this area. This information (database fields and text) prints for every record selected on the report.
• Report Footer
This section is used for information you want to appear only once at the end of the report (such as grand totals) and for charts and cross-tabs that include data for the entire report. Items placed here print only on the last page of the report. Grand totals, total number of pages, and other summary information are often placed here.
• Page Footer
This section usually contains the page number and any other information you want to appear on the bottom of each page. Objects placed here print at the bottom of every page. Page numbers are often placed in the Page Footer.
Note: The names of the five areas can also be shortened to their abbreviated forms (RH, PH, D, RF, and PF). You set the Short Section Name option in the
Design View area of the Layout tab in the Options dialog box from the File
menu. You can also set this option by right-clicking on one of the section names and selecting Show Short Section Names from the shortcut menu.
BOC310 Lesson: Design Environment
Each section is indicated by a section boundary. These lines indicate the separation of the areas and do not print to paper.You can move these bars to change the amount of space reserved for each section. You click and drag the section divider to the desired position; however, you can drag the bottom line only to affect the size of the section.
Figure 7: Design View
Working with Toolbars in Design View
The Report Designer window includes several toolbars. SAP Crystal Reports groups several commonly used commands on a toolbar that remains on screen at all times unless you choose to turn it off using the Toolbar command on the View menu.
The toolbars are: • Standard
This toolbar contains several commonly used commands • Formatting
This toolbar contains commands for formatting the selected field. • Insert Tools
This toolbar provides quick access to advanced report enhancing features. • Expert Tools
This toolbar provides quick access to many advanced experts. • Navigation Tools
This toolbar provides buttons for refreshing a report’s data and for moving around the report.
• External Command
This toolbar is where organizations can access custom applications or plug-ins that they have created for Crystal Reports.
Note: The ability to customize Crystal Reports by using Add-ins in the Report Designer allows report developers to extend the functionality of the application. 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 your company's specifications.
The toolbars are floating toolbars. You can position them on any of the four sides of the screen, or float them on your design area. Each toolbar displays an icon that visually describes the command it represents. You activate a toolbar command by clicking the appropriate icon.
To move a toolbar, click and hold in an unused part of the toolbar, between groups of buttons, or on the unused area at the beginning or end of the toolbar. Drag the entire toolbar to the desired location. As you approach the edge of the screen, the toolbar automatically stretches to match that side.
BOC310 Lesson: Design Environment
The toolbar eliminates some of the steps needed to activate a command, increasing the speed with which you create reports.
Hint: If you are not sure about the function of a button on the toolbar, place the pointer over the icon and hold it there until a tooltip appears.
Lesson Summary
You should now be able to:• Build a report from the Design view • Navigate toolbars
BOC310 Lesson: Inserting Objects on a Report
Lesson: Inserting Objects on a Report
Lesson Overview
In SAP Crystal Reports, you can add objects to a report. Objects, such as database fields and various report objects, are organized and managed from Explorer windows.
Lesson Objectives
After 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 Example
When creating a report, you need to add placeholders for the data in Design view. The available objects are managed through Explorer windows.
Working with the Field Explorer
Database fields, formula fields, lines, and boxes are examples of the types of objects you can place, move, and resize on your report. You access and insert these objects onto the report from the Field Explorer.
Use the Field Explorer to insert, modify, or delete fields on the Design and Preview tabs. You’ll see the Field Explorer after you have:
• Clicked the Field Explorer button on the Standard toolbar. • Selected the Field Explorer from the View menu.
The Field Explorer displays a tree view of database fields and special fields that you can add to your report. It also shows formula fields, SQL expression fields, parameter fields, group name fields, and running total fields that you have defined for use in your report.
You can dock the Field Explorer dialog box. In free-floating mode, drag the Field
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 at a time by selecting multiple fields, right-clicking, and choosing Insert to Report. Alternatively, to insert a field, you can drag and drop it in the Design or Preview tabs.
• Browse
Use this option to browse data for a database field, formula field, or SQL expression field.
• New
Use this option to create a formula field, SQL expression field, parameter field, or running total field.
• • Duplicate
Use this option to make a copy of the formula that you have selected in the Field
Explorer. Once the copy is created you can rename and edit it.
• Edit
Use this option to modify an existing formula field, SQL expression field, parameter field, or running total field.
• Rename
Use this option to modify the name of an existing formula field, SQL expression field, parameter field, or running total field.
• Delete
Use this option to remove a formula field, SQL expression field, parameter field, or running total field. You can also select multiple fields, right-click, and choose
Delete to remove them all at once.
Hint: Each button on the Field Explorer’s toolbar has an associated shortcut option that’s displayed in the tooltip.
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 box appears. To speed the report building process, this dialog box remains on screen until you close it. You can move this dialog box wherever you want.
2. Expand the Database Fields folder to see all the tables chosen from the database(s).
3. Expand the individual tables to see all the fields they contain. 4. Select the field you want to appear in the report.
5. Click Insert to Report and then click to place it in the report.
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 to place them. You can also drag and drop fields to add them to the report. You can right-click the field in the Field Explorer to invoke a shortcut menu that displays the Insert to Report option.
After you place a field onto a report, a check mark appears on the field in the Field
Explorer.
Determining data field types
You can take a look at a sample of the actual data in the table before you place the field on your report in the Browse Field Data dialog box.
To browse field data 1. Select the field.
2. From the Field Explorer, click Browse. The Browse Data dialog box opens. 3. Scroll through the list.
4. Click Close when finished.
Note: The default setting is either to display the first 500 records or to time out at five seconds, depending on what has been set up. If you have large tables with more than 500 records, you will not see examples of all the data contained in the fields.
Working with the Report Explorer
The Report Explorer appears when you select the Report Explorer command from the
View menu, or when you click the Report Explorer button on the Standard toolbar.
The Report Explorer displays a tree view of the sections in your report and lists the report objects contained in each section and works like a “report navigator”. You can work with report objects directly from the explorer.
The Report Explorer's toolbar provides buttons that let you expand or collapse your report's tree view and choose the report items to display by type:
• Expand
Use this option to expand all child nodes of the tree view under the selected node. If you select this option while the root node is highlighted, all remaining nodes are expanded. If you select this option while a child node is highlighted, only the nodes that are part of the child are expanded.
Note: This option has no effect if selected while a report object is highlighted, or if the selected node has no children.
• Show/Hide Data Fields
Use this option to show or hide data fields in your report. Data fields include formula fields, summary fields, and text objects.
• Show/Hide Graphical Objects
Use this option to show or hide graphical objects in your report. Graphical objects include charts, maps, boxes, lines, BLOB fields, and OLE objects. • Show/Hide Grids and Subreports
Use this option to show or hide cross-tabs, OLAP grids, and subreports in your report.
You can dock the Report Explorer dialog box. In free-floating mode, drag the Report
Explorer to any location. You can also dock the Report Explorer as a tab, similar
to the Design tab.
The content of the Report Explorer represents the content of the report in a tree view. The root node is the report itself, while the first-level nodes represent the report's sections.
Within each section, the report's fields and objects are listed. Any item you select in the tree view will be selected in the report (in either Design or Preview modes). You can modify report fields and objects by selecting them in the Report Explorer. When you right-click the selected item, you see a menu that contains the actions you can carry out on the item.
BOC310 Lesson: Inserting Objects on a Report
For example, if you right-click a text object, the menu contains the options to edit the text, 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 using the 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 dashed underline. These indicators are available if you are using a Microsoft Windows operating system only.
• You can use the openDocument function to create hyperlinks to other types of reports (for example, Web Intelligence reports).
To use the Report Explorer
1. Click the Report Explorer icon on the Standard toolbar. The Report Explorer appears.
2. Right-click the field you want to format and select the option you want to apply from the shortcut menu.
3. Apply the changes.
Working with the Repository Explorer
The repository is the central location for you to store and manage your report objects. These objects are accessible to users and report developers for use in new reports. Physically, the repository is a database that stores supported object types:
• Text objects • Bitmaps
• Commands (queries) • Custom functions • List of Values
The Repository Explorer’s toolbar provides buttons that let you add new folders, search for items, and so on:
• Change view settings
Use this option to open the View Settings dialog box. Use this dialog box to limit the type of repository items displayed in the Repository Explorer. You can also select options to sort multiple items by name or by type.
• Advanced filtering
Use this option to display filtering options at the bottom of the Repository
Explorer. Use these filters to find specific items by words from the Name or Author fields in the Add Item dialog box.
Note: Text entered in the filtering fields of this option is not case sensitive.
• Delete the item/folder
Use this option to permanently remove the selected item or folder from the repository. 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 is displayed in the Repository Explorer.
Hint: Hover your mouse’s cursor over any object in the Repository Explorer to see a tooltip. Tooltips for text objects and bitmaps include Author and Description information as well as the complete text of the SQL statement. By maintaining a shared repository of report objects, you can modify a particular object and update all reports containing that object as they are opened for use. A central location for report objects also helps with the task of managing your data—an important benefit in maximizing productivity and minimizing costs at your company. The BusinessObjects Enterprise Repository is contained in BusinessObjects
Enterprise. Depending on the version of Crystal Reports you have, you can install a version of BusinessObjects Enterprise to access the repository.
BOC310 Lesson: Inserting Objects on a Report
You can dock the Repository Explorer dialog box. In free-floating mode, drag the
Repository Explorer to any location. You can also dock the Repository Explorer as a
tab, similar to the Design tab. To open the Repository Explorer
1. Click the Repository Explorer icon on the Standard toolbar.
Hint: Another way to do this is to click the Repository Explorer option under the View menu.
2. . If you’re not logged onto the repository in BusinessObjects Enterprise, click the Logon button on the toolbar in the Repository Explorer.
The Log On to BusinessObjects Enterprise dialog box opens.
3. Enter the appropriate information into the System, User name, Password, and
Authentication text boxes.
4. Click OK.
The Repository Explorer appears, displaying the contents of the repository. 5. Expand the top node to see the repository contents, if required.
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
BOC310 Lesson: Previewing a Report
Lesson: Previewing a Report
Lesson Overview
When you create a new report, you begin in the Design tab. You can view the report in the Preview tab to see the results. Learn the preview options in SAP Crystal Reports to understand how the information displayed in a report is affected. From the Preview tab, you can evaluate the format and layout of the report's design.
Lesson Objectives
After 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 Example
As you are building a report or when you are finished, you want to see how the data is displayed on the report.
Previewing reports
Once you have placed data fields on your report, you are ready to preview your design. The methods to switch to the Preview window are:
• Click the Print Preview button on the Standard toolbar.
• Click the HTML Preview button on the Standard toolbar to see an HTML rendering of your Crystal report as it will appear when published to the web. • Click the Refresh button to the far right of the Report Designer’s screen.
Hint: The area at the bottom of the Report Designer environment is called the page controls area, which shows you the date and time that the data was last refreshed.
The program gathers the data, makes the necessary calculations, and displays the report in the Preview tab. With the data in place, you can review the spacing and formatting of your report and see the actual results of all your summaries, formula calculations, and record and group selections.
The program works with data in this manner:
• The first time the Preview tab is used, it retrieves data from your underlying data source(s) and saves it with the report (unless you have set up the program not to save data).
• From that point on, the program uses the saved data whenever you preview the report unless you specifically refresh it or add a field that requires the program to retrieve new data.
When you save data with a report, the data is saved in a cache file with the report on the client machine.
Note: You retain full design capabilities in the Preview tab.
When you need to make sure that your report design is appropriate and correct over the web in a zero-client environment, the HTML Preview option lets you see an instant rendering of your report to HTML without leaving the Crystal Reports design environment. Unlike the Preview tab, which shows the true report format, the HTML
Preview tab shows a converted format. By switching between the two tabs, you can
make adjustments in your report design to yield the best results on the web. In the case of reports that are published to BusinessObjects Enterprise (managed reports), you don’t have to do any special configuration to make the HTML Preview feature work.
For stand-alone reports (unmanaged reports), the program must use a stand-alone Report Application Sever (RAS) to generate the preview. In this case, you need to configure the HTML Preview feature. Do this in the Servers tab of the Options dialog box in Crystal Reports.
If you open a large report in HTML Preview, a progress indicator displays. Once the report is open in HTML Preview, you will see a stationary group tree to the left of the report and a stationary toolbar above the report. You can use the group tree and toolbar to navigate from one page of the report to another without scrolling up and down. The HTML Preview also displays the page margins so you know what the report will look like if it is printed.
BOC310 Lesson: Previewing a Report
Viewing a report
Crystal Reports provides two views for previewing a report: • Standard view
• Preview panel
Standard view
In the standard view, the report is displayed one page at a time.
Using the navigation buttons in the Preview tab, you can move to the beginning or end of the report, or you can move backward and forward through the report one page at a time.
For shorter reports or reports in which you're primarily interested in seeing the“ bottom line”totals, the standard view provides all of the functionality you need. Preview panel
You can display or hide the Preview panel using Toggle Preview Panel on the
Standard toolbar.
The Preview panel view presents a split screen: • The right pane displays the report.
• The left pane displays a high-level outline of the report, showing the hierarchy of groups and subgroups in a familiar tree format.
The Preview panel typically displays the names of the groups and subgroups you created in your report. You can, however, customize these names using the Options tab of the Insert Group or Change Group Options dialog box.
When you click the tree node for the group that interests you, the program jumps immediately to the part of the report that contains the information for that group. For longer reports or reports in which you want to jump back and forth between different groups, the navigation features of the Group Tree view make your work extremely efficient.
Zooming in and out
Zooming enables you to move from a full-page view to a zoom between 25% and 400% as well as the Whole Page and Page Width options. Taking a “bird’s-eye view” of your report gives you an idea of the overall layout of your report, letting you see if graphics are positioned properly, and so on. Zooming in at a high magnification level
Page controls
Page controls enable you to move forward or backward through the report one page at a time, to move to the first or last page, to cancel the printing of the report, and to close tabs.
The Data Age indicator indicates the date the data was last refreshed or initially retrieved, whichever is the most recent. If the data was initially retrieved or refreshed today, it indicates the time it happened.
The status bar
The status bar is found at the bottom of the Design tab and displays the selected field name, its position on the report, and how many records were returned. When you hover your cursor over a button on the toolbars, the status bar displays a tooltip. You can show or hide the status bar by using the Status Bar command on the View menu. By default, the status bar is shown (a check mark appears beside the command on the menu).
Working in the Design and Preview tabs
Often, you will find it easier to work in the Design tab when working with multiple sections and areas. You may sometimes want to work in the Preview tab where you can see the effects of your changes instantly and how the report will be printed. You have the same formatting capabilities in the Preview tab as you do in the Design tab. Menus (both menu bar and shortcut menus) and toolbars remain active, providing essentially the same functionality you have when working with a report in the Design tab. However, when you are making numerous changes, it is quicker to make the changes in the Design tab.
BOC310 Lesson: Previewing a Report
Some additional things to consider are:
• The Design tab and Preview tab are tied together internally. Any changes made in one are reflected in the other.
• The Preview tab has a single vertical ruler at the left of the tab rather than the individual section rulers seen in the Design tab. The functionality of the ruler is the same.
• The Preview tab identifies report sections in the shaded area to the left of the data. With a quick look you can tell which report section the data is printing from. While section names appear only once in the Design tab, they print each time a section prints in the Preview tab.
• The record counter, the Data Age indicator, and the Page Forward/Page Back controls are all active in the Preview tab.
• The Preview tab highlights every value when you select a field, whereas, only the field frame is highlighted in the Design tab.
Working in the Preview tab has a different feel from working in the Design tab. Each field in a database contains dozens, hundreds, or even thousands of values, depending on the number of records in the database. When you place a field in the Design tab, a single field frame represents all those values. When you highlight the field, sizing handles appear on the frame and the frame changes color.
In the Preview tab, however, you are working with the actual data. Instead of a field frame representing many field values, the values themselves appear. When you highlight a field or formula field value, you are actually selecting every value in the field:
• The program places a sizing frame around the specific value you select. • It highlights every other value in the field.
Aside from the differences in appearance, the process of building and modifying a report is the same in both the Design tab and the Preview tab.
Hint: When working in the Preview tab, remember that each change you make may require extra time to process because you are working with the actual data, not just the placeholders (as in the Design tab).
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
BOC310 Lesson: Saving a Report
Lesson: Saving a Report
Lesson Overview
When 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 Objectives
After 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 Example
After a report is completed, you will want to search for it or modify it. If you need to follow up, you can refer to the report's summary information for helpful details.
Adding summary information
You can save summary information with the report. Summary information contains such things as the report author, report title, and comments.
There may be times when you want to include non-printing comments with a report (a personal note to the report recipient, a note to explain more thoroughly the data on which the report is based, a report title, or a comment about some particular data on the report).
Summary information provides a facility for including anything from a short note to hundreds of lines of text with your report. The comments do not print with the report; they remain in the Summary tab of the Document Properties dialog box where they can be reviewed on demand.
To add summary information 1. Select File → Summary Info.
Saving a report
The saving function is the same in Crystal Reports as in many other applications. The
Open, Save, and Save As dialog boxes enable you to open or save a report conveniently
to personalized folders that are created by your operating system. If one of these folders does not exist on your machine, the corresponding button will not be displayed. The personalized folders are:
• 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 your reports over the Web, instead of by email or hard copy.
• Enterprise
If your company has deployed BusinessObjects Enterprise, a web-based report management tool, you can log onto the system so you can view the reports stored on the Enterprise system.
• My Connections
This folder shows a list of data sources to which you are connected.
Saving a preview of a report
You can save the first page of a report as a preview or “snapshot ”of a report so that you can view the report when opening it. You can also preview a sample of the data. Some considerations include:
• You must preview the report before a snapshot can be taken.
• The snapshot is only updated when you preview. If you turn on the feature in the Design tab, but do not preview, the snapshot will not be taken. Also, if you modify the report in the Design tab, and save the report but do not preview, the snapshot will not be updated.
• Because the snapshot is saved in the report file, the addition of the preview picture may increase the size of the file.
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 Save
Preview 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 Workbench
The Workbench is a folder structure that can represent the type of projects you work on. In the Workbench, you can create projects (folders) that contain one or more reports. For example, if you are a report designer in the financial department of an organization, you could have separate folders for Accounts Payable and Accounts Receivable.
Use the options on the toolbar to add, remove, or rename folders, reports, and object packages. You can reorganize the files in a folder or folders by dragging and dropping them where you want them to appear. You can also drag report files from Windows Explorer and drop them into the folder of your choice in the Workbench.
The Workbench includes a toolbar:
• Add
Use this option to add a new object to the Workbench: – Add Existing Report or Add Current Report
When you select this option, the Open dialog box appears so that you can search for a Crystal report that you have previously created.
– Add New Project
When you select this option, the program adds a new folder under the root node that is called Workspace. You can add reports to this folder. Project folders offer a way to organize the reports in the Workbench.
– Add Object Package
When you select this option, the program prompts you to log onto your BusinessObjects Enterprise system. When you have connected to your system, you can choose an object package to add to the Workbench. • Open
Use this option to open the report or report package that you have selected in the Workspace folders.
• Check Dependencies
Use this option to initiate the Dependency Checker, a method of checking for errors in a report. The option is available for individual reports or for folders of reports. Crystal Reports begins checking the report(s) immediately and displays the results in the Dependency Checker.
You can right-click any item in the workspace area of the Workbench to see a shortcut menu. Many of the options that are available on the shortcut menu are also available on the toolbar. This section describes only the additional options that are not available on the toolbar.
• Rename
Use this option to rename a folder in the Workspace area. • Remove
Use this option to remove a report, report package, or folder from the Workspace area.
Note: