Beruflich Dokumente
Kultur Dokumente
BOC320
Copyright
2009 SAP BusinessObjects. All rights reserved. SAP
BusinessObjects owns the following United States patents, which
may cover products that are offered and licensed by SAP
BusinessObjects and/or affliated companies: 5,295,243; 5,339,390;
5,555,403; 5,590,250; 5,619,632; 5,632,009; 5,857,205; 5,880,742;
5,883,635; 6,085,202; 6,108,698; 6,247,008; 6,289,352; 6,300,957;
6,377,259; 6,490,593; 6,578,027; 6,581,068; 6,628,312; 6,654,761;
6,768,986; 6,772,409; 6,831,668; 6,882,998; 6,892,189; 6,901,555;
7,089,238; 7,107,266; 7,139,766; 7,178,099; 7,181,435; 7,181,440;
7,194,465; 7,222,130; 7,299,419; 7,320,122 and 7,356,779. SAP
BusinessObjects and its logos, BusinessObjects, Crystal Reports,
Rapid Mart, Data Insight, Desktop Intelligence, Rapid
Marts, Watchlist Security, Web Intelligence, and Xcelsius
are trademarks or registered trademarks of Business Objects,
an SAP company and/or affiliated companies in the United
States and/or other countries. SAP is a registered trademark
of SAP AG in Germany and/or other countries. All other names
mentioned herein may be trademarks of their respective owners.
C O N T E N T S
Course introduction...................................................................................................xiii
Course description.....................................................................................................xiv
Course audience.........................................................................................................xiv
Prerequisites................................................................................................................xiv
Additional education ................................................................................................xiv
Level, delivery, and duration...................................................................................xiv
Applicable certifications and designations.............................................................xiv
Course success factors.................................................................................................xv
Course setup.................................................................................................................xv
Course materials..........................................................................................................xv
Learning process.........................................................................................................xvi
Lesson 1
iii
Lesson 2
Creating Formulas
Lesson 3
Managing Reports
Lesson introduction ....................................................................................................45
Using the Workbench .................................................................................................46
Viewing the Workbench......................................................................................46
Organizing Workbench contents locally ..........................................................47
Publishing to BusinessObjects Enterprise................................................................48
Creating a new object package...........................................................................48
Adding an existing object package to the Workbench...................................48
Using the Publishing Wizard.............................................................................49
Activity: Publishing and viewing reports in BusinessObjects
Enterprise..............................................................................................................50
iv
Lesson introduction.....................................................................................................17
Using functions and operators...................................................................................18
Defining functions and operators .....................................................................18
Using help when creating formulas..................................................................18
Using string functions and operators ...............................................................19
String operators ...................................................................................................20
Activity: Defining string functions and operators...........................................22
Using nested string functions and operators ..................................................23
Activity: Using string functions and operators................................................23
Using numeric functions ....................................................................................24
Activity: Using numeric functions.....................................................................25
Using date and time functions ..........................................................................28
Activity: Defining date and time functions and operators............................31
Activity: Using date and time functions and operators.................................31
Using arithmetic operators.................................................................................32
Using Boolean operators ....................................................................................33
Activity: Using Boolean operators.....................................................................34
Defining control structures in Crystal syntax..........................................................36
Using basic if-then-else statements ...................................................................36
Activity: Using an if-then-else statement..........................................................36
Using multiple if-then-else statements ............................................................37
Activity: Using multiple if-then-else statements.............................................37
Using nested if-then-else statements.................................................................38
Activity: Using nested if-then-else statements.................................................39
Using Select statements.......................................................................................40
Activity: Using Select statements.......................................................................41
Quiz: Creating formulas ............................................................................................43
Lesson summary .........................................................................................................44
Lesson 4
Lesson 5
Lesson 6
vi
Lesson introduction.....................................................................................................89
Defining and creating parameters.............................................................................90
Common uses of parameters..............................................................................90
Creating a parameter with a static prompt......................................................90
Creating a parameter with a dynamic prompt................................................91
Using a parameter in record selection...............................................................92
Responding to a parameter.................................................................................94
Responding to a parameter when refreshing data..........................................95
Using the Parameter Panel..................................................................................96
Creating a saved-data record filter using parameter fields...........................98
Using optional parameters..................................................................................98
Populating prompt values from a database.....................................................99
Using a list of values..........................................................................................101
Sharing common lists of values within a report............................................101
Using separate value and description fields..................................................102
Using command objects as list-of-values data sources ................................102
Null handling......................................................................................................102
Displaying a single-value parameter on a report..........................................104
Describing values and sorting..........................................................................105
Activity: Building a dynamic cascading parameter with optional
prompts................................................................................................................105
Building a report with multiple parameters..........................................................107
Specifying single or ranges of values..............................................................107
Creating a report with multiple prompting values.......................................108
Activity: Building a report with multiple parameters..................................108
Applying conditional formatting using parameter fields............................109
Activity: Displaying a multiple value parameter on a report.....................110
Deleting a parameter from a report.................................................................111
Using edit masks and descriptions.........................................................................113
Using an edit mask.............................................................................................113
Using a description............................................................................................114
Activity: Using an edit mask............................................................................114
Creating date range parameters..............................................................................116
Date and DateTime parameters ......................................................................116
Creating a date range parameter.....................................................................116
Activity: Creating and displaying a date range parameter..........................117
Grouping using parameters.....................................................................................118
Creating a report with dynamic grouping ....................................................118
Activity: Defining grouping using a parameter............................................118
Quiz: Building parameterized reports ...................................................................120
Lesson 7
Lesson introduction...................................................................................................123
Building a basic crosstab...........................................................................................124
Defining crosstabs..............................................................................................124
Creating a crosstab.............................................................................................125
Creating a crosstab object in an existing report.............................................126
Activity: Building a basic crosstab object........................................................132
Formatting a crosstab................................................................................................134
Using the crosstab formatting options............................................................134
Creating a customized crosstab style..............................................................137
Activity: Formatting a crosstab........................................................................139
Conditionally formatting a crosstab ...............................................................140
Adding a chart to a crosstab report ................................................................141
Activity: Highlighting and charting crosstab data........................................142
Adding Calculated Members...........................................................................143
Activity: Adding Calculated Members to a crosstab....................................144
Quiz: Summarizing data with crosstabs ................................................................147
Lesson summary........................................................................................................148
Lesson 8
vii
Lesson summary........................................................................................................168
Lesson 9
viii
Lesson introduction...................................................................................................169
Using the Running Total Expert..............................................................................170
Creating a running total field using the Running Total Expert..................170
Placing a running total field in a report..........................................................171
Choosing evaluation and reset options...........................................................172
Creating conditional running totals................................................................173
Activity: Using the Running Total Expert......................................................174
Creating a form letter................................................................................................176
Planning and creating a form letter.................................................................176
Using conditional messaging in a form letter................................................177
Adding a picture to a form letter.....................................................................178
Activity: Creating a form letter........................................................................178
Adding a hyperlink to a report................................................................................181
Creating a hyperlink field.................................................................................181
Activity: Adding a hyperlink to a report........................................................182
Using dynamic graphic locations............................................................................184
Inserting a linked object....................................................................................184
Working with linked objects.............................................................................185
Activity: Using dynamic graphic locations....................................................186
Building a report with alerts....................................................................................187
Creating a Report Alert.....................................................................................187
Editing a Report Alert .......................................................................................189
Deleting a Report Alert......................................................................................189
Viewing Report Alerts.......................................................................................189
Referencing Report Alerts in formulas...........................................................190
Activity: Building a report with Report Alerts..............................................191
Building a top N report.............................................................................................192
Creating a top or bottom N report...................................................................192
Creating a parameterized top or bottom N report........................................194
Activity: What information will you see?.......................................................194
Activity: Building a top N report.....................................................................195
Integrating Flash........................................................................................................197
Integrating Shockwave Flash (SWF) objects...................................................197
Adding an Xcelsius SWF object to a report....................................................198
Using data binding to bind an Xcelsius SWF object to a report..................198
Activity: Integrating an Xcelsius Flash file into a Crystal report................199
Quiz: Building specialized reports..........................................................................201
Lesson summary........................................................................................................202
ix
Answer Key
AgendaLearners Guide
xi
Using sections
Using group-related functions to format sections
Using section underlay
Formatting with multiple columns
Lesson 9
xii
xiii
Course description
Crystal Reports 2008 is a powerful, dynamic, actionable reporting solution that helps you
design, explore, visualize, and deliver reports via the web or embedded in enterprise
applications. This course is designed to give you comprehensive skills and in-depth knowledge
to plan and create reports that will help you analyze and interpret information.
Course audience
The target audience for this course is report designers who are responsible for creating and
distributing reports and have completed Crystal Reports 2008: Report Design I - Fundamentals
of Report Design.
Prerequisites
You should have completed Crystal Reports 2008: Report Design I - Fundamentals of Report
Design. If you have taken a previous version of Report Design I - Fundamentals of Report
Design, then you should have completed Crystal Reports 2008: Quickstart.
To be successful, you must have working knowledge of:
Windows conventions
Basic database concepts
Experience using a web browser
Additional education
To increase your skill level and knowledge of Crystal Reports, the following courses are
recommended:
Crystal Reports 2008: Report Design III - Report Processing Strategies
Crystal Reports 2008: Report Design IV - Optimizing Report Data
xiv
As a business benefit, you will be able to increase your understanding of formulas, variables,
arrays, templates, parameters, summaries, and sections, which will help you make more effective
report design decisions and create more efficient reports.
Course setup
Refer to the setup guide for details on hardware, software, and course-specific requirements.
Course materials
The materials included with the course materials are:
Name card
Learners Guide
The Learners Guide contains an agenda, learner materials, and practice activities.
The Learners Guide is designed to assist students who attend the classroom-based course
and outlines what learners can expect to achieve by participating in this course.
Evaluation form
At the conclusion of this course, you will receive an electronic feedback form as part of our
evaluation process. Provide feedback on the course content, instructor, and facility. Your
comments will assist us to improve future courses.
xv
Learning process
Learning is an interactive process between the learners and the instructor. By facilitating a
cooperative environment, the instructor guides the learners through the learning framework.
Introduction
Why am I here? Whats in it for me?
The learners will be clear about what they are getting out of each lesson.
Objectives
How do I achieve the outcome?
The learners will assimilate new concepts and how to apply the ideas presented in the lesson.
This step sets the groundwork for practice.
Practice
How do I do it?
The learners will demonstrate their knowledge as well as their hands-on skills through the
activities.
Review
How did I do?
The learners will have an opportunity to review what they have learned during the lesson.
Review reinforces why it is important to learn particular concepts or skills.
Summary
Where have I been and where am I going?
The summary acts as a recap of the learning objectives and as a transition to the next section.
xvi
Retrieve information and find answers to questions using the online and/or users guide
that are included with the product.
Lesson 1
The BusinessObjects Enterprise Repository is the central location for you to store and manage
your report objects.
After completing this lesson, you will be able to:
Use the repository
Create a report from a repository data source
The repository
The repository is the central location for you to store and manage your report objects. These
objects are then accessible to users and report developers for use in new reports that can be
distributed throughout your company.
Physically, the repository is a database that stores supported object types. These types include:
Text objects
Bitmaps
Custom functions
SQL commands (queries)
List of values
Universes
Tip: Hover your mouses cursor over any object in the Repository Explorer to see a tooltip. Tooltips
include author and description information for text objects and bitmaps. Tooltips also include the
complete text of the SQL statement.
The Repository Explorer might appear in a docked position in the Report Designer depending
on where it was when you last used Crystal Reports. You can drag it where you like, or dock
it elsewhere. The Repository Explorer can also be docked as a tab, similar to the Design tab,
along with the Report Explorer.
The toolbar in the Repository Explorer provides buttons with tooltips. These buttons let you
expand subfolders, add new folders, search for items, and perform other tasks:
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) Server
This button changes to Logoff Server when you are logged into the repository. Use this
option to log on or off the server.
You can organize the contents of the repository by creating folders and subfolders in its tree
view.
Instructions
1. Log into the BusinessObjects Enterprise using the Logon Server button in the Repository
Explorer.
2. Create folder named Report Design II in the Repository Items folder of the Repository
Explorer.
Once report items are in the repository, they can be shared between many reports. Each person
who uses Crystal Reports can connect to the repository and choose items to add to a report.
When you add an object to the repository, that object becomes "connected" to the repository.
As long as an object remains connected, you can update any report that uses that object with
the latest version in the repository.
Instructions
1. Open Accessing the repository-1.rpt.
Custom functions are added to the repository through the Formula Workshop and commands
are added through the Database Expert.
2. The Copyright text object is located in the Text Objects folder of the Repository Items
Folder. Insert the Copyright text object into the page footer and center it on the page.
3. Add a text box below the chart in the Report Header. Type Report Designed for Marketing
Department - NY in the text box.
4. Create a folder in the repository called Custom Objects.
5. Add the marketing text box to the new folder calling it Marketing Department. Fill in the
name as Administrator and use any description.
For internal use by CSC only
Note: When you delete an object from the repository, it appears to remain connected in the reports
that use it. When you try to update repository objects for those reports, a warning message is shown
in the Missing Repository Items dialog box so you can quickly identify the object. Use the Report
Explorer dialog box to find the object in the report, then you can disconnect it.
Note: If you have deleted an object from the repository, creating a new object with the same name
and adding it back to the repository does not relink that object to your reports. Each repository
object has a unique ID; linking is not done by name.
Instructions
1. Open Repository-2.rpt.
2. Add the copyright text object from the repository to the report in the page footer.
Note: The copyright text object can be found in Repository items Text Objects.
3. Ensure you select the option to update connected repository objects on opening.
Tip: To change options, go to: File Options Reporting Update Connected
Repository Objects on Open.
4. Save the report as Repository-added item.rpt and close the report.
5. Open the report Using objects in the repository.rpt from the previous activity.
6. Disconnect the Copyright text object from the repository.
7. Change the Copyright text object to 2008 and add the Copyright text object back to the
repository using its original name.
8. Save the report as Modifying objects and updating reports.rpt and close the report.
9. Open the Repository-added item.rpt.
10.What changes do you notice?
11.Re-save Repository-added item.rpt.
12.Delete the Copyright text item from the repository and close Repository-added item.rpt
and Crystal Reports.
Note: You may get the Log on server screen for the Repository Explorer when you restart
Crystal Reports.
Note: A display message informs you that it could not find the deleted repository object.
Does the report still work?
Your report should look similar to this:
13.Restart Crystal Reports and open Modifying objects and updating reports.rpt.
SQL Commands
Using SQL Commands in Crystal Reports is similar to using stored procedures. Stored
procedures, written and stored in the database, can increase the efficiency with which data is
brought to the report. SQL Commands do the same. While stored procedures are more efficient
because they are precompiled, SQL Commands are more efficient because they return a subset
of data. As well, some report requirements, such as grouping and summing, can be performed
on the data before it arrives at the report.
An SQL Command is different than a stored procedure because it can be written within Crystal
Reports so the report writer does not need write access to the reporting database.
If the database you are using supports a query language such as SQL, you can write your own
commands which are represented in Crystal Reports as a Table object. This allows database
users complete control of the data processing that gets pushed down to the database server. A
user who has experience with databases and the SQL language can write a highly optimized
command that can considerably reduce the data set size returned from the server.
Write your own command by using the Add Command node in the Database Expert to create
a virtual table that represents the results of processing the command. Once the command is
created, you can store it in the repository so it can be shared between many users.
Note: Some of the Crystal Reports native database drivers do not support the Add Command
feature:
DB2 Server
Sybase Server
Informix Online Server
to log onto BusinessObjects Enterprise, after which you can select a universe and design your
query against that universe selecting all desired fields to be made available to the Field Explorer.
To connect to a universe
1. In Crystal Reports, on the File menu, click New, and then click Blank Report.
2. In the Database Expert, double-click Create New Connection.
10
3. Double-click Universes.
Note: Add filters to the Query Filters pane to restrict the data your query returns based on
the object that you selected. Filtering limits the data that a user can see and reduces the
runtime of queries.
5. Click OK.
6. If your query contains prompts, select your prompt value(s) in the Enter Parameter Values
dialog box.
7. If your data source is secure, use the connection dialog box to log onto the database that
your universe uses.
11
Note: For information about using the Enter Parameter Values dialog box, search for the
dialog box by name in the Crystal Reports Online Help.
For the purposes of this activity, the Xtreme1 universe is your test environment and the Xtreme2
universe is your production environment.
Instructions
1. Create a new blank report.
2. In the Database Expert, create a connection to the Xtreme1 universe.
Enter the required BusinessObjects Enterprise logon information.
3. Select the Customer Name, Last Year's Sales, Country, and Region objects for your query.
4. In the Database Expert dialog box, move Xtreme1_query to Selected Tables and click OK.
5. Add all the fields from Xtreme1_query to the Details section of the report.
6. Preview the report.
7. View the Xtreme1_query properties in Database Query Panel to verify that the Xtreme1
test environment is the query's data source.
8. Change the data source location for the report to the production environment Xtreme2
universe.
9. Refresh the report.
The report should look the same as it did before you changed the data source.
10.View the query properties in the Query Panel to verify that the report uses the Xtreme2
universe as a data source.
11.Save the report as Creating a report from a repository data source.rpt.
12
When you publish a report to the production environment, you need to perform a Set Location
in order for it to report on the production universe.
13
and
3. True or False. If an item or folder is deleted from the repository it is permanently removed.
4. When saving text object or bitmap images to the repository, you can use all the following
characters in the object's name:
A) $ * " ! @
B) . # ^ & ~
C) % ! * ^ )
D) ; @ ~ $ *
5. True or False. Any object stored in the repository can be deleted but those objects must also
be deleted from the report.
6. True or False. All Crystal Reports native drivers support the Add Command feature.
7. Custom functions can be added to the repository through the
8. True or False. The Set Datasource Location feature makes it possible to create a query based
on one universe and then apply it to a new universe.
14
Lesson summary
After completing this lesson, you are now able to:
Use the repository
Create a report from a repository data source
15
16
Lesson 2
Creating Formulas
Lesson introduction
Crystal Reports offers powerful formula capabilities to expand the functionality of your report.
For internal use by CSC only
17
18
For example, try typing AV then CTRL + Spacebar. Average is the only function or operator
that matches, thus Crystal Reports completes the entry. However, if you type DATE then CTRL
+ Spacebar, it displays a list of all the functions that begin with those characters.
For a list of more keyboard shortcuts, consult online Help topic Formula Editor Key Controls
(via the Index tab).
1. Enter Help by pressing F1, selecting Crystal Reports Help from the Help menu, or clicking
the ? button on the Formula Editor toolbar.
2. Select the Index tab.
3. Type in the keywords Functions or Operators.
4. Scroll through the list of functions or operators to the name of the function or operator youd
like to examine.
5. Click the desired item.
The item is now highlighted.
6. Click the Display button on the bottom left of the window.
Alternatively, double-click the desired item.
Descriptive information about the function or operator is displayed in the right pane of the
Help window.
Result
19
Functions
Result
Length(Text_String)
11
Length("_Center_")
The Trim function removes leading and trailing spaces from string arguments.
Use this function any time there are leading and/or trailing blanks in a text object that may
interfere with an alignment of text strings, a character count, or with a calculation (if the string
is eventually converted to a number).
The following example is applicable to both Basic syntax and Crystal syntax:
Functions
Result
abcde
String operators
You can use string operators to concatenate (join) text strings, to extract substrings from text
strings, or to test for the presence of substrings in text strings.
Operators are case-sensitive. For example, ABC is not equal to abc. Nor is abc in the
string ABCDEF.
Concatenate operator (x+y) and Concatenate(x&y)
Subscript (y[x])
Concatenate (x+y)
and Concatenate
(x&y)
Concatenate (x+y) and Concatenate (x&y) are synonymous if both operands x and y are
strings.
Concatenate (x+y)
Concatenates the values of x and y, and returns the result as a string; x and y must both be
strings.
The following examples are applicable to both Basic syntax and Crystal syntax:
"Bread" + " and " + "butter"
Returns "Your customer name is Bicicletas Buenos Aires and your company contact person
is Carlos".
20
Trim(Str)
Concatenate (x&y)
Concatenates the values of x and y, and returns the result as a string; x and y can be different
data types Number, Boolean, Currency, Date, Time, DateTime, and String.
The following examples are applicable to both Crystal syntax and Basic syntax:
10 & 20
Returns the string 10.0000020.00000 where the number formatting for this formula field
specifies five decimal places.
Returns the string TrueFalse.
"The meeting is " & #Nov 15, 1999#
Subscript extracts one or more characters from a text string or extracts an element from an
array.
The subscript ranges are 1-based; they start at 1 rather than 0.
Subscript
Behavior
x[y]
x[y to z]
LNAME [1]
Postal [6]
{customer.POSTAL CODE} [5 to 7]
{file.ITEMNUMBER} [4 to 5]
21
Instructions
1. Using the Crystal Reports Help system, match the descriptions to the correct items.
For internal use by CSC only
Length
Description
22
Trim
Right
Not
Replace
F. Evaluates the field specified in the current record and returns TRUE
if the field contains a null value.
x&y
Picture
Instr
I. Extracts the given number of text characters from the left side of
the specified string.
Left
J. Extracts the given number of text characters from the right side of
the specified string.
IsNull
ToText
Item
The Left() function is passed a string to be manipulated as the first argument. The second
argument is a number indicating how many characters starting from the left of the string need
to be extracted.
The ToText() function can take different types of fields and convert them to strings. In this
case, there is one argument that is a number.
The formula to extract the left-most digit from the order number is as follows:
Left(ToText({table.order_number}),1)
Instructions
1. Create a new report using the Employee table from the Xtreme Sample Database.
2. Create a formula named Name that displays the first initial and last name of each employee.
3. Create a formula named Account that concatenates the last three digits of the extension
field with the fifth through eighth digits of the SSN field.
4. Display the Emergency Contact Phone in a specific format:
If the phone number is 10 digits then format it as (555) 555-5555
If the phone number is not 10 digits then format it as 55-555-5555
5. Display the first sentence of the notes field. Make sure there are no leading or trailing spaces.
Make sure the entire sentence displays and doesnt stop at an abbreviation.
6. Save the report as Using string functions and operators.rpt.
The report should look like this:
23
For example, you can nest the ToText() function inside the Left() function to help return the
first digit of the order number.
Numeric functions evaluate the value of a number and manipulate the output based on the
value of that number. These functions are helpful when evaluating large groups of data. A
numeric function also allows you to identify patterns in data.
RoundUp, MRound, Ceiling, and Floor are all examples of numeric functions.
Tip: Remember to search Help if you are unsure of the functions and formulas.
RoundUp(x, num_digits)
RoundUp returns a number that has been rounded up. This function rounds up (away from
zero).
X is a real number to be rounded and num_digits is a whole number indicating the number
of decimal places to which x will be rounded.
MRound (x, multiple)
MRound returns a number that has been rounded to the multiple that you specify. This function
rounds up (away from zero) if the remainder of the division is greater than or equal to half
of the value of the multiple. X is a real number to be rounded to a multiple of the second
number. For example, MRound (127.75, 5) returns 130.
Ceiling(x, multiple)
Ceiling returns a number that has been rounded to the multiple that you specify. This
function rounds up (away from zero). Values are always rounded up when they are adjusted
24
away from zero (without regard to the sign of the value). If the number is an exact multiple
of the multiple, no rounding occurs.
X is a value to be rounded. Multiple is a multiple that you want to round the x value to. For
example, Ceiling (5,3) returns 6.
Floor returns a number that has been rounded to the multiple that you specify. This function
rounds down (away from zero). Values are always rounded down when they are adjusted
away from zero (without regard to the sign of the value). If the number is an exact multiple
of the multiple, no rounding occurs. X is a value to be rounded. Multiple is a multiple that
you want to round the x value to. For example, Floor (5,3) returns 3.
Instructions
1. Open the report Working with rounding formulas.rpt from the course resources.
Note: This report is based on Customer Orders. Currency fields show dollars and cents
and quantities range from zero to three.
2. Create a new formula called Estimated Order Amounts.
3. The Estimated Order Amounts formula should return a rounded dollar value for the
customers orders so that an estimate can be made of their future orders.
In the Estimated Order Amounts formula add the following syntax:
RoundUp({Orders.Order Amount}, 0)
4. Place the field on the report to the right of the Order Amount field.
5. Format the new field to have no .00 showing.
25
Floor(x, multiple)
6. Delete the Order Amount field and move the Estimated Order Amounts field next to the
Order ID field.
7. Create a new formula called Max Quantity to ship.
8. The Max Quantity to ship formula should return the maximum number of units to ship
given that all units ship in multiples of two.
In the Max Quantity to ship formula place the following syntax:
Ceiling({Orders_Detail.Quantity}, 2)
9. Place the Max Quantity to ship field on the report to the right of the Quantity field.
10.Format the new field to have no decimals showing.
26
The numbers have rounded to the dollar value and the cents are no longer visible.
11.Create a new formula called Min Quantity to Ship that evaluates the value of the Quantity
ordered and rounds down to the nearest even value using this syntax:
Floor({Orders_Detail.Quantity}, 2)
12.Place the field on the report to the right of the Max Quantity to ship field.
The first record (Order ID = 1) has a value of 1 in the Quantity field, and now has a
corresponding value of 0 in the Minimum Quantity to Ship field.
27
Where the Quantity field shows an odd number, the Max Quantity to ship field has been
rounded up to the next even number.
MRound({Orders_Detail.Unit Price}, 1)
17.Place the Unit Price Estimates field on the report to the left of the Unit Price field.
18.Format the new field as a number using the $(1,123) style.
The rounding has shown where cents are below 50, it has been rounded down and where
they are equal to or above 50, have rounded up to the next dollar.
19.Delete the Unit Price field.
20.Save the report as Using numeric functions.rpt.
For internal use by CSC only
intervalType is a String expression that is the interval of time you use to calculate the
difference between startDateTime and endDateTime.
28
Description
yyyy
Year
Month
Day of year
Day
Weekday
ww
Hour
Minute
Second
IntervalType Value
Returns 3.
DateAdd
DateAdd returns a DateTime value to which a specified number of time intervals have been
added.
DateAdd is used to add intervals of time to a DateTime. Its main feature is that the DateTime
returned is always valid. For example, DateAdd takes into account such factors as the number
of days in a month and leap years. If you want to add or subtract days to a DateTime, you could
29
use the addition and subtraction operators instead of DateAdd with the d parameter. However,
DateAdd also handles other types of intervals such as adding months or hours to a DateTime.
DateAdd (intervalType, nIntervals, startDateTime)
intervalType is a String expression specifying the interval of time to be added. Values can
be:
Description
yyyy
Year
Month
Day of year
Day
Weekday
ww
Hour
Minute
Second
Returns the DateTime value for February 29, 1996. Notice that DateAdd will not return the
invalid value February 31, 1996.
30
IntervalType Value
Instructions
Item
Description
DateDiff
DateAdd
DatePart
DateSerial
IsDate
Date
Year
Day
H. Returns a Date value for the specified year, month and day. It also
handles relative Date expressions.
Instructions
1. Add Order ID, Order Date and Ship Date to the Details section.
2. Create a formula named Time to Ship that displays the number of days it took to ship each
order.
31
1. Using the Crystal Reports Help system, match the description to the correct item.
3. Create a formula named Day of Month that displays only the day of the month when each
order was shipped.
Use the Ship Date field to verify your result.
4. Create a formula named To be Shipped By that displays a date 10 days later than the order
date.
5. Add Day of Month and To be Shipped By to the report details.
6. Save the report as Using date and time functions.rpt.
For internal use by CSC only
Returns 11.
{file.QTY1} + {file.QTY2}
32
Divide (x/y)
Returns 5.
Returns .333333.
Percentage (x%y)
Returns 30.00, where {file.BALANCE OUTSTANDING} = $1500 and {file.CREDIT LIMIT} = $5000.
{file.AMOUNT} % {file.CREDIT LIMIT}
A And B means that both A and B must be true for the condition to be satisfied (to return a
TRUE value).
The following example is applicable to Crystal syntax using the And operator in Record Selection:
33
1/3
A Or B means that either A or B (or both) must be true for the condition to be satisfied (to return
a TRUE value).
Not
If A=5, B = 4, C = 3, the expression (A>B and B>C) is TRUE. Both conditions tied together by
the Boolean operator And are TRUE; thus, the entire statement has a value of TRUE. The Not
operator changes the value of the expression to FALSE.
Instructions
1. Create a new report using the Employee table from the Xtreme Sample Database.
2. Display the employees first initial and last name (for example, J. Smith).
3. Insert the Hire Date and Current Salary. Remove the time portion from the Hire Date.
4. Format the headings to stand out.
5. Use Boolean formulas to indicate:
Anyone with a hire date year of 1991 and a salary greater than 75,000.
Anyone with a hire date year of 1993 or a salary less than 30,000.
All the employee first names that do not start with an X.
Note: These formulas should all return Yes/No results.
34
Or
35
Tip: The data type must be the same for the Then and Else parts of the formula (text, numeric,
date). For example, if the Then part of the formula prints a text string, the Else part of the formula
must also print a text string.
Instructions
1. Open Using Boolean operators.rpt used in the previous activity.
2. Remove the Boolean formulas from the screen.
3. Use an If-Then-Else control structure to indicate only the 1991 hire year. Rename the formula
to Hire Year 1991.
4. Save the report as Using if then.rpt.
36
Formulas without control structures execute each expression in the formula exactly once when
the formula is evaluated. The expressions are executed in a sequential fashion, from the first
expression in the formula to the last. Control structures enable you to vary this rigid sequence.
Depending upon which control structure you choose, you can skip over some of the expressions
or repeatedly evaluate some expressions depending on if certain conditions hold. Control
structures are the primary means of expressing business logic and typical report formulas make
extensive use of them.
Each statement is evaluated in order, until a True is returned. If all statements are false, the
final Else will be the output.
Instructions
1. Open Using if then.rpt.
37
2. Create a formula called Salary Category to display "Upper Range" for employees with a
salary above $75,000, "Mid Range" for employees with a salary between $50,000 and $75,000,
and "Low Range" for those with a salary below $50,000.
3. Add a Salary Category column to the report.
4. Save the report as Using multiple if then else.rpt.
Your report should look similar to this:
Field 2
Result
38
Else
"Action Y"
Else
The If part of the expression can include text, numbers, Boolean expressions (Cust#<"10000"),
and formulas ({@Formula}), where @Formula is Boolean. The Then and the Else parts, however,
must both be of the same type (then text, else text; then number, else number). Mixing text and
number actions results in an error message.
Instructions
1. Open the report Using multiple if then.rpt.
2. Rename the Hire Year formula field to Raise. Rename the field heading Hire Year to Raise.
3. Use the following chart to modify the Raise formula so it will calculate the appropriate
raise.
Year Hired
1991
1992
1993
Salary Range
Raise
>75,000
10%
35,000 - 75,000
8%
<35,000
6%
>45,000
9%
<= 45,000
7%
>55,000
9%
39
"Action Z"
Year Hired
Raise
30,000 - 55,000
6%
< 30,000
4%
> 70,000
10%
<= 70,000
5%
40
1994
Salary Range
Default Action:
The default case is matched if none of the preceding cases match the select condition. Notice
that there is also a colon after the default. The default clause of the select expression is optional.
If the default clause is missing and no cases are matched, then the select expression returns the
default value for its expression type.
For example, to evaluate the {Customer.Fax} field to determine if the area code is for Washington
state (206, 360, 509), or British Columbia, Canada (604, 250), if the first three numbers of the
{Customer.Fax} are not found in the case statements then nothing is printed.
Select left({Customer.Fax},3)
Case 604, 250: BC
Case 206, 509, 360: WA
Default: ;
Instructions
1. Open the report Using nested if then.rpt used in the previous activity.
2. Modify the Raise formula by changing the multiple If-then-else statement into a SELECT
statement.
3. Save the report as Using select statements.rpt.
41
The expression immediately after the Select keyword is called the select condition. The
expression tries to find the first case that matches the select condition, and then executes the
action following the colon for that case. Notice that a select condition can be tested by one or
more select expressions in the same case.
42
43
Lesson summary
After completing this lesson, you are now able to:
Use functions and operators
Define control structures available in Crystal syntax
44
Lesson 3
Managing Reports
Lesson introduction
Once your reports have been created with Crystal Reports you can manage your reports using
the Workbench and BusinessObjects Enterprise.
After completing this lesson, you will be able to:
Use the Workbench
Publish reports to BusinessObjects Enterprise
45
46
Note: You can also double-click an Explorer's title bar to change between docked and
free-floating mode. In free-floating mode, the Explorer can be dragged to any position.
When you drag the Explorer, a placement frame shows you where it will be placed. You
can also resize an Explorer by dragging any of its edges with the Resizing cursor.
Think of the items in folders in the Workbench as shortcuts or pointers that allow you to quickly
access a report in a distant location. In the Workbench, a project acts as a container used to
organize these shortcuts to existing reports stored in different locations. When a project is
published to BusinessObjects Enterprise as an object package, it can be accessed through
Enterprise by those with the correct permissions.
47
48
When you publish a report to BusinessObjects Enterprise, an entry is made in the Central
Management Server (CMS) database. This database stores published reports which can be
viewed in the BusinessObjects Enterprise system. You can also publish a collection of reports
to the Enterprise system by creating an object package in the Workbench and then publishing
that object package to BusinessObjects Enterprise.
49
5. Click OK.
13.Click Next.
The wizard confirms the success or failure of each file.
14.Click Finish if you were successful. If you were unsuccessful, make the necessary changes
to the file(s), verify file locations, and click Retry which reruns the wizard.
Objective
Add reports you have created to the Workbench, and publish them as an object package to
BusinessObjects Enterprise.
The report in this activity must be saved without data. If saved with data BusinessObjects
Enterprise will not prompt you for the parameter.
Instructions
1. Open the Workbench.
2. Add a new project named Report Design II to the Workbench.
3. Add all the report files you saved during your progress through this course to the Report
Design II folder.
Once complete, your Workbench should look similar to this:
4. From the Workbench, select the project and publish to BusinessObjects Enterprise in theUser
Folders Administrator folder.
50
CustomerID
CustomerName
EmailAddress
Region
After you save this new report to BusinessObjects Enterprise, the publisher specifies it as the
DRDP for the brochure publication. The publisher maps the CustomerName and EmailAddress
fields from your new report to the user name and email address fields for the publication. The
publisher then personalizes the brochure based on the Region field.
When the report is published, the new customers receive the brochure that is appropriate for
their region.
51
As a report designer, your role is to create a report that lists data about the intended recipients.
The publisher then uses this report to create a distribution list and personalize the publication.
A DRDP can return several different data types. If the publication is personalized, ensure that
the data type of a column is compatible with the corresponding field in the personalized report.
DRDPs support the following data types:
String
Number
DateTime
Boolean
Region
Role
RCPT123
California
Manager
RCPT123
Florida
Manager
All rows with the same recipient ID value are processed as one recipient. If you plan to distribute
a publication with multiple values for a recipient, it is best to sort the DRDP by recipient ID,
so that rowsets are grouped by recipient. Failure to follow this sorting guideline may result in
the generation of separate publication instances and the delivery of documents with partial
information.
52
When designing a DRDP, you must create a column to be mapped to recipient ID. You can
also include optional columns for email address and full name.
If multiple rows in the rowset have the same recipient ID but different full names or email
addresses, the publishing system treats this as a single recipient and results in one delivery.
For that recipient, the system uses the first full name and email address to appear in the report.
If the DRDP contains parameters, the default parameter value set in the Central Management
Console (CMC) will be used. The publisher is not able to change parameter values at publishing
time.
Region
Role
RCPT123
California
Manager
RCPT123
Florida
Team Lead
RCPT123
Florida
Manager
Column Mapping
53
In addition to choosing a report as the data source for recipient information, the publisher is
also able to specify whether data is refreshed from the database live, or whether saved data
from the latest instance is used.
When a publication contains multiple reports, column mapping for personalization is specified
individually for each report. Across the reports, they may link to the same or different columns,
as illustrated in the example below.
Rowset:
Recipient ID
Region
Role
CostCenter
RCPT123
California
Manager
9876
RCPT123
Florida
Team Lead
9876
RCPT123
Florida
Manager
9876
Column Mapping
Report A: Report field: Dept <--> CostCenter column
Report B: Report field: Title <--> Role column
Report C: Report field: Region <--> Region column and Role <--> Role column
These are the resulting filters for each report:
Report A: Dept = 9876
Report B: Title = 'Manager' or Title = 'Team Lead'
Report C: (Region = 'California' and Role = 'Manager') or (Region = 'Florida' and Role
='Manager') or (Region = 'Florida' and Role = 'Team Lead')
54
13.Click Finish.
You have created a list of dynamic recipients that connects to a datastore.
14.Save the report to BusinessObjects Enterprise.
You can create a folder in which to save the report, or you can save the report to a
predetermined location on the Enterprise system. This report is the one that the publisher
uses to create a distribution list and personalize the publication.
55
The DRDP report displays the desired information about your intended recipients. After creating
this report, you need to run the Server Intelligence Agent under an account with access to your
corporate network.
If you use BusinessObjects Enterprise to publish reports, you can use Report Alerts to create
delivery rules. A delivery rule allows the publisher to specify criteria for the conditional delivery
of a publication. The publisher specifies these rules in the CMC or InfoView, but they are based
on Report Alerts added by the report designer during report creation.
Be aware of these considerations when you use delivery rules:
Because delivery rules are based on Report Alerts, the criteria for conditional delivery are
always evaluated in the context of the report content.
The same delivery condition is evaluated for each recipient on the recipient list.
For publications scheduled to be printed, the print-out is produced regardless of the delivery
rule result. This happens because printing occurs at the report processing phase, which is
before the evaluation of the delivery rule.
As report designer, your role is to create the Report Alert upon which a delivery rule is based.
At publishing time, the publisher uses the Report Alert to design the delivery rule in
BusinessObjects Enterprise.
56
The conditional data does not need to be from a report included in the publication. The
publisher can create a delivery rule based on any document stored in BusinessObjects
Enterprise.
At publishing time, depending on business requirements, the publisher either:
- Personalizes the publication and creates a recipient delivery rule based on your Report Alert.
or
- Creates a global delivery rule based on the Report Alert. The global rule is evaluated before
the publication is processed.
57
If the conditional data is not in a currently existing report, you must create a report that
contains it.
If you have indexed the saved data by one or more fields, however, Crystal Reports already
knows which records contain particular values. Consequently, when a user accesses a particular
subset of the saved data from the indexed field, Crystal Reports can locate and format the
appropriate records more efficiently.
Once you have created Saved Data Indexes, they work entirely in the background. Users don't
know that the saved data is indexed, and the grouping, sorting, or formatting of the report
doesn't change at all. The indexes merely allow Crystal Reports to locate particular records
quickly, without passing through the saved data in its entirety.
Available Fields
This list shows all of the report and data source fields available for indexing. Some fields are
better than others to choose for indexing.
58
With a non-indexed report, Crystal Reports has to look at every record in order to locate values
that meet specified criteria. For instance, when a user requests a particular subset of the saved
data, or when a user requests the report but only has rights to access certain records, Crystal
Reports filters the saved data by checking each record for the appropriate values.
Auto
Click this button to automatically add fields that are used in Record Selection formulas.
Use the > arrow between the two lists to add fields to the Indexed for Bursting list from the
Available Fields list. Use the < arrow to remove fields you've already added. The double arrow
removes all fields.
Browse Data
Click this button to browse the field data. Click the Close button to return to the Saved Data
Indexes dialog box.
59
Arrow buttons
60
Lesson summary
After completing this lesson, you are now able to:
Use the Workbench
Publish reports to BusinessObjects Enterprise
61
62
Lesson 4
Note: The discussion in this lesson is specific to Crystal syntax and does not cover Basic syntax.
After completing this lesson, you will be able to:
Use variables
Use arrays
63
Variables and arrays are both placeholders for values in a formula. A variable holds one value
at a time but an array can hold a number of values.
Using variables
The formula language becomes very powerful through the use of variables. Crystal Reports
enables you to use variables in formulas to streamline formulas and expand formula capabilities.
Define variables
Declare a variable
Assign a value to a variable
Reference a variable in a formula
Defining variables
A variable represents a specific data item, or value, and acts as a placeholder for that value.
When a formula encounters a variable, the formula searches for the value of the variable and
uses it in the formula. Unlike a constant value, which is fixed and unchanging, a variable can
be repeatedly assigned different values. You assign a value to a variable and the variable
maintains the value until you later assign a new value. Because of this flexibility, you must
declare variables before you use them so that Crystal Reports is aware of them and understands
how you intend to use them.
To use a variable in a formula, you must:
Declare the variable.
Assign the value of the variable.
Reference the variable.
Declaring a variable
Crystal Reports requires you to declare all variables prior to using them. When you declare a
variable, you tell the program:
1. Scope - where you would like the variable to be available.
2. Data Type - the type of data you want the variable to hold.
3. Name - the name you intend to use for the variable.
The program uses this information to set aside a piece of memory for receiving and storing the
values that are assigned to the variable.
64
Global variables can be referenced and used in any formula within a single report. If no
report of a single report. The shared variable can be referenced and utilized more than once
and by more than one subreport.
Local
declared.
Tip: If you declare a Global variable with the same name and data type in two or more formulas,
the formulas share the same variable name and value. Thus, if one formula sets the value of
the variable, the variable in the second (and additional formulas) reflects the change. Local
variables are the most efficient of the three scopes since they occupy the least amount of space
in memory. In addition, they do not interfere with one another in different formulas. For these
reasons, it is best to declare variables to be local whenever possible.
Separating commands
When you have multiple statements in a formula, you separate the statements using a semicolon
so that Crystal Reports knows where one statement ends and the next begins. It is important
65
Local variables can only be referenced and utilized within the formula in which they are
to remember that without semicolons, Crystal Reports treats the entire formula as a single
statement, even if the commands are separated by a carriage return.
When declaring a variable, add a semicolon at the end of the declaration statement.
Some sample variable declaration statements are:
Assignment operator
:=
Value
100
Semi-colon
;
66
Global StringVar y;
Local NumberVar My_Number;
Shared BooleanVar bTest;
Referencing a variable
Referencing a local variable
To refer to a variable within a formula, use its name. For example, if you declare a number
variable called NumVar and you wish to add 100 to this variable value, write:
NumVar := NumVar + 100
To display the contents of the NumVar variable as the result of your formula, write:
You must write out the instructions for extracting the area code from the telephone number
field (left({customer.FAX},3)) every time you want the formula to use the area code from
the current record.
By using a variable (for example, sCode), you write those instructions only one time.
StringVar sCode := left({customer.FAX}3)
If sCode = "604"
Then "BC"
Else if sCode = "206"
Then "WA"
Else if sCode = "808"
Then "HI"
Else "Unknown"
Using those instructions, the program automatically extracts the area code from the
{customer.FAX} field, and stores it in the variable each time it reads a new record. Reference
the variable sCode whenever you want to use the area code from the current record in your
formula.
67
NumVar
Instructions
2. Enhance the Raise formula by replacing Employee.Hire Date with a local variable to figure
out the year and test the variable for the proper year.
3. Add another local variable that replaces the salary amount.
4. Save the report as Using a variable.rpt.
Your report should look similar to this:
5. Add a formula that contains a variable to store a Cost of Living Increase amount of 2%.
6. Increase the employee salary amount by the cost of living increase amount, and then calculate
the raise.
7. Add a text box to the report header that states Cost of Living increase: x% (x being the cost
of living increase amount).
Note: Display the increase as a whole number without any decimal places.
8. Save the report as Referencing variable values between formulas.rpt.
68
69
Using arrays
Variables are used to hold one value whereas an array is used to hold multiple values.
After completing this unit, you will be able to:
Defining an array
When there are two or more data items, the collection of data items is given a single name
instead of giving each data item a separate variable name. This collection is called an array.
The individual data items contained in an array are known as the array elements. The elements
in the array are numbered by their position in the array, referred to as an index.
Note: Crystal Reports supports single dimensional arrays with a maximum size of 1000 elements
only.
There are two types of arrays; static and dynamic . In a static array the elements are set and
remain the same every time the report is run, regardless of the data included on the report. In
a dynamic array the elements of the array change based on the data included on the report.
In order to use an array within Crystal Reports, you must:
declare the array
assign a value to the array
reference elements of the array
Declaring an array
Crystal Reports requires you to declare all arrays prior to using them. Declaring an array is
similar to declaring a variable. It requires four elements: scope, data type, the keyword array,
and a name.
Scope Datatype Array Name;
For example,
Global StringVar Array MyArray;
70
Define an array
Declare an array
Assign values to an array
CurrencyVar - currency
DateVar - date
TimeVar - time
DateTimeVar - date/time
StringVar - string
For example,
MyArray := [car, bus, taxi];
For example, to reference the second value of the array declared in the various modes of
transportation example:
MyArray[2]
For example, to change the value of the second element of the MyArray array:
MyArray[2] := airplane;
71
The data types correspond to the data types used throughout Crystal Reports.
Tip: Remember to search Help for any functions on which you may need additional information.
1. Create a new report using the Employee table from the Xtreme Sample Database.
Note: Do not include any fields on the report.
2. Create a formula called Class Names and declare an array variable to store the first names.
3. Assign the following values as elements of the array: Jim, Hans, Jacques, Hitomi.
4. Add your own name as the last element in the array.
5. Display your name in the report using the array.
6. Save the report as Building and referencing an array.rpt.
Your report should look similar to this:
72
Instructions
Instructions
2. Make a second formula Display Class Names that references the variable from the Class
Names formula using the JOIN function.
3. Separate each element with a comma and a space , .
4. Save the report in the Workbench as Referencing an array between formulas.rpt.
Your report should look similar to this:
73
3. Rewrite the variable declaration to make it work. Assume the declaration is at the beginning
of a formula that has more than one statement.
currencyVar cSalary
4. Rewrite this array declaration to make it work, assuming that the statement is not at the
end of the formula.
global numberVar CustomerID := [345, 894, 938]
74
Lesson summary
After completing this lesson, you are now able to:
Use variables
Use arrays
75
76
Lesson 5
Report Templates are a quick and efficient means of applying standardized formatting to
multiple reports.
After completing this lesson, you will be able to:
Apply report templates
Build a template without a data source
Remove a template
77
78
Your report appears with its data formatted to match the template you selected.
Note: Any drill-down tabs, alerts, or analyzer views that are open will be closed before the
template is applied.
Instructions
1. Open Basic report_1.rpt.
2. Apply the Gray Scale template to the report.
3. Save the report as Using a predefined template.rpt.
Your report should look similar to this:
79
Instructions
1. From the Workbench, open Basic report_1.rpt.
2. Use the existing report named Template report.rpt to format Basic Report_1.
3. Save the report as Using an existing report as a template.rpt.
80
81
Crystal Reports allows the flexibility of creating a template without having to be connected to
a data source.
Template Field Objects can create more flexible report templates. These report objects do not
refer to existing database fields. Put them in your template report and format them as required.
When applying the template to another report, Crystal Reports displays that reports data with
the formatting specified. Therefore, when designing a template, knowing which data might be
in the report isnt necessary. Use Template Field Objects to take care of all the possibilities.
Template Field Objects are applied only to result fields: database fields, parameter fields, SQL
expression fields, and formulas. Special Fields are not considered result fields.
82
For each Template Field Object, a special formula field is created. You can see this formula
field in the Formula Workshop under the Formula Fields node.
1. In the Field Explorer, expand the Formula Fields node, select a Template Field Object, and
click Edit.
Tip: In the Formula Fields node of the Field Explorer and the Formula Workshop, Template
Field Objects appear as <TemplateField>.
2. In the Formula Editor, replace the Space(10) section of the argument with a database field
of the type you want to see in your sample, save your change, and close the Formula
Workshop.
3. Refresh your reports data.
Instructions
1. Create a new Crystal Report without using a data source.
2. Insert two new template objects into the Details section.
3. Group on the second template object and delete it from the Details section.
4. Format all the objects on the report page with aqua font and a gray background.
5. Rotate the Page Header text object 90 degrees and make it bold. Stretch the box to about an
inch in height.
6. Add a Business Objects Logo from the course resources and place it in the Page Footer.
7. Go to File Summary Info and give the report the title My Template.
8. Save the report in the template directory. Name the file Building a template without a
data source.rpt.
83
Note: To add sample data to a Template Field Object formula, you must have a data source.
84
Removing a template
The results of template application may not be exactly as you want so removal of the template
may be necessary.
After completing this unit, you will be able to:
Remove an applied template
Perhaps, after applying a template, you do not like the changes made to your report. As long
as you have not exited Crystal Reports since you applied the template, you can remove it from
your report.
Instructions
1. Open the report named Basic report_1.rpt.
2. Apply the template My Template to the report.
My Template is based on the report Building a template without a data source.rpt.
85
5. What are the four types of fields that Template Field Objects can be applied to?
86
Lesson summary
After completing this lesson, you are now able to:
Apply report templates
Build a template without a data source
Remove a template
87
88
Lesson 6
Parameters allow you to collect input from the report user and run the report based on the
input.
After completing this lesson, you will be able to:
89
90
6. To move all the field values to the Values area, click Actions and select Append all database
values.
7. In the Value Options area, enter the desired prompting text in the Prompt Text field (up
to 255 alphanumeric characters).
This is the text that appears in the Enter prompt values dialog box when the report is
refreshed.
8. Click OK.
9. Place the parameter using a static prompt into your report.
If you don't want to see the parameter field you dropped in your report, place it in a section
you can suppress, such as a report header or footer.
91
5. From the Value Field list, select the field of your choice.
For example, if you know that your sales force is rapidly expanding the regions that your
company sells to, you might schedule your region list of values to be updated every night.
Users who run a report that contains the region list of values will see the new values without
you having to manually update the list (as you would have to do with a static prompt).
92
When you look at your dynamic prompt within Crystal Reports, it does not seem to be much
different from a static prompt. In the background, however, Crystal Reports stores the
information about the list of values that you created for this prompt. When you publish the
report to BusinessObjects Enterprise, the list of values becomes a separate entity that you can
schedule in the Business View Manager to ensure that the values are updated on a schedule
that you choose.
code, date range, or other value in the record selection. Create a parameter field and use it in
your record selection to allow for flexible reporting. When running the report you can type the
part code, date range, or other value you want for this occurrence of the report.
One of the most common uses of a parameter is in record selection (Select Expert).
6. Click OK.
7. Click the Preview tab.
The Enter prompt values dialog box appears.
8. Select the value you want to base the report on.
93
For example, to easily modify a report for various regions, use a parameter field in place of a
specific region value {Customer.Country} = {?Country} where {?Country} is a parameter
field you have created. The value you select for the region parameter field is used for the record
selection in that occurrence of the report.
Responding to a parameter
You respond to a parameter in two different situations:
When you run the report for the first time.
When you refresh the reports data.
Note: If you select Prompt for new parameter values, the Enter Parameter Values dialog box opens
allowing you to enter the parameter values.
94
9. Click OK.
The report appears with the information for the prompt value you selected.
When running the report the first time you are prompted to enter a value for any parameter
fields used in your report. Each time you refresh data you are given the option of entering a
new parameter value or using the existing value.
95
96
97
On the panel, data parameters are differentiated from non-data parameters with a database
icon. When a user modifies the value of a data parameter, the report refreshes and accesses the
database to make the corresponding changes. When a user modifies the value of a non-data
parameter, the report is formatted or filtered based on saved data within the report. It does not
access the database.
It allows users to filter and re-filter report data without leaving the canvas of the report.
It eliminates processing demand on the database.
It reduces the time users spend waiting for data to be filtered.
It allows users to filter records 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 saved-data record filter in your report, it is important to consider
the following points:
To prevent report refreshing to the database, only non-data parameters should be added to
the Parameter Panel.
Exported reports retain all recently applied parameter changes.
Subreport parameters cannot be shown on the Parameter Panel.
98
After you set a parameter to optional, if you use the Select Expert, the system automatically
adds the selection formula for you using the HasValue() function.
The Formula Workshop Editor does not automatically add the formula. Only the Select
Expert automatically adds the formula for you.
If you change the parameter from optional to mandatory, the HasValue() function is not
automatically removed from your formula.
When the report engine evaluates any formula which references an optional parameter that
does not have a value, it generates a runtime error. All formulas that reference an optional
parameter should first use the HasValue() function to check if that parameter has a value before
evaluating it. This includes record selection formulas and saved data formulas.
Note: The system will not automatically drop a statement from the SQL WHERE clause. It is
the report designers responsibility to decide which statement to leave out based on HasValue()
testing.
Tip: Although you do not use the function in an activity, a sample formula using the HasValue()
function is available in the course resources. See Activity Resources\Lesson 6\Hasvalue
Syntax.txt.
99
100
4. Type a name for the parameter in the Name field (up to 255 alphanumeric characters).
13.Click OK.
14.Return to the Field Explorer dialog box, and drag the Supplier City parameter into your
report.
15.If you dont want to see the parameter field you dropped in your report, place it in a section
you can suppress, such as a report header or footer.
101
This prompting text appears in the Enter prompt values dialog box when the report is
refreshed.
All the command objects defined in your report appear in the value fields drop-down list, and
in the description fields drop-down list in the Create New Parameter dialog box. You can then
associate your list of values with the command object.
Null handling
Null values in the data returned by the list of values are displayed as null in the drop-down
list for that prompt. Your users can select these values, and any parameters associated with
that prompt receive the null value. You can test for this functionality in the Crystal Reports
formula language with the IsNull function.
102
It is common in relational databases to make use of code fields that represent values. These
codes are often numeric or text strings that cannot be read by your users. For such cases, you
can create separate value and description fields in your list-of-values definition. You set the
value field to the parameter, and the description field appears in the prompting dialog box.
How the description field appears in the prompting dialog box is controlled by the prompt
option Prompt with Description Only. When set to True, only the descriptions are visible.
When set to False, both the values and descriptions are visible.
9. Click OK.
10.Return to the Field Explorer dialog box, select Parameter Fields, and click New.
11.Type a name for the second parameter in the Name field.
This example uses CustomerCity.
12.In the List of Values area, click Dynamic.
13.Type prompting text for your new prompt group in the Prompt Group Text field.
This example uses Choose the City that your customer is located in.
14.Select Existing, and click Country > Region > City.
15.Click OK.
You have created two prompts: a Country, Region, City hierarchy for the {?SupplierCity}
parameter, and a second Country, Region, City hierarchy for the {?CustomerCity} parameter.
By reusing the list-of-values object, you saved time and improved performance time in Crystal
Reports.
Note: You can also use an existing list of values if you have another parameter field that should
have a country value. For example, if you add a {?DivisionCountry} parameter to indicate the
corporate division that you want to report on, you could use the same list-of-values object in your
report. You would bind this parameter to the top-level value in your hierarchythat is, the Country
level of the Country, Region, City hierarchy.
103
8. In the Parameter Binding area, ensure that only the City value is bound.
7. In the Value Options area, set the Prompt with Description Only option to True.
8. Click OK.
9. When users see this prompt in the prompting dialog box, they do not see values from the
Customer ID field (the field on which the parameter is based), but rather, they see a list of
customer names.
If you are using parameter fields in a record selection or formula you may want to reflect this
value somewhere on the report. For example, if you are using the parameter field in record
selection, the report might be used once to display records from PA and another time for CA.
In such a case, the report is easier to understand if the record selection is displayed in the title
of the report.
If you create a text object to display text and the value for the parameter field, you can easily
create a dynamic report title.
Each time you preview the report, the title is displayed with the current parameter fields value.
If you used the parameter field in a formula, you may want to display the value somewhere
in your report, perhaps in a footnote. For example, if you used a parameter field in a formula
for the discount percentage, you could create a text object that displays the discount percentage
used in the report.
104
The Show Current Parameter Values command lets you see all parameter values in the current
report.
This command is located in the Report menu and, when chosen, the Current Parameter Values
dialog box appears.
This dialog box is a read-only version of the Enter Parameter Values dialog box.
Use the Current Parameter Values dialog box to see all the parameter values in your current
report. If no parameters have values, the Parameter Fields list displays the message: <No
parameters have any values>.
Instructions
1. Open Optional Parameter-1.rpt.
2. Create a new dynamic and cascading parameter named Where are they ordering from.
3. Set the parameter type to String, and set Dynamic.
4. In the Prompt Group Text field type Drill down from Country to City.
5. Add the values Country, Region, and City which will all use the parameter named Where
are they ordering from.
Tip: Remember to click in the Parameters area to the right of each value.
6. Select the appropriate Value Option settings to allow the user to bypass entering a value
for this parameter and to allow discrete values.
105
Current values
7. Use this parameter in Record Selection to return records pertaining to a country, then
regions and cities.
8. Save your report as Building dynamic cascading parameters with optional prompts.rpt.
Your report should look similar to this:
106
107
Instructions
1. Open Optional Parameter-1.rpt.
2. Create a static Customer Names parameter that supports multiple values.
Use the names from the Customer Name field as a default pick list for the customers.
3. Create a static Orders Greater Than parameter that selects only records with an order greater
than $1,000, $5,000, $8,000, or a user-specified value.
4. Create a record selection formula that displays only the customers with orders over the
amount specified by the Orders Greater Than parameter.
5. Update the report header label by adding the text Orders Greater than followed by the
Orders Greater Than parameter value.
108
109
3. In the Format Editor, click the Conditional formula button next to the Color property on
the Font tab, and format the field using a conditional formatting formula.
Instructions
1. Open Building a report with multiple parameters.rpt.
2. Create a formula to display the customer names from the parameter created in the previous
activity.
3. Place the formula in the report header under the text object and format it to be displayed
the same way.
4. Preview the report with different values.
5. Remove Order Amount from the Select Expert. Delete the Orders Greater Than title from
the report header.
6. Using the Orders Greater Than parameter, format the Order Amount field to be printed
in red if it is greater than the parameter value entered. Show this formatting condition at
the top of each page.
7. Save the report as Displaying a multiple values parameter on a report.rpt.
Tip: Remember to search the extensive online Help section on functions and formulas.
110
111
2. Expand the Parameter Fields folder and click the parameter you want to delete.
3. Click Delete.
A Crystal Reports dialog box appears confirming deletion.
4. Click Yes.
This parameter is removed from the Parameter Fields folder and from your report.
112
Description
Enables an alphanumeric character and requires the entry of a character in the parameter
value.
Enables an alphanumeric character and does not require the entry of a character in the
parameter value.
Enables a digit [0 to 9] and requires the entry of a character in the parameter value.
Enables a digit or a space and does not require the entry of a character in the parameter
value.
Enables a digit, space or plus/minus sign, and does not require the entry of a character
in the parameter value.
Enables a letter [A to Z] and requires the entry of a character in the parameter value.
Enables a letter and does not require the entry of a character in the parameter value.
&
Enables any character or space and requires the entry of a character in the parameter value.
Enables any character or space and does not require the entry of a character in the parameter
value.
.,:;-/
(separator
characters)
Inserting separator characters into an edit mask is similar to hard coding the formatting for the
parameter field. When the field is placed on the report, the separator character appears in the
113
field object frame. For example, LLLL/0000, which depicts an edit mask that requires four
letters followed by four numbers.
Description
<
>
For example, the edit mask \A would display a parameter value of A. If the edit mask is 00\A00,
then a valid parameter value would consist of two digits, the letter A, and then two additional
digits.
Password
If you set the edit mask to Password, you can create conditional formulas specifying that certain
sections of the report become visible only when certain user passwords are entered. When you
enter the password, the actual letters are replaced by asterisk (*).
Note: Edit mask functionality is only available if the parameter is of a string data type.
Using a description
As the report designer you have the option of displaying the value and the description to the
report viewer or the description only. The value is the exact Boolean, currency, number, string,
date, datetime or time that will be used in the record selection or formula or wherever the
parameter has been referenced in the report. The description can be additional information
about the value that is displayed to the report viewer or it can take the place of the value.
You can add a descriptive message attached to the value. For example, if you have states listed
in their abbreviated two-letter form, you could spell out the state name as the description to
further explain the shortened version as a hint to users not familiar with the USA.
The values and the description can be different data types. For example, a value may be the
number 86 but the description might be the string eighty-six.
Instructions
1. Open Using an edit mask-1.rpt.
2. Create a parameter that shows only regions that contain two characters.
3. Allow the users to select multiple values.
114
Character
4. Remove the record selection based on the customer name and replace it with record selection
based on the region parameter.
5. Reorder the parameters so the region parameter is the first parameter.
Tip: Right-click Parameter in the Field Explorer, and then click Set Parameter order from
the shortcut menu.
6. Update the title formula to show the regions selected.
For internal use by CSC only
115
116
Instructions
1. Open Using an edit mask.rpt.
2. Create a parameter named Order Date Range to allow the user to enter in a start and end
date.
Tip: The dates in this report are stored as datetime fields, not date fields.
3. Add this parameter to a Record Selection from Order Date.
4. Modify the formula title to include the Date Range information.
5. Preview the report with different date ranges.
6. Save the report as Creating and displaying a date range parameter.rpt.
Your report should look similar to this:
117
To set up grouping using parameter fields, create a formula that includes a parameter field
and then group based on that formula.
Using the Product table in the Xtreme database as an example, if you wanted to group by size,
color, or product class, you would create a parameter, for example {?GroupField}, and use it
in a formula. The code for this type of formula would be an If-Then-Else statement:
If {?GroupField} = "S" Then
{Product.Size}
Else
If {?GroupField} = "C" Then
{Product.Color}
Else
{Product.Product Class}
In order to reference this formula on the report, you need to create groups based on the formula.
This formula appears in the list in the Insert Groups dialog box.
When responding to the parameter prompt, if you enter S the formula groups by the Size field.
If you enter C the formula groups by the Color field. If you enter anything else, or do not enter
anything at all, the formula sorts by the Product Class field.
Instructions
1. Open Creating and displaying a range parameter.rpt.
Notice the order information is grouped by customer name.
118
2. Create a parameter named Grouping Options. The prompting text should be Group the
report by City or Customer Name. Make it a String type.
3. Set the default values as City and Customer Name.
4. Create a new formula field named Grouping. If the parameter value equals City then the
formula should result in Customer.City. If the parameter value equals Customer Name then
the formula should result in Customer.Customer Name.
5. Modify Group #2 to be based on this grouping formula.
For internal use by CSC only
119
6. If the discrete values A and G are entered as parameter values used in record selection and
the operator used is the equal sign, what records will be returned?
7. What function(s) would you use to display date ranges on a report?
120
Lesson summary
After completing this lesson, you are now able to:
121
122
Lesson 7
A crosstab object is a grid that displays values that are grouped and summarized in two
directions. This lesson provides you with information about how you can use crosstab objects
in your report.
After you complete this lesson, you will be able to:
Build a basic crosstab
Format a crosstab
123
Lesson introduction
Defining crosstabs
A crosstab object is a grid that returns values based on the criteria you specify. Data is presented
in compact rows and columns. This format makes it easy to compare data and identify trends.
It is made up of three elements:
Rows
Columns
Summary fields
In this crosstab, the rows are comprised of product types and countries are the columns.
The sum value is the count of products by country.
The rows in a crosstab run horizontally (from side to side). In the example above, Gloves
is a row.
The columns in a crosstab run vertically (up and down). In the example above, USA is a
column.
The summary fields are found at the intersection of rows and columns. The value found at
each intersection represents a summary (sum or count) of those records that meet the row
and the column criteria. In the example above, the value at the intersection of Gloves and
USA is four, the number of gloves sold in the USA.
A crosstab also includes several totals:
124
Define crosstabs
Create a crosstab
At the end of each row is a total for that row. In the example above, this total represents a
single product sold in all countries. At the end of the Gloves row is the value eight, the total
number of gloves sold in all countries.
Note: The total column can appear at the beginning of each row.
At the bottom of each column is a total for that column. In the example above, this total
represents all products sold in a single country. The value at the bottom of the USA column
is four, the total number of products (gloves, belts and shoes) sold in the USA.
Note: The total column can appear at the top of each column.
At the intersection of the Totals column (totals for the products) and the Totals row (totals for
the countries) is a grand total. In the example above, the value at the intersection of the Total
Column and Total Row is 12, the total number of all products sold in all countries.
Creating a crosstab
You can create a crosstab as:
An object in an existing report.
A new report.
Things to keep in mind when using crosstab objects:
You can have multiple rows, columns, and summarized fields.
You can use print-time formulas as your rows or columns.
You can use Running Total fields as your summarized field.
You can include a group sort (top or bottom N) on the rows in your crosstab.
Note: Group sorting cannot be applied to columns.
You can insert as many crosstab objects in a report as you need.
You can insert the crosstab into either the Report Header or Report Footer, or the Group
Header or Group Footer.
You can place crosstab objects in subreports. This is useful when you want to refer to the results
from another report.
125
In this crosstab, note the last column and the last row contain grand totals.
You can drag and drop fields into the Rows, Columns, or Summarized Fields areas or use the
arrows when the field is selected. A crosstab field can have multiple fields in each box.
All the database and formula fields currently available are listed within the Fields list of the
Cross-Tab dialog box. When you use a database field as a row or column heading, the program
creates one row or column in the crosstab for each unique value in that database field. Each
database or formula field used as a summary field is tabulated for each row and column
intersection in the crosstab object.
You can also create new formulas in the Cross-Tab dialog box to use in the report as well as
change the summary operation and use grouping options. If you use a formula field, the
program creates and labels one row or column for each unique result of the formula.
126
Use the Cross-Tab Expert dialog box to set up the structure that makes up the crosstab.
If you drop a crosstab object in the Details section, it is automatically placed in the Group
Header section of the report because the Details section does not accept crosstabs.
You cannot place the crosstab object into sections that give you a stop cursor on your screen.
If you drop the crosstab object before you place it into position, the program drops the object
in a section that accepts crosstabs. You can then click it and move it into the desired position.
4. From the Format menu, select the Cross-Tab Expert command.
The Cross-Tab Expert dialog box opens.
For internal use by CSC only
This dialog box is made up of three tabs: Cross-Tab, Style, and Customize Style.
5. Drag the field you want to use as row headings from the Report Fields list to the Rows area.
You can also click the field in the Report Fields list then click the > arrow to add the field.
This field becomes the horizontal information.
6. Drag the field you want to use as column headings to the Columns area.
You can also click the field in the Report Fields list then click the > arrow to add the field.
This field becomes the vertical information.
7. Drag the field to summarize to the Summarized Fields area.
This field must be a value that both the rows and columns have in common.
You can also click the field in the Report Fields list then click the > arrow to add the field.
8. Click Group Options to apply additional structure to the crosstab by adding groups, if
needed.
9. Click the Style tab.
10.Select a predefined style.
127
If you prefer to create your own format for the crosstab, click the Customize Style tab, then
customize the style as desired.
11.Click OK to exit the Cross-Tab dialog box.
12.Refresh the report to view the results.
Creating a crosstab with the Wizard is similar to creating a crosstab object with the Cross-Tab
Expert.
1. On the File menu, click New , and then click Cross-Tab Report.
The Cross-Tab Report Creation Wizard appears.
2. On the Data screen, locate the data source you want to use.
3. Select the tables that contain the fields to include in the report.
Tip: Use the Ctrl+click combination to pick a non-continuous range of tables and the
Shift+click combination to pick a continuous list of tables.
4. Click Next.
The Link screen appears. Verify that the linking is correct.
5. Click Next.
The Cross-Tab screen appears.
128
6. Add the appropriate fields to the crosstab rows, columns, and summary fields by clicking
the > next to each area.
Tip: You can also add fields to the different crosstab areas by selecting and dragging them
to the Columns, Rows, or Summary Fields areas.
7. Select the summary operation you want to perform on the summary field from the list
beneath the Summary Fields area.
8. Click Next.
The Chart screen appears.
9. Select the kind of chart you want to see in your report:
Bar Chart
Line Chart
Pie Chart
Note: If you do not want to add a chart, leave No Chart selected.
10.Change the default charting information to suit your report.
129
11.Click Next.
The Record Selection screen appears.
Use this screen to apply selection conditions. This limits the results that are returned in your
report to only those records that you are interested in.
12.Select the field to apply the selection to.
13.Click the > arrow.
The field is added to the Filter Fields area and the filter types list appears below it.
14.From the filter types list choose a filter method.
15.In the filter values list that appears, select the value(s) you want to filter on, and then click
Add.
16.Click Next.
The Grid Style screen appears.
17.Select a style.
130
The text areas are automatically populated with the appropriate information.
18.Click Finish.
The Cross-Tab report appears in the Preview tab.
131
If you do not want the crosstab to appear in the Report Header, click the Design tab, and
move the crosstab to the Report Footer, Group Header, or Group Footer.
Note: If you place the crosstab in the Report Footer, right-click in the Report Footer grey
area and then select Dont Suppress to remove the footer suppression.
With crosstab objects, you can interchange the rows and columns. Once you have created and
previewed your crosstab you may decide that you would prefer to display the column information
as rows or vice versa. Change this by choosing the Pivot option from the shortcut menu.
Instructions
1. Open Crosstabs-1.rpt.
2. Place the crosstab in Group Footer 1.
3. Use:
{Supplier.Supplier Name} and {Product.Product Name} as the rows.
{Customer.City} as the column
Extended Price (formula) as the summarized field
4. Customize the style of the crosstab so that row totals display on the right and column totals
display at the bottom.
5. Have each region on a separate page.
6. Save the report as Building a basic crosstab object.rpt.
132
133
Formatting a crosstab
Basic crosstabs show summarized data in its simplest form. To make crosstabs easier to read
and more meaningful, formatting is used.
Format a crosstab
Create a customized crosstab style
Conditionally format a crosstab
Highlight exceptions in a crosstab
Add a chart to a crosstab report
134
1. Right-click the blank top-left area of the crosstab and select Cross-Tab Expert from the
shortcut menu.
The Cross-Tab Expert opens.
2. Click the Customize Style tab.
3. Click the row (in the Rows area) or column (in the Columns area), and select a color from
the Background Color drop-down list.
4. Click OK to return to the crosstab.
The row/column formats as specified.
Note: You can also apply separate background colors to row and column totals.
1. Right-click the row or column whose label you want to customize and select Format Field
from the shortcut menu.
The Format Editor appears.
2. On the Common tab, click the conditional formatting button adjacent to Display String.
3. In the Format Formula Editor, create formula text that describes the custom names you
want to use as well as the conditions under which these names should be applied.
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 Close.
You return to the Format Editor dialog box.
7. Click OK to return to your crosstab.
Your customized row and column names appear when the conditions you set are matched.
135
136
3. Select either the Suppress Empty Rows or Suppress Empty Columns check box.
When you create a crosstab that is wider or longer than the specified page size, the program
automatically spans the printing process across enough pages to accommodate the size of the
crosstab. In the Preview tab, a line appears at each page break. For ease in reading, column
headings are repeated on subsequent pages. Row headings can also be repeated.
1. Right-click the blank top-left area of the crosstab and select Cross-Tab Expert from the
shortcut menu.
The Cross-Tab Expert opens.
2. Click the Customize Style tab.
3. Select the Repeat Row Labels check box, and then click OK.
Columns
This list displays the columns you selected for your crosstab. Select the field for which you
want to customize the style.
Rows
This list displays the rows you selected for your crosstab. Select the field for which you want
to customize the style.
Summarized Fields
Use the options in this area to determine how multiple-summarized fields are to be displayed.
Vertical
Choose this option to display multiple-summarized fields in a vertical list:
Summary 1
Summary 2
Summary 3
Horizontal
Choose this option to display multiple-summarized fields in a horizontal list:
137
Summary 1
Summary 2
Summary 3
Show Labels
Choose this option to display the names of multiple-summarized fields. Labels can be displayed
for both vertical and horizontal summaries. These labels can also be modified by editing them
as you would any text field.
Use this check box to suppress the subtotal for a selected field. You must first have a field
selected in either the rows list or the columns list.
Suppress Label
Use this check box to suppress the label of a suppressed subtotal field. This check box is inactive
if the Suppress Subtotal check box is not selected.
Background Color
Use this list to select a color for the selected row or column field.
138
Suppress Subtotal
Select this check box if you want row totals to appear on the left of the crosstab rather than on
the right (the default position).
Instructions
1. Open Building a basic crosstab object.rpt.
2. Include {Orders Detail.Quantity} as a second summary field in the crosstab.
3. Add the following formats:
Your users have been using crosstabs and would like another summary. They would also
like to have some formatting and styles added to the crosstab.
No decimal places for the {Orders Detail.Quantity} second summary field.
Each summary field to be a different color.
Column and row headings to stand out.
139
140
2. In the Highlighting Expert, click New to create a new conditional formula with default
settings.
3. In the Item editor area, click the Value of list and select the field that you want to base your
condition on.
Note: The field chosen here is the field upon which your condition is based and does not
need to be the field that is being formatted. To create a condition based on the values of the
field that is being formatted, select this field from the list. To base your condition on a
different report field, select it from the list of available fields.
The Value of list displays only those fields that you have added to the report.
4. Select a comparison from the second list (for example, is equal to, is less than, or is not
equal to).
This comparative statement works as the operator in the conditional formula created by the
Highlighting Expert.
5. Complete the condition by entering the desired value in the box.
Note: If the field selected in the Value of list is not numeric, the text box turns into a list of
available values, from which you must select one.
6. In the Font style, Font color, Background, and Border lists, specify the formatting changes
that you want to apply to the selected field when your condition is met.
Repeat steps 3 and 4 if you want to apply multiple highlighting conditions to the selected
field.
Note: You can use the Highlighting Expert Remove button to delete highlighting formulas
from the list.
7. Use the Priority arrows to specify the order in which you want Crystal Reports to apply
your conditions, and then click OK to return to your report.
141
The Highlighting Expert opens and displays the current formatting settings for the selected
cell.
Objective
Create a crosstab report with highlighting and a chart that corresponds with the crosstab
information.
Instructions
The users want a graphical view of the crosstab and key performance numbers should be
indicated (KPI).
1. Open Formatting a crosstab object.rpt.
2. Highlight the Extended price:
Green background and a white font color that meet or exceed $5000
Red background and white font color that fall below $500
Lime background and white font color that exceed $20000
3. Insert a chart using the crosstab as the starting point:
4. Add a note before the crosstab that describes the highlighting conditions.
5. Save the report as Highlighting exceptions and charting crosstab data.rpt.
142
143
Instructions
1. Open Variance Cross Tab_1.rpt.
2. Add a Calculated Member row that displays the difference between Sales Revenue and
Sales Returns. Select Sales Returns as the first value in the Calculated Member, so that the
Calculated Member row appears in the correct location on the report.
3. Change the header of the Calculated MemberDifference row to Net Sales.
4. Modify the Net Sales calculation formula to add all Revenue items, except Sales Returns
which is subtracted. Use the following formula:
Tip: You can copy the formula syntax for this activity from the code.txt file located in the
course resources in the Activity_Resources lesson folder.
GridValueAt(GetRowPathIndexOf("Revenue", "Sales Revenue", "Bike Sales Competition"), CurrentColumnIndex, CurrentSummaryIndex)
144
7. Preview the report. The new Calculated Member column displays the correct results for
1/1/2005, but the results for 2/1/2005 are identical, indicating that the calculation is incorrect.
Modify the calculation formula to make the calculation relative to each month's Budget and
Actual values. Use the following formula:
GridValueAt(CurrentRowIndex, CurrentColumnIndex-1, Current SummaryIndex) GridValueAt(CurrentRowIndex, CurrentColumnIndex-2, CurrentSummaryIndex)
145
146
4. What are the three available chart types when creating a crosstab report using the Standard
Report Wizard?
5. What does the Pivot Cross-Tab option do?
6. What Crystal formatting function would be used to conditionally format a field element,
field object, summary or label in a crosstab?
7. How would you suppress an empty column in a crosstab?
147
3. What happens if you attempt to place a crosstab object into a section that does not allow
crosstab Objects?
Lesson summary
After completing this lesson, you are now able to:
Build a basic crosstab
Format a crosstab
148
Lesson 8
149
Using sections
With the ability to conditionally format and organize sections you are able to make reports
multi-layered.
The ability to apply formatting to sections on a conditional basis greatly increases the power
and flexibility of reporting. For instance, you can conditionally apply background colors to
sections.
150
3. In the Section Expert dialog box, select the section you want to conditionally format.
4. Choose the Common or Color tab.
5. Click the Formula button to the right of the section property you want to set.
The Format Formula Editor dialog box opens.
6. Enter the conditional formula to apply the attribute formatting.
7. Click Close on the toolbar to exit the Format Formula Editor, and then click OK.
8. Preview your report.
151
The Section Expert appears with a list of all the sections in the report. When there are more
than one of any kind of section, the sections are lettered A, B, C, and so on.
Note: The program enables only those options (free form, new page before, and so on) that
apply to the highlighted section.
2. Highlight the section you want to insert a section after.
For example, to add another Details section, highlight the existing Details section.
To split a section
1. Move the pointer over the left boundary of the section you want to split.
2. When the pointer becomes a Section Splitting cursor, click the boundary and drag the pointer
into the section.
3. When a horizontal line appears, drag it up or down to split the section the way you want
it.
152
3. Click Insert.
Deleting sections
Once your report has multiple sections of the same type, you have the option to delete sections.
There are two methods for deleting a section:
Using the Section Expert.
In the Design tab or Preview tab.
Moving sections
The general order of the five default sections is set and unchangeable. However, multiple
sections of the same type are movable.
153
Merging sections
You can merge multiple sections of the same type.
154
Note: You can also move sections by dragging and dropping them in the Report Designer.
4. With Section (B) highlighted, click Merge and Section (C) will be merged with Section (B)
to form one section.
155
Instructions
1. Open Employee List-1.rpt from the course resources.
2. Below the personal information, add a new details section containing the following company
information:
Position
Extension
Social Security Number (display only the last four digits)
Birth Date (do not display the time)
Hire Date (do not display the time)
3. Insert another details section containing the following emergency contact information:
Name
Relationship
Phone
Address 1
Address 2
City, Region and Postal Code
156
Not OnLastRecord
Instructions
1. Open Creating and merging sections.rpt.
2. In the personal information and contact information areas of the report there is a gap
whenever the Address2 or Emergency Contact Address2 fields contain no information.
Improve the formatting of the report by suppressing the Address2 and Emergency Contact
Address2 fields when they are empty.
3. Format the report so that the contact information area displays only if the Emergency Contact
Relationship value is either Husband or Wife.
4. Save the report as Applying conditional formatting to sections.rpt.
157
158
DrillDownGroupLevel
DrillDownGroupLevel returns a number that indicates the group level of the current drill-down
number that you can place on your report. You can use this function in a group selection formula
to print some groups and exclude others.
InRepeatedGroupHeader
InRepeatedGroupHeader returns a Boolean value.
the report in a formula that you can then use in your report.
You can use this function any time you want to print the group selection formula on the report,
or whenever you want to set something as conditional on the group selection formula.
159
Instructions
1. Open Organizing formatting.rpt.
2. Each employee name should appear with either a blue or purple background (alternate each
color).
3. Save the report as Group functions.rpt.
Your report should look similar to this:
160
161
Normally when you place an object in a section the object prints in the section where it is placed.
When you use the Underlay Following Section attribute, the object underlays or is placed
under the following sections. This functionality enables you to display a graph for a group next
to the groups details, display a watermark in the reports background, or use a scanned image
of a form as a guide in setting up a report to print on preprinted forms.
You place the object in a separate section then apply the underlay attribute.
When you use the Underlay option, the section can underlay multiple sections with enough
space to display the data. But a section cannot underlay its sister sections.
A Page Header section can underlay all sections up to, but not including, the Page Footer.
A Group Header section can underlay all sections, but only up to its matching Group Footer
section.
Therefore, if you underlay the Group Header section and an object in the Group Header section
is wider than the entire Details section, the program will create white space between the end
of the Details section and the beginning of the Group Footer section.
To underlay sections
1. Place only the object you want to underlay in a section.
If you want the objects in this section to be printed next to objects in the following sections,
you may also want to move the objects left or right.
2. From the Report menu, select the Section Expert command.
The Section Expert dialog box appears
3. Select the section you want to underlay.
4. Select the Underlay Following Sections check box.
162
5. Click OK.
6. Preview your report.
The section formatted to underlay is now under the following section(s).
Your report should look like this:
163
If you highlight an area in the Section Expert, the formatting applies to each section within
that highlighted area. If you select a section, the formatting applies to only that section.
Instructions
1. Open Using group-related functions to format sections.rpt.
2. Format the report so that the employee images from the Employee.Photos field display to
the right of the employee information.
3. Save the report as Using underlay in a report.rpt.
Your report should look similar to this:
164
Instead of having your data print straight down the page, you can set up multiple columns
and have the data flow from column to column.
165
1. Create a new report using the Customer table from the Xtreme Sample Database.
2. Insert one text box in the Details section that includes:
166
Instructions
167
Lesson summary
After completing this lesson, you are now able to:
Use sections
Use group-related functions to format sections
Use section underlay
Use multiple-column reporting
168
Lesson 9
169
Note: A running total field can be used to calculate a total on any database or formula field. A
running total field cannot be used to calculate the total of a print-time formula.
Running totals are totals that are displayed generally on a record-by-record basis. They total
all records (in the report, in the group, and so on) up to and including the current record.
The most basic form of running total is a single running total maintained throughout a list. For
example, if your first three records have values of 2, 4, and 6, the running total for each of the
three records would be:
170
Running Total
2=0+2
6=2+4
12 = 6 + 6
The following procedure demonstrates a running total using a sum operation, adding each
value to the next. Other operations are available such as average, count, and distinct count.
171
Values
Page Header
Group Header
Details
Group Footer
Page Footer
Report Footer
172
Report Header
Use the On change of field option to have your running total perform its evaluation only
when a specified field has changed.
On change of group
Use the On change of group option to have your running total perform its evaluation only
when a specified group has changed.
Use a formula
173
Select the Use a formula option to have your running total use a formula when performing
its calculations.
2. In the Running Total Name box enter a name, for example, Total Orders.
3. Select the field to be totaled in the Available Tables and Fields box, and use the first arrow
button to move it over to the Field to summarize box.
4. Select the appropriate type of summary from the Type of summary list.
5. In the Evaluate section of the dialog box, click Use a formula, and then click the Formula
button.
The Formula Workshop appears with Running Total Conditional Formula active.
6. Enter a formula in the Formula box.
7. When the formula has the correct syntax, click Close.
You return to the Create Running Total Field dialog box.
8. In the Reset section of the dialog box, click Never.
9. Click OK to save the running total field.
The program returns you to the Field Explorer dialog box.
10.Place the running total field in the Details section of your report.
11.Preview the report to see the results.
Instructions
1. Open Running totals-1.rpt.
2. Create a running total called RT Grand Total that calculates the Grand Total for all order
amounts.
3. Create a running total called RT Subtotal that calculates the subtotal for order amounts for
each customer.
4. Create a running total called RT Count that counts the total number of orders in the report.
174
5. Create a running total called RT Conditional Count that counts the number of orders greater
than $5000.
6. Add appropriate bolded labels for each running total field.
7. Insert identical summary objects to confirm the RT Grand Total, RT Subtotal, and RT Count
amounts are correct.
8. Save the report as Using the running total expert.rpt.
Your report should look similar to this:
For internal use by CSC only
175
If you are embedding database fields into a multiple-line text object, you may find that blank
lines appear in the text object if some of the database fields do not contain values. For example,
you might have a text object that contains address information from a database. Some addresses
have two lines; others may only have one. To conditionally suppress this blank line, use
Suppress Embedded Field Blank Lines from the Format Text option from the shortcut menu.
If a database field that contains no values is placed alone in a section on a report, you can
conditionally suppress the entire section by using the Suppress Blank Section option.
176
6. Enter text, database fields and other information into the text object.
This section is the body of your letter.
177
You now have the main body of your report displaying one letter per page. At this point
you can add address information to the page header and format the text objects themselves.
Instructions
1. Create a new report.
2. Create one text box that contains the address information in the page header. Addresses
should be in this format:
{Customer Name}
178
3. On the Paging tab, select the New Page After End of Section check box, and then click OK.
Note: Address 2 may not always contain a value. Format the report so that there is no gap
when the Address 2 field is empty.
3. Create the Thank You message using one text box in the Details section. Each customer
letter must start on a new page. The message should be in this format:
Dear {Contact First Name},
Sincerely,
Xtreme
4. Create the supportive message in another details section. The message should be in this
format:
Dear {Contact First Name},
Our sales team will be contacting {Customer Name}. We are sure that together we can improve
upon last years sales of {Last Year's Sales}.
Sincerely,
Xtreme
Note: Ensure the last page is not blank.
5. Format the report so the Thank You letter is sent to distributors with sales greater than
$25,000, and all other distributors receive the supportive letter.
6. Suppress any unnecessary sections.
Ensure that the draft.bmp image appears behind each letter.
7. Save the report as Creating form letters.rpt.
179
We would like to thank {Customer Name}. With total sales of {Last Year's Sales},
{Customer Name} played a significant part in making last year a successful one.
180
You can select a report object on the Design or Preview tab and create a hyperlink to another
location.
The hyperlink is saved with your report and is available to other users as a way of viewing
additional information.
Note: Crystal Reports also lets you create hyperlinks with Relative URLs, so your web reports
retain independence from their location on any particular server.
181
Note: Not all hyperlink types are available at all times. The object you select and its
location on the report determine which types are available.
4. After you have chosen a hyperlink type, enter the appropriate hyperlink information (the
URL of a website, for example).
5. Click OK when you are finished.
The hyperlink is inserted as appropriate. Click the hyperlink on the report to go to the
website, send an email, and perform other tasks.
Instructions
1. Create a new report using the Customer table in the Xtreme Sample Database.
2. Create a Customer Name column formatted as Last name, First name.
3. Sort the list by last name.
4. Create a website link using this format:
www.{Customer Name}.com
182
Select this option if you want the program to create an email hyperlink out of the field
you selected. The field must be stored as a proper email address in your data source.
183
A dynamic static OLE object is a picture or metafile that you access in Crystal Reports by use
of a file path or URL. Typically, you use this option when you have the path to your pictures
or metafiles stored as a string field in a database (that is, you do not have the actual objects
stored in the database). You can also use this option when you have pictures or metafiles stored
on a network share, and you know these objects change occasionally.
The functionality of these dynamic static OLE objects (or dynamic graphics) is created in Crystal
Reports through the use of a conditional formatting formula that allows you to link to static
OLE objects by reference.
After completing this unit, you will be able to:
Insert a linked object
Work with linked objects
184
You can now place pictures and graphics in a report through a link stored in a database, so
that it is no longer necessary to store images within the database. This feature supports the
common practice of storing images on a web server and storing references to those images in
a database.
5. When the object frame appears, place the picture in your report.
6. Right-click the picture, and notice that the picture is identified as an OLE object on the
shortcut menu.
When you double-click the object, nothing happens. A static OLE object cannot be edited.
1. Right-click the static OLE object that you inserted, and choose Format Graphic from the
shortcut menu.
Note: You begin the process of making a static OLE object dynamic by inserting the object
into your report as usual. This object becomes the default object. If Crystal Reports cannot
find the dynamic reference to the object, it uses the default object instead.
2. In the Format Editor, click the Picture tab, and then click the Conditional Formula button
adjacent to the Graphic Location label.
3. In the Formula Workshop, create the path to your static OLE object.
For example, if your path is stored in a database field, add that field to the formula.
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 your static OLE object.
Note: Consult the Online Help topic Making a static OLE object dynamic for more detail on
why the refresh is necessary.
185
Reports turns the object into a static object, a standalone object that can neither be edited using
OLE capabilities nor converted into an editable OLE object.
Instructions
1. Open the No graphics.rpt.
Four countries appear in the Group Tree list.
2. In the Group Header insert the sample image canadianflagsmall.jpg from the resource
CD.
A Canadian flag appears in the group header for all four countries.
3. Build a dynamic graphic location formula that formats the report so that each countrys flag
appears in the group header for that country.
Tip: Use the Group name in your formula.
4. Save the report as Using dynamic graphic locations.rpt.
Your report should look similar to this:
186
187
5. If you want to use a formula to create an alert message, click the Formula button to the right
of Message.
6. Type your alert message formula.
For example, if you want to see the message Country is a star performer (where Country
is the name of a specific country), you might create this formula:
({Customer.Country}) + " is a star performer"
The DefaultAttribute function can be used to refer to a message added in the Message
box. For example, if the message in your Message box is is a star performer, your alert
message formula might be:
({Customer.Country}) + DefaultAttribute
This formula relies on the text you type in the Message box; that text becomes the
DefaultAttribute.
Message condition formulas can be created using either Crystal syntax or Basic syntax.
7. Click Condition.
The Formula Workshop appears.
8. Enter your alert condition formula.
Alert formulas can be based on recurring records or on summary fields, but cannot be based
on print-time fields such as running totals or PrintTime formulas. Alert formulas cannot
have shared variables.
If an alert formula is based on a summary field, any recurring fields used must be constant
over the summary field. For example, if you are grouping on Country, Region, and City,
you might create an alert such as:
Sum ({Customer.Last Years Sales}, {Customer.Region})
In this case, your formula can refer to either Country or Region, but not City or Customer
Name since these are not constant.
Note: Alert-condition formulas can be created using either Crystal syntax or Basic syntax.
9. Clear the Enable check box if you do not want the alert to be evaluated.
Otherwise, leave it selected.
10.Click OK to save your alert.
You are returned to the Create Alerts dialog box and your new alert is listed. You can see
its name and status (Enabled or Disabled).
Only enabled and disabled alerts appear in the Create Alerts dialog box. If an alert is
triggered, it is seen in the Report Alerts dialog box.
188
189
2. In the Create Alerts dialog box, select the alert you want to edit and click Edit.
Note: If you want to view alerts when report data is refreshed, you must select Display Alerts on
Refresh on the Reporting tab of the Options dialog box (this option is also available on the Report
Options dialog box).
190
Instructions
For internal use by CSC only
1. Create a new report using the Customer table from the Xtreme Sample Database.
2. Show the customer names, city and last years sales amount.
3. Group by region for only USA.
4. Create an alert that shows the regions with two or fewer customers.
5. Save the report as Creating a report with alerts.rpt.
When refreshed, your report should look similar to this:
191
1. Create a report and summarize the data as desired. When you summarize the data, the
program breaks the data into groups and summarizes each group.
With top N groups, you are instructing the program to display those groups that have
the highest summary values (Top N).
With bottom N groups, you are instructing the program to display those groups that
have the lowest summary values (Bottom N).
2. Click the Group Sort Expert button on the Expert Tools toolbar.
The Group Sort Expert appears with a tab for your group.
Note: If you have multiple groups, the program displays a tab for each of the groups.
3. Choose Top N or Bottom N from the first drop-down list.
4. Choose the summary that you want to base your selection on from the summary drop-down
list on the right.
192
The summary drop-down list is for those cases in which you have multiple summaries
within a single group section. For example, in an orders report, you might sum and average
the orders for each customer and then display both the sum and the average in the same
group section. In such a case, you would select the sum or the average from this drop-down
list.
5. In the Where N is text box, enter the number of groups you want to display. For example:
Note: If using Top N or Bottom Percentage you define the percentage values instead of
the number of groups.
The records returned are a complete set of records for the group or groups that add up to
that percentage.
For example, suppose you had the following groups:
Group 1 = 40%
Group 2 = 25%
Group 3 = 15%
Group 4 = 10%
Group 5 = 10%
If you set the Bottom Percentage to be 20, you get only the records for Group 4 and Group
5.
If you set the Top Percentage to be 25, you get all the records for Group 1.
6. Click the Include Others, with the name check box and enter a name if you want to group
all the other records into a single group.
7. Select Include ties to accommodate groups whose summarized values are equal.
For example, suppose you had the following groups:
Order 1 = 100
Order 2 = 90
Order 3 = 80
Order 4 = 80
If you set your Top N to three, but you do not select Include ties, your report will show
Order 1, Order 2, and Order 3.
If, in the same scenario, you do select Include ties, your report will show Order 1, Order 2,
Order 3, and Order 4 even though N is set as three. In this way, the program accommodates
the equal values of orders 3 and 4.
8. Click OK when finished.
When you run the report, only those groups that you specified are included.
193
To report on the three fastest selling product lines, set N to be equal to three.
To report on the five least productive sales regions, set N to be equal to five.
194
Note: For percentages, the top or bottom N value must be between 0 and 100.
Instructions:
Score
Joe
5.3
Tom
4.7
Kathy
3.8
Pete
3.8
Bob
3.2
David
3.0
Sue
2.6
Dan
2.6
Kelly
2.2
Linda
2.1
Runner
Instructions
1. Open the report Group sort expert.rpt in the course resources.
2. Show only the top four shippers. Include ties, and do not include Others in the report.
195
196
Integrating Flash
Flash integration allows report authors to embed any SWF file into a report. This feature includes
the ability to pass data from Crystal Reports into SWFs created in Xcelsius.
After completing this unit, you will be able to:
Report header
Group header
Group footer
Report footer
Note:
You must have Adobe Flash Player 9 installed on your machine to test the functionality of
the Flash object.
To view a report that contains a Flash object, you need a viewer that supports Flash rendering
such as the .Net Webform or the Java DHTML viewers.
Reports that are exported or printed will display the default image that you have set instead
of the SWF object.
The only format that will display SWF objects in exported reports is PDF. However, if the
object contains data binding to the report, the default image is displayed instead of the SWF.
197
In the Design view, if you choose to insert an SWF that contains an embedded movie or sound,
you will hear the sound, but you will not see the movie play. This may cause an echo when
you switch to the Preview view.
Consult with your system administrator to find out how to resolve this issue, or check the
Business Objects support site for more information.
198
Note:
You can bind data to one detail item in the report. Select fields from the tables to bind to
existing variables in the Flash Data Expert.
Note: If a recurring field is selected, only the first instance is sent.
Instructions
1. Open Flashint_Workshop-1.rpt.
2. Insert the Xcelsius Flash file Simple Pie Chart.swf into the report header.
3. Use the Flash Data Expert to map the {Customer.Country} field to the Flash file's row labels,
and the {Customer.Last Year's Sales} field to the Flash file's data values.
Notice that the values displayed are temporary and may not reflect values from the report.
4. View the report.
You now have a basic Xcelsius chart with data pushed from the report in alphabetical order.
5. Edit the chart to use the Top N option to limit the data sent to the chart to the top eight
countries.
6. Set the Chart Title to Last Year Sales and the Chart Subtitle to by country.
7. Save the report as Integrating an Xcelsius Flash file.rpt.
199
200
201
5. In the Group Sort Expert, what does Percentage refer to in the Top Percentage option?
Lesson summary
202
Answer Key
This section contains the answers to the reviews and/or activities for the applicable lessons.
203
204
2. Repository tooltips include Author and Description information for text objects and bitmaps.
3. True or False. If an item or folder is deleted from the repository it is permanently removed.
Answer: TRUE
4. When saving text object or bitmap images to the repository, you can use all the following
characters in the object's name:
A) $ * " ! @
B) . # ^ & ~
C) % ! * ^ )
D) ; @ ~ $ *
Answer: C
A) $ * " ! @ <--- includes "
B) . # ^ & ~ <--- includes #
C) % ! * ^ ) <--- Does not include any prohibited characters.
D) ; @ ~ $ * <--- includes ;
5. True or False. Any object stored in the repository can be deleted but those objects must also
be deleted from the report.
Answer: FALSE
6. True or False. All Crystal Reports native drivers support the Add Command feature.
Answer: FALSE
7. Custom functions can be added to the repository through the Formula Workshop.
8. True or False. The Set Datasource Location feature makes it possible to create a query based
on one universe and then apply it to a new universe.
Answer: TRUE
205
Answer: Image, Text objects, Custom Functions, SQL Commands, List of Values, and
Universes
206
Description
Length
A.
Subscript(x[y])
A.
Trim
A.
Right
A.
Not
A.
Replace
A.
x&y
A.
Picture
A.
Instr
A.
Left
A.
IsNull
A.
ToText
A.
1. Item
DateDiff
A.
DateAdd
A.
DatePart
A.
DateSerial
A.
IsDate
A.
Date
A.
Year
A.
Day
A.
1. Item
207
Answer: No, this will not work. To concatenate different data types the & must be used.
3. What will the following return?
Business Objects[10 to 16]
Answer: 12/08/2004
208
2. {Employee.Employee ID} is a field from the Xtreme Sample Database. Will the following
concatenation work? Why? Why not?
Answer: To publish reports to BusinessObjects Enterprise you can use the Crystal Publishing
Wizard or the Save As... option from the File menu on Crystal Reports. You can also publish
through the Workbench.
209
2. What are the different ways you can publish Crystal Reports to BusinessObjects Enterprise?
Answer: The datatype must have Var at the end of it, so the declaration should be local
stringVar sName;
3. Rewrite the variable declaration to make it work. Assume the declaration is at the beginning
of a formula that has more than one statement.
currencyVar cSalary
Answer: The semicolon at the end is missing, so the declaration should be currencyVar
cSalary;
4. Rewrite this array declaration to make it work, assuming that the statement is not at the
end of the formula.
global numberVar CustomerID := [345, 894, 938]
Answer:
The word Array and the semi-colon at the end are missing, so the declaration should be
global numberVar Array CustomerID := [345, 894, 938];
Answer: Farm[4]
210
Answer: No scope has been declared, therefore the variable takes on the default global
scope.
5. What are the four types of fields that Template Field Objects can be applied to?
Answer: The four field types are database fields, parameter fields, SQL expression fields
and formulas.
211
2. If the report to which a template is applied has fewer sections than the template what
happens?
Answer: A parameter field can be identified by French braces and a question mark before
the parameter name. For example, {?parameter_name}.
3. What is the purpose of a default-value list?
Answer: Default values give the user a "hint" as to the type of information to enter in the
parameter prompt. Default values also speed up the process by displaying a list of values
from which to choose.
4. How do you display a single-value parameter on a report?
Answer: To display a single value on a report, create a text object and leave space to insert
the parameter. Insert the parameter in place of text.
5. In an edit mask, what is the difference between using A and a?
Answer: Both enable an alphanumeric character but A requires the entry of a character in
the parameter value where a does not require the entry of a character in the parameter value.
6. If the discrete values A and G are entered as parameter values used in record selection and
the operator used is the equal sign, what records will be returned?
Answer: Only the records that are equal to A and G will be returned.
7. What function(s) would you use to display date ranges on a report?
Answer: Use Minimum and Maximum functions.
212
213
Answer: False. New Page Before and New Page After do not have to be enabled to be
conditionally used. Conditional use overrides absolute use.
3. True or False. GroupNumber requires a group in order to use it.
Answer: False. Create a formula and insert the GroupNumber function. Put the formula
anywhere on the report. If no group exists, it returns a 1 for the first group.
4. To have one section on top of another is called:
Answer:
c. Underlay
5. True or False. Multiple-column formatting is only available for the Details section.
Answer: True
6. True or False. Every Crystal Report has a minimum of five sections.
Answer: True. Create a new Crystal Report. Using the Design tab notice the five sections.
7. True or False. Any sections can be merged.
Answer: False. Only sections of the same type can be merged.
8. True or False. Sections must be merged using the Section Expert.
Answer: False. A right-mouse click in the grey area activates a context-sensitive menu
allowing a merge option of like Sections.
214
2. True or False. New Page Before and New Page After must be enabled (check boxes selected)
in order to be conditionally used.
Answer: Both. They could be either static or dynamic. Report Designer may enter a specific
hyperlink value (file, email, or website URL) directly in the Format dialog box (static) or
specify that the current value of a field be used as the hyperlink (dynamic).
3. When do Alerts run?
Answer: Alerts run when a report is refreshed.
4. What must be on a report for Top N or Group Sort to work?
Answer: The report must have Groups and at least one summary field by Group.
5. In the Group Sort Expert, what does Percentage refer to in the Top Percentage option?
Answer: Percent of the Total Number of Groups (Count of Group)
6. What can you hyperlink to from a Crystal report?
Answer: You can hyperlink to another report, a file, file location (folder or directory), a
website, or email address.
7. How can you create Conditional Form Letters in Crystal Reports?
Answer: Insert multiple sections with different text for each type of letter, then conditionally
suppress all but one section based on which letter should be sent.
8. Could the same record be displayed in more than one Alert?
Answer: Yes, this is one feature that distinguishes Alerts from Record Selection and
Conditional Formatting.
9. When would a Running Total in the Report Footer show a different value than a regular
Grand Total?
Answer: A Running Total would show a different value when a report uses Top N or Group
Selection formula.
10.In which report sections can you insert Xcelsius Shockwave Flash (SWF) objects?
Answer: You can insert Xcelsius Shockwave Flash (SWF) objects in the Report header, Group
header, Group footer, and Report footer.
215
216