Sie sind auf Seite 1von 176





i Introduction to Crystal Reports

i Creating Reports
i Selecting Records
i Organizing Data on Reports
i Formatting & Section Formatting
i creating basic and complex formulae's
i Using Variables and Arrays
i Using Report Templates
i Applying Conditional Reporting
i Building parameterized and Specialized reports
i Summarizing Data with Cross Tabs
i Using Report Sections
i Representing Data Visually
i Managing Reports
i Distributing Reports
i Using Repository and Repository data sources
i Report Processing
i Using Sub Reports
i Using Custom Functions




£ºigh-productivity report creation and integration

£Quickly transform almost any data into powerful, interactive


£Tightly integrate reporting into .NET, JavaŒ and COM applications

£Let end users access and interact with reports via portals, wireless
devices and Microsoft Office documents.

£ Crystal Report Designer ± Tool used for designing the

report template and to view the data

£ Report Designer Component ± Activex object acts as a

interface between the report and the database

£ Seagate Web Component Server ± Queues the request

and passes it to page server

£ Seagate Page Server - Generates the report in an EPS

(Encapsulated page File) format. Activex or Java can
view this EPS format.

Data Sources * Oracle, IBM DB2, Microsoft SQL

Server, Microsoft Access,Sybase,
Informix, OLAP and ODBC.

* Other data sources may be accessed

using APIs.
OS Windows NT, Sun Solaris, ºP-UX, and
Web Servers Microsoft IIS, Netscape and Apache web
Browsers Netscape Navigator and Microsoft
Internet Explorer
[  |  

X Powerful report authoring.

X Expanded application development capabilities.
X Integration with Business Objects Enterprise XI.
X Improved usability.
[  |  

X Powerful report authoring

-Dynamic and cascading prompts are now available in crystal reports.A single
prompt definition can be stored in the repository and shared among
multiple reports improving both runtime scalability and design time productivity.
-A new RTF Export format is available in addition to the existing one.This new
format is optimized for ease of editing the files that it generates.
-We can now place pictures and graphics in a report through a link stored in a
-Group sort order and top or bottom N reports can now have their sort
values driven by a formula (i.e parameters are used to control sort order).
Using this option we can create a single report which is more flexible and
which can meet the needs of more users by reducing the number of
-For many export formats you can now save report export-configuration
information with the report itself.
[  |  

X Expanded application development capabilities

- Developers now have the same fine-grained control over the report format as they
do within the crystal reports designer.
- New and improved cross platform application programming interfaces include
server-side printing, as well as the ability to configure subreports
as if they were full crystal reports.
- Custom Java user Function Libraries let Java developers incorporate their own
code within crystal reports.
-User interface development is simplified with support for Java server faces
through a new JSF viewer Software Development Kit.
-Offers Enhanced developer documentation that provides coverage for the
most common reporting use cases.
[  |  

X Integration with Business Objects Enterprise XI.

Integration between the Crystal Reports Designer and Business Objects
Enterprise has been substantially enhanced in the following ways:

-The Repository Explorer has been enhanced to allow for easier logon and
easier browsing of Enterprise objects and repository items
-The Repository Explorer can open the Business Objects Enterprise
Central Management Console.
-The Dependency Checker allows you to confirm that all repository objects
in your report are valid.
-The Workbench allows you to publish a group of reports individually or
combined into a single object package.
[  |  

X Improved Usability
-Crystal reports now offers a new ºTML preview that lets you see how your reports
will look when published to the web.
-The new Repository Explorer makes it easier to navigate within the business
objects Enterprise system.
-The workbench lets you keep projects organized and allows you to group reports in
folders according to your preference.
-New drag and drop charts and cross tabs introduce intelligent charting and cross
tab design by letting crystal reports automatically create a chart or cross- tab that
is based on the data in your report.
-The resizable group tree improves report viewing for long group
names,and the tool bar has been updated to be more consistent across




± By using one of the report wizards provided (Report Expert )

± By constructing the report from Scratch
± By creating a report from another report

The Report Experts help create reports as quickly as possible.
The Expert walks you through the process of creating reports

As a Blank Report option is used to create a report from
scratch. This is useful when you want the full flexibility and
control of building a report from the ground up.


To build a new report based on an existing report.The existing
report can be used as a template.
£ Launch Crystal Report Designer & start the Report Expert Wizard
£ Specify DSN in the Data tab from Database button
£ Select Tables and Views for the report from the Data Explorer window (refer fig. CRYS01-1)
£ Select fields to be included in the report (refer fig. CRYS01-2)
£ Specify report fields for sorting and grouping (refer fig. CRYS01-3)
£ Specify report fields for Summarization
£ Select the parameters for group sorting like TopN, BottomN or All for the group fields
£ Select the type of chart and set the parameters for the data value, axes etc.
£ Select the fields for the filter criteria
£ Type the title for the Report (refer fig. CRYS01-4)
£ Change the page header/footer, report title, etc. as required.
£ Save the report as .rpt in the respective folder and preview the report.
The snapshot below shows the database object in the data Explorer

Fig: CRYS01 - 1

The snapshot below shows the fields selection in report expert wizard

Fig: CRYS01-

The snapshot below shows the grouping in report expert wizard

Fig: CRYS01-

The snapshot below shows the Style tab in report expert wizard

Fig: CRYS01-

# $%

Ô   à      

The Design tab provides a very efficient environment for designing
a report because you work in the tab with data representations,
not with data itself.

G  Ô
In preview tab the program gathers the data, makes the necessary
calculations, and displays the report. With the data in place, you
can review the spacing and formatting of your report and see the
actual results of all your summaries, formula calculations, and
record and group selections.

# $%


# $%

G  Ô


The report contains different type of data.

Crystal Reports provide different type of fields.
± Database Fields
XMuch of the data placed on a report are database fields, displaying
data as it is stored in the database
± Text Objects
XText objects are used in reports for a multitude of purposes. They
are a powerful way of inserting titles; labeling summaries and other
data on your report; and of easily combining database fields.
± Special Fields
XTo display information such as Page Numbers, Print Date, and
Report Comments use the commands in the Special Fields tree
view of the Field Explorer dialog box.


± Formula Fields
X To display data that is a calculated value.
± Running Total Fields
X To display a total that evaluates each record and provides a running sum
of all the values in a field
± Picture Fields
X To display pictures like company logo etc.
± SQL Expression Fields
X SQL expressions are like formulas, but they are written in Structured
Query Language (SQL), not in the Seagate Crystal Reports formula
± ºyperlink Fields
X To select an object on the Design or Preview tab and create a hyperlink to
a web site, a local ºTML file, a field value, an e-mail address, or another
Seagate Crystal Report file.

£ Click Save on the Standard toolbar to save your work. Since

this is the first time you are saving the report, the Save As
dialog box appears displaying the default directory where the
file will be saved.
£ Type µfilename¶.rpt in the File name box and click Save. Your
report is saved to the default directory or another directory you
£ Click the Preview tab to view the report.

£ User can filter the records to be included in a report

£ For example, records in a report can be restricted to a specific
group of customers, a specific range of account numbers, or a
particular date range


You can select records in two ways:

£ ëUsing the Select Expert´

£ ëUsing formulas
 $'  

£ When you work with the Select Expert, you select the field to
which you want to apply selection conditions and then you
specify those conditions.

£ The Select Expert can be used to set up simple record

selection requests. For example:
± customers from Arizona
± orders in the first quarter
± sales over $10,000
 $'   

The Select Expert can also be used to set up some sophisticated

£customers whose names start with ëA´, ëM´, or ëS´
£customers from California or Florida who ordered in July.


On the à menu, click    .
£ The Select Expert dialog box appears.


$'   |
A Use the drop-down lists to enter your selection criteria for the
indicated field.

ù Click
when finished.



1. On the à menu, point to    and

click à .

2. Enter the formula by typing in the components or selecting

them from the component trees.

[ The resulting formula must be Boolean( i.e, it must

return either a True or False value).



ù Click   to identify any errors in the formula.

! Fix any syntax errors the Formula Checker identifies.

" When the formula has the correct syntax, click   
 |


Crystal Reports provides an option of using multiple filter

conditions to be set on the selection of records. There is an
ëAND´ option to set compound filters.

The Month, Day, and Year functions can all be used in

examples like the following:

£ Year ({file.DATE}) < 1999

± Selects those records in which the year found in the
{file.DATE} field is earlier than 1999.

£ Year ({file.DATE}) > 1992 and Year ({file.DATE}) < 1996

± Selects those records in which the year found in the

{file.DATE} field falls between 1992 and 1996 (1992 and
1996 not included).

£ Year({file.DATE}) >= 1992 and Year({file.DATE}) <= 1996

± Selects those records in which the year found in the

{file.DATE} field falls between 1992 and 1996 (1992 and
1996 are included).

£ Month({file.DATE}) in 1 to 4

± Selects those records in which the month found in the

{file.DATE} field is one of the first four months of the year
(includes January, February, March, and April).

£ Month({file.DATE}) in [1,4]

± Selects those records in which the month found in the

{file.DATE} field is the first or fourth month of the year
(includes January and April, excludes February and
©  ) #

Data is organized in three ways in reports:

-By Sorting Records

-By Grouping records
-By Summarizing data


Sorting means placing data in some kind of order to help you

find and evaluate it.

When you first insert a database field into your report, the data
within the fields appears in the order in which it was originally
entered into the database.


When you sort, the program asks you to define two things:

£ the field you want the sort to be based on (sort field)

£ the sort direction.



A sort field is the field that determines the order in which data
appears on your report. Almost any field can be used as a
sort field, including formula fields. A field's data type
determines the method in which the data from that field is


Direction refers to the order in which the values are displayed, once sorted.
Ascending order means smallest to largest (1 to 9, A to Z, False to
True). The program sorts the records in ascending order based on the
values in the sort field you select.

Descending order means largest to smallest (9 to 1, Z to A, True to
False). The program sorts the records in descending order based on
the values in the sort field you select.


£ Grouped data is data that is sorted and broken up into meaningful groups.
£ In a customer list, for example, a group might consist of all those
customers living in the same Zip Code, or in the same Region.
Following diagram shows how to group


When data is grouped, four sort and group direction options are
available. Direction refers to the order in which the values are
Ascending order means smallest to largest (1 to 9, A to Z, False to
Descending order means largest to smallest (9 to 1, Z to A, True to
Original order is the order the data was originally saved in the
Specified order is a user-defined order.
|  |


Usually data is sorted based on the values from a field in the

report. Sometimes, however, you may not want to group data
based on the values found in one of the fields on your report.
For example:

£ The field you want to group on does not exist.

£ The field exists, but you do not want to group on the values
in that field.

£ The field exists, but you want to select specific values or

ranges of values for each group.
|  |


1. On the Insert menu, click Group. The Insert Group dialog box appears.
2. Select the field you want the data to be grouped by from the top drop-down list.
3. Select in the specified order as your sort option from the second drop-down list.
4. In the Change Group Options dialog box, enter the name of the group in the
Named Group field.
5. Click New.
6. In the Defined Named Group dialog box, use the drop-down lists to select the
data to be part of the group.
7. Click the <New> tab to add more selection criteria to your specified group, if
8. Click OK.
9. Click New to create more custom groups as necessary.
10. Click the Others tab to specify how you want to organize the data that is not part
of the group(s) you defined.
11. Click OK
|  |



When you group or summarize data, all the groups in the report
are included by default. There may be times, however, when
you do not want to include all the groups. For example:

£ you might want to see only those groups that have certain
group names, or whose summarized values meet a certain
£ you might want to see only the groups with the highest
summary values, or the lowest.
£ You can select the groups that appear in the report in two
different ways:
± Using the Select Expert.
± Using selection formulas



£ You may want to group your data into intervals. Age groups,
time periods, and sales categories are some of the interval
groupings that can be created


£ You have the option to group data in a report to show
hierarchical relationships. When you group data
hierarchically, you sort information based on the relationship
between two fields.
 ) #

Crystal reports includes a number of subtotalling or

Summarizing options. A subtotal is a summary that totals or
sums numeric values in a group


Many different formatting options exist to make the

information in the report understandable.
There are four different formatting options available:

-By adding Graphical elements.

-By combining text objects with database fields.
-By Applying specialized formatting.
-By inserting fields with pre-built functions.


Adding Graphical elements:

If you want to make specific data or summaries stand out
from the rest of the report or just want to improve the overall
performance,you can use graphic elements to
enhance your report.This can be achieved by doing any of
the following things:
-By adding a line to a report.
-By adding a box to a report.
-By adding a graphic to a report.
-By adding a dynamic image object


Combining text objects with database fields:

Sometimes in order to make the report more Functional we
Need to combine or manipulate data,add labels,or paragraphs
to the report.This can be achieved by doing any of
the following things:
-Embedding a database field into a text object.
-Preventing the truncation of a text object inside a database
-Formatting individual elements of text objects.


By Applying specialized formatting:

You can customize your reports to be of Presentation Quality.
This can be done in the following ways:
-By formatting multiple objects.
-By applying a pre-defined template.
-By applying text rotation.
-By applying accounting conventions.
-By applying numeric,currency,date,time,and date/time


By inserting fields with pre-built functions:

You can reduce the amount of time spent formatting reports by
Using special fields,which are fields that contain pre-built
Functions.This can be achieved in the following manner:
-By inserting special fields.
-By formatting special fields.
-By embedding a special field into a text object.


You can create multiple sections within an

area on the report.
This can be done in two ways:
-By Defining the section Expert.
-Formatting Sections.


The following diagram shows the highlighting Expert looks like:



The section Expert offers flexibility when formatting

different sections of a report
Two tabs appear in the section expert:
-common tab
-color tab


Common Tab:
The active options on the common tab vary,depending on which
section is selected in the sections list .Only options applicable to
that particular section are available.
Color Tab:
On the color tab you can select a background color for each of
the sections on your report


We can format reports into sections whenever we require it.This

is called as section Formatting.

Ex: We can create subgroups in a main group for a report which

is grouped by region in order to get the details of that
particular region.
|  + 

£ In many cases, the data needed for a report does not exists in
database table fields.

£ In such cases, you need to create a formula.

£ For example, to calculate the number of days it takes to

process each order, you need a formula that determines the
number of days between the order date and the ship date.

£ Seagate Crystal Reports makes it easy for you to create such

a formula.

Creating a formula in Seagate Crystal Reports is like

creating one in any spreadsheet application

Syntax rules are used to create correct formula. Some basic

rules are:
£ enclose text strings in quotation marks.
£ enclose arguments in parentheses (where applicable).
£ referenced formulas are identified with a leading @ sign.

1. On the   menu, click  .

2. Select   .
3. Click New.
4. In the Formula Name dialog box, enter the name you want to identify the
5. Click
. The Formula Editor appears.
6. Choose either Crystal or Basic syntax. If you are unsure which syntax to choose
see Formula syntax.
7. Enter the formula by typing in the components or selecting them from the
component trees.
8. Click Check to identify any errors in the formula.
9. Fix any syntax errors the Formula Checker identifies.
10. When the formula has the correct syntax, click Save then Close.
11. You return to the Field Explorer dialog box.
12. Double-click the formula and position the cursor where you want the formula to
appear on your report.
13. Click once to set the field in the desired position.




You may want to copy a formula created in one report for use in another report. Copy
the text formula from one report to another via the Clipboard.


1. Select the formula field you want to copy in the report.

2. On the Edit menu, click .
3. Open the report you want to copy the formula to.
4. Choose G  from the Edit menu.
5. When the program displays the object frame, drag the formula to the new
6. To make changes to the formula, right-click the formula and choose Edit Formula
from the shortcut menu. The  appears.
7. Delete the old values and type in the new values, or select them from the Fields,
Functions, and/or Operators tree.
8. Click Save then Close when finished.
|  |

Crystal Reports offers power formula capabilities to

expand the functionality of your report.
The functions are:
-Defining and demonstrating Print State Functions.
-Using loop control structures.
-Using loop control structures with Arrays.
|  |

Defining and demonstrating Print State Functions:

Functions are built-in procedures or subroutines used to

evaluate,make calculations on,or transform data.Print state
Functions return a value based on the state of the report being
Two examples of print state functions are:
-IsNull() evaluates the field specified in the current record and returns true if
the field contains a null value.You can use this function in a record selection formula
to limit the report to records that have something other than a null value bin the field
-NextIsNull() is similar to IsNull() in that it tests for null values and returns a Boolean/F) value.
The difference is that it evaluates the specified field in the next record as opposed to the
current record.You can use this function to test for the last item in a list and to take some action
when you identify that last item.
|  |

Using loop control structures:

Control Structures allow you to vary the sequence and order in
which expressions are executed.
This can be done in two ways:
-By defining control structures
-By using control structures.
|  |

Defining Control Structures

Control structures can be defined in the following ways:
-By using if expressions
-By selecting the expressions
-By using For loops
-By using while loop
-By using option loop
|  |

Using loop control structures with Arrays.

This can be done in two ways:
-By Determining the size of an array
-By looping through an array
 . +* 

Variables and Arrays are both place holders for values

in a formula.A variable holds one value at a time but an
array can hold a number of values.
Crystal reports enables you to use variables in formulas to
streamline formulas and expand formula capabilities.
 . +

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.A variable can be repeatedly assigned
different values.
To use a variable in a formula you must do the following things:
-declare the variable
-assign a value to the variable
-refer the variable
 . + 

Declaring a variable
When we declare a variable we need to tell the
program the following things:
-scope of the variable
-Data type
 . + 

Scope of variable:
The scope of variable describes where you would like
the variable to be available.
There are three variable scopes in Crystal reports.They
 . + 

Types of scopes in variables:

Global variables can be used and referenced in any
formula within a single report.If no scope is declared for the
variable this is the default scope.
Shared variables can be used and referenced by any formula in
A subreport or the main report of a single report.The Shared
variable can be referenced and utilized more than once and by
more than one subreport.
Local variables can only be referenced and utilized within the
formula in which they are declared.
 . + 

Determining the Data Type of the variable:

The data type of a variable determines the type of data that can
be stored as a value in that variable.You can create a variable
with one of the seven data types:
 . + 

Naming the variable:

We can name the variable by using the following rules:
-the variable name must not exceed 254 characters.
-the variable cannot have the same name as a Crystal Reports operator or
Built-In Function.
-the variable name cannot contain blank spaces.
 . + 

Assigning a value to a variable:

You can assign a value to a variable using an
assignment statement. The assignment statement
consists of:
-the variable name.
-the assignment operator
-the value you want to assign to the variable
-a semicolon
 . + 

Referencing a variable:
Referencing a variable can be done in two ways
-Referencing a local variable.
-Referencing a Global variable.

When there are two or more data items,instead of giving each

data item a separate variable name,the collection of data items
is given a single variable name.This collection is called an array
which is given an array name.The individual data items
contained in an array are known as the array elements.
In order to use an array in Crystal Reports,You must:
-declare the array
-assign a value to the array
-reference elements of the array

There are two types of arrays:

-Static arrays
-Dynamic arrays
Static array:
Static array is an array in which the elements are set
and remain the same every time the report is
run,regardless of the data included on the report.
Dynamic array:
Dynamic array is an array in which the elements of the array change based
on the data included on the report

Report templates are a quick and efficient means of applying

standardized formatting to multiple reports.
A Template is an existing report file whose formatting can be
added to a new report.At the same time,the formatting of the
template report fields and report objects are applied to the new
report.Use templates to give reports a consistent look without
having to format each one individually.
This can be done in two ways:
-By applying a pre-defined template.
-By using an existing report as a template.

Applying Report Templates:

This can be done in two ways:
-Applying a pre-defined template.
-By using an existing report as a template.

Applying a pre-defined template:

There are two ways to apply a report template to a
-Standard report Creation wizard.
-Template Expert.
There are a number of pre-defined templates installed with
crystal reports.Some of the pre-defined templates are:
-Confidential Underlay
-Grey Scale
-ºigh Contrast

By using an existing report as a template:

From the template expert,you can choose from a number of pre
defined templates,or you can click the browse button to search
for an existing report to use as a template.

Building a template without a Data Source:

Crystal reports allow the flexibility of creating a template without having to be
connected to a data source.You can use Template field objects to create
More flexible report templates.These report objects do not refer
to existing database fields;you simply put them in your template report and
format them as you require.When you apply the template to another report
,Crystal reports displays that reports data with the formatting you specified.
Template Field objects are applied only to result fields like database
fields,parameter fields,SQL expression fields and formulas.Special fields are
not considered as result fields.

Removing a Template:
Sometimes the result of a template application may
not be exactly as you wanted so removal of the
template is necessary.
A template can be removed in two ways:
-By using the Undo The current template option
-By selecting the No Template option in the list of available templates.
*  |


You can easily apply absolute or conditional formatting ,which is

applied only under certain conditions.
This can be done in two ways:
-By determining trends in data.
-By formatting data conditionally.
*  |

*  |


Determining trends in data:

When you want to highlight certain information in a report in order to perform
An analysis of the data.You can quickly establish trends in the data by using
the highlighting expert.The ºighlighting expert enables you to apply
conditional formatting to all types of Report
fields(Number,Currency,String,Boolean,Date,Time and Date and Time
When used for conditional formatting,the highlighting expert allows you to do
the following things:
-Modify several attributes at once without writing a formula.
-ºighlight all field types used in the report.
-Format font style,background color, font color and border style.
-Format a field based on its own values or the values of another field.
*  |


By formatting data conditionally.

Conditional formatting is formatting that applies only
under certain conditions that you set up.
Conditional formatting can be done in the following ways:
-By describing the conditional formatting.
-By applying on or off properties.
-By applying attribute properties.
-By applying conditional formatting.
ë    )   )

Building parameterized reports:
Parameters allow you to collect input from the report user and
run the report based on the input.
Parameters prompt the user of a report to enter information. By
using parameter fields in formulas,selection formulas, and in the
report itself, you can create a single report that you can modify
whenever your needs change.
A parameter field can be identified by French braces and a
question mark before the parameter name .For example
ë    )

Creating a parameter with a static prompt.

Creating a parameter with a dynamic prompt.
Use a parameter in a record selection.
Respond to a parameter.
Populate prompt values from values in a database.
Use the list of values.
Display a single value parameter on a report.
Describe values and sorting.
ë    )

Static prompt:
A static prompt is one that always contains the same
values.For ex, if your parameter prompts for a country
value ,you could create a static prompt because the
Country list represents a set of values that does not
change often.
A static parameter can be created in two steps:
-Creating a parameter.
-Using the select Expert to incorporate the parameter.
ë    )

Dynamic prompt:
A dynamic prompt is one that changes on a regular or
irregular schedule. With a dynamic prompt you are
able to create or specify a list of values that you can
Schedule for updates as often as you like through the
Business View Manager.
Using a parameter in record selection:
Once you have created a parameter field,you can use it or reference it in your
report in place of a fixed value.
One of the most common uses of a parameter is in record selection(select
ë    )

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 report¶s data.
Populating prompt values from a Database:
Dynamic and cascading prompts allow you to populate prompt
values from values in a database. A single prompt definition can
be stored in the repository and shared among multiple
reports,improving both runtime scalability and design-time
productivity. A dynamic prompt can include a cascading list of values,which
adds additional levels of selection for your users.
ë    )

Using the list of values:

Dynamic prompts use list of values. You can create list
of values in either Crystal Reports or in the Business
View Manager. Crystal reports refreshes the data in a list of
values when you open a report that contains a dynamic
prompt;however you can also refresh the data in a list of values
by scheduling it in the Business View Manager.
Display a single value parameter on a report:
If you are using parameter fields in a record selection or formula you may
want to reflect this value somewhere on the report. In such a case the report
will be easier to understand if the record selection is displayed in the title of
the report.
ë    )

Describing values and sorting:

Default values:
When refreshing report data the Enter Parameter Values dialog box displays
the last parameter values chosen. Click this button to reset the parameter
values to the default values.
Current values:
Use the current Parameter Values dialog box to see all the parameter values
In your current report. If no parameters have values, the Parameters Fields
list displays the message:<No parameters have any values>.
Using Parameters to control Sort order:
Group sort order and top or bottom N reports can have their sort values
driven by a formulaThis feature means that you can use parameters to control
Sort order and the N value of a top or bottom N report. The result is a single report that
is flexible and scalable, reducing the total number of reports for you to create and
ë    )

Building a Report with multiple parameters:

Crystal reports allows you the flexibility to add more than one
parameter to one report. This can be achieved in the following
-By creating parameters with a single value or a range of values.
-Creating a report with multiple prompting values.
-Apply conditional formatting using parameters.
-Delete a parameter from a report.
ë    )

Date Range Parameter.

Using a date or datetime as a data type for a parameter is a common
Date and date Time Parameters:
Date and date Time Parameters are often used in record selection to limit the
Records on a report to a specific time period
Creating a Date range Parameter:
To create a date range parameter you should follow the same steps as you
would for other parameters.
Displaying a date range on a report:
Sometimes records should be shown based on a range of values.For ex we might
want to enter a range of dates for those records that should be included on a report
And reflected in the report¶s title.
ë    )

Grouping using parameters:

Parameters can be used to determine the output for dynamic grouping
Creating a Report with Dynamic grouping:
To set up grouping using parameter fields ,you create a formula that includes
a parameter field and then group based on that formula. This formula appears
in the list in the Insert Groups dialog box.
ë     ) 

-Using the Running Total Expert.

-Creating a form letter.
-Adding a hyperlink to a report.
-Using Dynamic Graphic Locations.
-Building a report with alerts.
-Building a Top N report.
ë     ) 

Using the Running Total Expert:

Running total fields are similar to the summary fields but allow
more control
over how the total is calculated and when it is reset.
We can use the running total Expert to do the following things:
-By creating a running total field using the Running Total Expert.
-By placing a Running Total Field in a report.
-By choosing the appropriate evaluation and reset options.
-By creating a conditional running total.
ë     ) 

Creating a Form Letter:

Form letters are an example of how powerful and flexible your
reports can be with crystal reports. You can create any variation
of a form letter required.
We can follow these steps for creating a form letter:
-Planning and creating a form letter.
-Using conditional messaging in a form letter.
-Adding a picture to a form letter.
ë     ) 

Adding a ºyperlink to a report:

Reports often relate to each other. ºyperlinks are an effective
way of moving from one report to another.
Creating a hyperlink field:
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.
You can also create hyperlinks with relative URL¶s ,so your web reports retain
Independence from their location on any particular server.To use a relative
URL, you first set the ºyperlink type to ëA File,´ delete the default prompt
from the file name field,and then replace it with the Relative URL.
ë     ) 

Using Dynamic Graphic Locations:

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 of those images in a database.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.
ë     ) 

Building a report with alerts:

Report alerts are custom messages created in crystal reports
that appear when certain conditions are met by data in a report.
Report alerts may indicate action to be taken by the user or
information about report data.
The following steps can be done with a report alert:
-Create a report alert
-Edit a report alert
-Delete a Report Alert
-View a Report Alert
-Reference a Report Alert In Formula
ë     ) 

Building a Top N report:

Creating Top N or Bottom N report is a method of group
selection that lets the user see the outstanding data at the top or
bottom of the data scale.
This can be done in two ways:
-By creating a top or bottom N groups.
-By creating a parameterized top or bottom N report.
 ) # |

A cross Tab object is a grid that displays values that are grouped and
summarized in two directions. Cross_tabs are a concise way to display a
large amount of data and can vary in complexity.
Building a basic Cross-Tab:
The following steps are used in building a basic cross-tab report:
-defining cross-tab
-creating a cross tab
 ) # |
 ) # |

Defining Cross-tabs:
A cross-tab 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:
-Summary fields
 ) # |

Creating a Cross-Tab:
You can Create a Cross-Tab in two ways:
-as an object in an existing report
-as a new report.
 ) # |

The following diagram is an example of a cross-Tab report:

 ) # |

Things to keep in mind When using Cross-Tab 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
-you can insert as many cross-tab objects in a report as you need.
-you can insert the Cross-Tab into either the report ºeader or Footer or the
Group ºeader or Footer.
 ) # |

Formatting a Cross-Tab:
To make cross-tab easier to read and more meaningful
formatting is used
We can format Cross-Tabs for presentation an readability using
the following Options:
-change the width,height,and alignment of the Cross-tab cells.
-format individual fields.
-format the background color of an entire row or column.
-customize row/column labels.
-suppress empty rows and columns.
-suppress row and column grand totals.
-suppress subtotals and labels.
-keep columns together.
-repeat row labels if a row continues to the next page.
 ) # |

Creating a customized cross-tab style:

The Customized Style tab is used to format your Cross-Tab¶s
grid with background color, gridlines and cell margins.

Additional formatting options can be applied to entire sections of

the report In the following ways:
-By using Sections
-By using group related functions to format sections
-By using Section underlay
-Using multiple column reporting


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.
The following can be done using sections:
-We can use the select Expert options conditionally.
-Creating new sections.
-Deleting sections.
-Moving sections.
-Merging sections.
-Creating Page Breaks.


Using the Section expert options conditionally:

The section Expert offers flexibility when formatting different sections of
reports. Each option can be turned on or off based on a boolean condition.
A formula button is located adjacent to most of the options in the Section
Expert. The options on the common tab of the Section Expert are on or off
Properties so the formula entered needs to return a boolean value.
The ability to apply formatting to sections conditionally greatly increases the
power and flexibility of reporting.You can even conditionally apply
background colors to sections.


Creating new sections:

By default every Crystal report has five sections. For basic
report writing these five sections are sufficient. More complex
reports may require more sections. You can create additional
sections using one of the three methods:
-By inserting a section using the Section Expert.
-By splitting a section.
-By using the insert section below menu option.


Deleting a section:
Once your report has multiple sections of the same type you
have the option to delete sections. There are two methods of
deleting a section:
-Using the section Expert.
-In the Design or preview tab


A section can be inserted as shown below in the diagram:



Moving Sections:
The general order of the five default sections is set and
Unchangeable. ºowever multiple sections of the same type are
movable. There are two methods of moving a section:
-Using the section Expert.
-In the Design or preview tab


Merging Sections:
Multiple sections of the same type are mergable. There are two
methods of merging a section:
-Using the section Expert.
-In the Design or preview tab


Using Page Breaks:

Creating page breaks adds to the readability of your report.Page
Breaks are created using the following two options:
-Using the new page before in the Section Expert.
-Using the new page after in the Section Expert


Using group related functions to format sections:

There are group functions that are intended for formatting
sections. When using these functions, section formatting
becomes more versatile. The following are the group related


Using Section underlay:

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 group¶s 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.
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


Using multiple column reporting:

Another way to change the look of a report is to use multiple column
formatting to give the report an appearance similar to newspaper columns.
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. When you
preview the report, you¶ll see that the field headers appear only for the first
column.To have field headers for the second column, insert a text object.

You can include sophisticated ,colorful charts in your reports.

These charts can enhance the information in your reports,
making them more comprehensible. You can use charts any
time to improve the usefulness of a report.

Choosing a Chart Location and Types:

You can chart on:
-Summary and Subtotal Fields.
-Detail, formula and Running Total Fields
-Cross-Tab summaries
-OLAP data

Inserting a chart using the Chart Expert:

The Chart Expert dialog box allows you to choose the type of
chart to display, select the data on which the chart is based ,
apply conditional color highlighting, as well as customize the
options and formatting for the chart.
The Chart Expert is a tabbed dialog box. The tabs in the Chart
Expert are:
-Type Tab
-Data Tab
-Axes Tab
-Options Tab
-Color ºighlighting
-Text Tab

Drilling down on a Chart:

Drill-down is a process where the details behind summary
information can be revealed by clicking the summary information
Contained in a report.
A chart that is based upon Summary fields is a candidate for
Drill-down. For each level of grouping and summarizing that
make up the chart ,you can drill down into the data to see the
underlying information that constitutes those totals.
If a chart consists of one or more group fields and you have
included a legend, you can drill down on individual groups
through the chart legend.

Charting on summary Data:

Charting summary and subtotal information Group Layout) is the
most common type of chart. Before you can create a chart, you
must have at least one group and one summary or subtotal in
your report .A chart built on summary data offers the benefit of
drill-down capability ,the ability to access multiple summaries
With the double-click of a mouse button.

Charting On Detail or Formula Information:

The Advanced Layout enables you to create a chart based on specific values
detail or formula data). Charts are often based on a summary Field in your
report in which the values plotted in the chart depend on the values in the
summary field. ºowever you can also create a chart that does not have a
summary field to chart on. Instead, these types of charts use values that
appear in the details section of your report.
To Create a Detail or Formula chart, you need to specify the following two

Customizing a Chart:
Once you have created a chart ,you may want to add a new title,headings,or
a legend, change fonts, or even change the type of chart. Crystal Reports
provides many options for working with your existing charts.
When you customize a chart, you can :
-Edit a chart using the Chart Expert.
-Edit a chart using the Chart option menu items.
-Use the zooming features with bar and line chart.
-Auto-arrange a chart in the report.
-Conditionally format a chart.

Once your reports have been created with Crystal Reports you
can manage your reports using the workbench and the Business
Objects Enterprise.

Using the Workbench:

The workbench is a tool designed to help you easily organize and access
reports found in different locations. In the workbench, you can organize
projects locally on your own machine, or publish them to the Crystal
Enterprise where others can share them.
Viewing the Workbench:
In the workbench you can view reports, projects, and object packages that
utilize reports from multiple unrelated locations.
Organizing Workbench Contents Locally:
Organizing Workbench can be done in two ways:
-By creating a project in the workbench.
-By adding an existing report to a project.

Publishing reports to Business Objects Enterprise:

Publishing is the process of adding objects such as Crystal reports to the
Business Objects Enterprise Environment and making them available to
authorized users.
When you publish a report to the Business Objects Enterprise, an entry is
made in the Central Management Server(CMS) Database. This database
stores published reports and they can be viewed in the Business Objects
Enterprise system. You can also publish a collection of reports to the
enterprise by creating an object package in the workbench and then
publishing that object package to the Business Objects Enterprise.

Creating a new object package:

An object package can be used to bundle reports together that can be
transported and scheduled as a singular entity. When published to the
Business Objects Enterprise system, the package can be accessed by other
Adding an Existing object package to the workbench:
After another user has published their object package to the Business
Objects Enterprise users with the appropriate permissions can add that
object package to their own workbench.
Using the Publishing Wizard:
As an alternative, you can use the publishing wizard to publish files or folders
to Business Objects Enterprise.
#  + 

A Report is distributed in order to share it with other people.

One of the most common forms of distributing a report is by
exporting it to a different format other than a crystal report file.
You can also save the report to Business Objects Enterprise,
the web-based report management system from Business
#  + 

Exporting a Report:
Finished Reports can be exported to a number of popular spreadsheet and
word processor formats, as well as to ºTML,ODBC, and common data
interchange formats. This makes the distribution of information easier.
The exporting process requires you to specify a format and a destination. The
format determines the file type, and the destination determines where the file
is located.
#  + 

Crystal reports provides you with many different export format

-Adobe format (PDF)
-Crystal reports (RPT)
-ºTML 3.2
-ºTML 4.0
-Microsoft Excel 97-2000(XLS)
-Microsoft Excel 97-2000(Data only) (XLS)
-Microsoft Word (RTF)
-Microsoft Word ±Editable (RTF)
-Record style (columns no spaces)
-Record style (columns with spaces)
-Report definition
-Rich text Format (RTF)
-Separated Values (CSV)
-Tab-separated text (TTX)
-Text (TXT)
#  + 

Exporting Destinations:
The destination determines the export location of your
report. Crystal Reports enables you to choose one of the
following six destinations:
-Disk File
-Exchange Folder
-Lotus Domino
-Lotus Domino mail
-MAPI (Microsoft Mail)
#  + 

Saving a report To Business Objects Enterprise.

Viewing Requirements in Business Objects Enterprise:
When designing your reports and especially when designing reports for the
web, you should allow report users to drive the data they see. In other words
Display summarized information ,so each user can navigate the report quickly
And then drill down to access additional data. In this way web traffic and
response times are minimized ,because only the data requested by the user
is transferred from the database server.
#  + 

Some of the methods you can use to design optimized reports

for viewing in Business Objects Enterprise are :
-Using Faster Report Formats.
-Choosing between live and saved data.
-Designing summary reports.
-Caching report templates.
#  + 

Saving a report to Business Objects Enterprise:

Another way to distribute your reports is through Business Objects
Enterprise. When you publish a report to Business Objects Enterprise, you
Can deliver it to end users via any web application like internet, extranet,
intranet, or corporate portal.
Crystal Reports facilitates the publication of reports through the Enterprise
Option found in the Open and Save As dialog boxes. When you choose the
Enterprise option in the Open dialog box, you can select any published report
to make changes to it. The same option in the Save as dialog box lets you
save a modified report back to its original location, or it lets you save a new
report to an Enterprise folder ,which ,in essence, is the same as publishing
the report to Business Objects Enterprise
#  + 

To open a report in an enterprise folder



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
-custom functions
-SQL commands(queries)
-Business views


The repository is contained in the Business Objects Enterprise. You must
install the Business Objects Enterprise to access the repository. The toolbar
in the Repository Explorer provides buttons with tool tips. These buttons let
you expand subfolders, add new folders, search for items, and so on.
Adding Folders to the Repository:
You can organize the contents of the repository by creating folders and
subfolders in its tree view.
Adding Objects to the Repository:
You can add text objects and bitmap images to the repository by dragging
them from your report to the appropriate repository folder.


Updating Repository Objects:
Repository objects that are used in report and are connected to the repository
can be updated automatically when opening the report in Crystal Reports.
There are two ways to update Repository Objects:
Deleting Repository Objects:
Any object you store in the repository can be deleted without removing it from
reports that use it. Once you remove an object from the repository, it is
removed from all users.


Creating a report from a repository Data Source.
In addition to the objects that can be placed on the report the repository can
store SQL commands and Business Views as objects that define a subset of
data from the database.
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.


Creating a report from a Business View:
A Business view is a file created in Business Views ± a Flexible and reliable
Multi-tier system. Business views enable companies to build detailed and
specific Business views and help report designers and end users access the
information they require.
Using Business Views you can integrate data from disparate sources.
A collection of Business view Objects is defined as a Business view.
A Business view is defined as a collection of these types of objects:
-Data Connections
-Dynamic Data Connections
-Data Foundations
-Business Elements
-Business Views


Creating a report from a Business Objects Universe:
Crystal reports based on Business Objects Universe (the semantic layer for
Business Objects query and analysis tools such as web intelligence) supports
Universe runtime security and union queries. These enhancements allow for
Most overloads defined in the Universe to be supported when you report off
that Universe in Crystal Reports.


Understanding how reports are processed by crystal reports will help you
optimize your reports for efficient processing.
Multipass reporting:
Crystal reports uses a three-pass reporting method to generate reports.
Report processing model:
There are five stages of processing when a report is run against a database.
This is referred to as multipass processing or the report processing model. A
pass is a process that crystal reports uses each time the data is read or
manipulated. The five stages of processing are:
-Pre-pass 1
-Pass 1
-Pre-pass 2
-Pass 2
-Pass 3


The following diagram shows a multi pass reporting flow chart.


Using Evaluation time Functions:

Evaluation time Functions can control how data is presented by controlling
when it is calculated or presented.
Evaluation time Functions:
Evaluation time Functions are the first line of a formula so that the entire
formula is evaluated at the appointed time.
There are four Evaluation time Functions. They are:


Creating a manual running total:

Manual running totals accomplish the same result as the running total expert
but offers more flexibility because you are able to add more conditions to the
running total.
Manual running totals uses a global variable and the evaluation time function
Manual running totals are created using three formulas. They are:


Using a Dynamic array:

Arrays can be used to store a collection of values. They can be created
statically or dynamically
Static array:
In a static array the elements are set and remain the same every time the
report is run regardless of the data included in the report.
Dynamic array:
In a dynamic array the elements of the array change based on the data
included on the report .The values included in a dynamic array reflect the
actual values contained in your database


Creating a Dynamic array:

Regardless of the type of array you are using, to use an array
within crystal reports, you must:
-Declare the array
-assign a value to the array
-reference elements of the array
When using a dynamic array there are two important items to keep in mind:
-The array must be processed during the second pass
-The placement of the formulas on the report.


Similar to a manual running total a dynamic array is created

using three formulas. They are
 +

Subreports enable you to create one report that provides all the information
you need instead of creating multiple reports. You can create freestanding
reports based on tables that are not related to those of the main report, or you
can link the subreports to the main report data.
 +

A subreport is report within a report. The process of creating a subreport is

similar to the process of creating a regular report. A subreport can have most
of the characteristics of a report, including its own record selection criteria.
The differences between a subreport and a main or primary report are that a
Subreport :
-is inserted as an object in a primary report; it cannot stand on its own
-can be placed in any report section and the entire subreport will print in
That section
-cannot contain a subreport.
 +

Instances in which a subreport would be used:

-Used to combine unrelated reports into a single report.
-Used to coordinate data that cannot otherwise be linked
-Used to present different views of the same data within a single report.
-To perform one-to-many lookups from a field that is not indexed on the
lookup field.
 +

Comparing Linked vs. Unlinked subreports:

Unlinked Subreports:
Unlinked Subreports are freestanding; their data is not coordinated with the
data of the primary report. In Unlinked Subreports ,there is no attempt to
match up the records in one report with the records in the other. An unlinked
subreport does not have to use the same data as the primary report; it
use the same data source or a different data source entirely. An unlinked
subreport can be based on a single table or on multiple tables. Regardless of
the underlying data sources, the reports are treated as unrelated.
Linked Subreports:
In linked Subreports the data is coordinated. The program matches up the
records in the subreport with the records in the primary report.
 +

On-demand subreports:
On-demand subreports can be especially useful when you want to create to
report that contains multiple subreports.In this case you can choose to have
these subreports appear only as hyperlinks. The actual data is not read from
the database until the user drills down on the hyperlink. Only data for on
demand subreports that are actually viewed will be retrieved from the
database, making the subreports much more manageable.
Data for an On-demand subreport is not saved unless the subreport is
actually open in a preview window.
 +

Creating an Unlinked subreport:

Subreports can be used to combine unrelated reports into a
single report. This can be done in the following ways.
-By using a pre-existing report as a subreport.
-Using the report wizard to create a report.
 +

Modifying a subreport:
Once you have created and inserted your subreport ,you may want to make
some modifications to it.
We can modify the subreports in the following ways:
-By applying object formatting
-By applying section formatting

Items such as the border, fonts and subreport labels can also be formatted or
 +

Creating an Linked subreport:

To link a subreport to a primary report , you choose a field in the subreport
and one in the primary report that contains common data. When you indicate
which field in the subreport you want to link to, the program:
-automatically creates a parameter field in the sub-reports for the field you are
linking to.
-use the newly created parameter field in the sub-reports record selection.
-passes the value to the sub-reports parameter field when you preview the
Main report and creates the subreport with a record selection based on the
parameter field¶s values.
 +

Adding Captions to Sub-reports:

Captions enable you to quickly organize your reports in a concise and visually
Manageable form. Captions can be used on the preview tab and the place
holder frame of an on-demand subreport.
Placeholder frame captions only apply to on-demand subreports ,while tab
text captions apply to both on-demand subreports and regular sub-reports.
Since the data from a regular subreport is visible on the preview tab, there is
no need for a frame caption when you format a regular subreport.
 +

Using Shared Variables with subreports:

You may want to pass information such as grand totals from a subreport to
the main report. This can be done using shared variables.
The information from the subreport is stored in a shared variable and passed
to the main report. The main report can then ëfetch" or retrieve this
Information by referencing the shared variable.
 +

Linking ëunlinkable´ data with subreports:

Many corporations store data in a number of databases and it is possible that
you will not be able to link the data because of limitations. If you want to link
between different field types or from a formula field, you can use subreports.
This can be done in two ways:
-Link ëunlinkable´ data with subreports.
-By creating links to ëunlinkable´ data
 |

Custom functions are a means of storing pieces of logic to reuse within a

single report or multiple reports. Custom functions provides away for you to
share and reuse formula logic which in turn ,makes it easier and less time
consuming for you and your users to create reports.
Custom functions and formulas are alike in structure and are created in a
similar interface. Custom functions are business logic that you create to
preform routine tasks in formulas.
Custom functions are designed for use across multiple reports because of
this a custom function cannot contain any database fields.
A custom function cannot be directly placed in a report ; it must be used as a
part of a formula
 |


Advantages of Custom Functions:

-Custom functions can replace sections of formula logic common to many
different formulas that , in turn , may be used in many different reports.
- Custom functions can be shared between reports by storing them to the
Business Objects Enterprise Repository and adding them to reports as
-Custom functions can reduce the need for your users to write formulas
themselves; you can provide them with the formula logic they need in a
custom function.
-Existing formulas can be converted to custom functions using the Extract
Custom Function from formula dialog box.
-Custom functions can have arguments, which makes them flexible.
 |


-You can define help text and default argument values for custom functions
which makes it easier for your users to use them.
-custom functions unlike User Function Libraries(UFLs) to which they are
related, are saved as part of the report file (.rpt) and don¶t have any
external dependencies.
- custom functions are stateless; the same input always yields the same
- When you modify a custom function, you can update the repository copy
and refresh each report without having to find and open the formulas that
use the function.
 |


There ate two types of custom functions.They are

-Report custom functions.
-Repository custom functions.
Report custom functions:
Report custom functions are available in the current report only and they are
Repository custom functions:
Repository custom functions are available across multiple reports and they
cannot be edited.
 |


Creating custom Functions:

They can be created in two ways:
-Using an existing defined custom function
-Creating custom Function using Crystal Syntax