You are on page 1of 48

Crystal Report 2011: Report Design II – Business Reporting Solutions

BOC 320
Index
1. Using the Repository 100 Mins
2. Creating Formulas 65 Mins
3. Managing Reports 65 Mins
4. Using Variables & Arrays 65 Mins
5. Using Report Templates 65 Mins
6. Building Parameterized Reports 60 Mins
7. Summarizing data with Cross-Tabs 90 Mins
8. Using Report Sections 60 Mins
9. Building Specialized Reports 120 Mins
Content : Day-4

a) Building Parameterized Reports Theory & Practical 60 Minutes

b) Summarizing data with Cross-Tabs Theory & Practical 90 Minutes

c) Using Report Sections Theory & Practical 60 Minutes

d) Building Specialized Reports Theory & Practical 120 Minutes


Lesson: 6
Building Parameterized
Reports
Agenda
 Define and create parameters

 Build a report with multiple parameters

 Use edit masks and descriptions

 Create a date range parameter

 Group using parameters


Define and create parameters
To prompt the user of a report to enter information, create a
parameter field.
A parameter as a question that the user needs to answer before
the report is generated to get only required information.
For example,
A parameter that asks the user to choose a region. The report
would return the results for the specific region, instead of returning
the results for all of the regions.
Types of Parameters:
Static
Dynamic
Cascading List Of Value
Steps to create simple Parameter
 Select Parameter Fields and click New.
 The Create New Parameter dialog box appears.
 Enter a name for the parameter in the Name field (up to 255 alphanumeric
characters).
 Select the appropriate Type from the list.
 From the Value Field list, select Value.
 Click Actions and select Append all database values to move all of the
values in the sample database to the Values area.
 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.
 Click OK.
 Return to the Field Explorer dialog box, and drag the Country parameter
Steps to create simple Parameter
Build a Report with Multiple Parameters
1. Select Parameter Fields and click New.
2. Enter a name for the parameter in the Name
3. In the List of Values area, click Dynamic.
4. Enter prompting text for your prompt group in the Prompt Group Text field.
5. Ensure that New is selected in the Choose a Data Source area.
6. Click Insert.
7. The program automatically expands the Value list. You use this area to define
the fields that make up your cascading list of values. This example uses a
cascade of Country, Region, and City.
8. From the Value list, select Country.
Build a Report with Multiple Parameters
9. Click the blank field under Country and select Region.
10. Click the blank field under Region and select City.

11. In the Parameters area, click City to bind the field that contains the City

value to the parameter.


12. In the Prompt Text field (in the Value Options area), enter additional

prompting text for each of the fields in your cascading list of values.
13. This is the text that appears in the "Enter prompt values" dialog box when

the report is refreshed.


14. Click OK.

15. Return to the Field Explorer dialog box, and drag the Supplier City

parameter into your report.


Build a Report with Multiple Parameters
Use Edit Masks and Descriptions
An edit mask can be any of a set of masking characters used to
restrict the values you can enter as parameter values (the edit mask
also limits the values you can enter as default prompting values).
You can enter any of the following masking characters, or any
combination of them:

"A" (allows an alphanumeric)


"0" (allows a digit [0 to 9] )
"9" (allows a digit or a space
"#" (allows a digit, space, or plus/minus sign)
"L" (allows a letter [A to Z])
"&" (allows any character or space)
Create a Date Range Parameter
 Date and Date Time parameters are often used in record selection to limit
the records on a report to a specific time period. As with other parameters
the data type used in the parameter must match the data type used on the
record selection.
 Put range value on the report
 "Orders for" & Minimum({?Date Range}) & " to " & Maximum({?Date Range}
Group using Parameters
Parameters can be used to determine the output for dynamic
grouping.
If {?Group} = "C" Then {Customers.Country}
Else If {?Group} = "R" Then {Customers.Region}
Group using Parameters
Steps:

1. Create static Parameter without selecting the column or table.

2. Click on ok and return to Field Explorer.

3. Create one formula to define group conditions(if then else).

4. Click on group insert button and select the formula field.

5. Refresh the report and give values.


Lesson: 7
Summarizing data with Cross-Tabs
Agenda
 Building a basic cross-tab

 Formatting a cross-tab
Building a basic cross-tab
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:
Rows
Columns
Summary fields

You can put cross tab in:


Group Header
Report Header
Cross- Tab Example
Analyze the unit sales of five different bicycle locks in four
different regions (a unit sales of locks by region report)

The region from which the order came.

The name of the lock.

The quantity ordered.


Report of order data - no sorting/grouping
Report of order data - grouped by region
Report of order data - grouped by product
Report of order data - grouped by region and
product
Order data in a Cross-Tab object
Formatting a Cross-Tab
Lesson: 8
Using Report Sections
Agenda
 Format Sections

 Using group related functions to format section

 Using Section Underlay

 Using Multiple Column Reporting


Format Sections
Section Expert

Section Formatting
Formatting Sections
Common Tab
Hide (Drill-Down OK)
Suppress (No Drill-Down)
Suppress Blank Section
Print at Bottom of Page
Keep Together
Underlay Following Sections
Format with Multiple Columns
Clamp Page Footer
Reserve Minimum Page Footer
Read-only
Relative Positions
Formatting Sections
Paging tab
New Page Before
Reset Page Number After
New Page After
Orientation

Color tab
Background Color
Conditional Formula
Using group related functions to format section
DrillDownGroup Level

GroupNumber

InRepeated GroupHeader

GroupSelection
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 underlay's 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
report's background, or use a scanned image of a form as a
guide in setting up a report to print on preprinted forms.
Using Section Underlay
 Before Using Section underlay

After Using Section underlay


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.
Lesson: 9
Building Specialized Reports
Agenda
Use the Running Total Expert

Create a form letter

Add a hyperlink to a report

Use Dynamic Graphic Locations

Build a report with alerts

Build a top N report

Integrate an Xcelsius Flash SWF into a Crystal report


Use the Running Total Expert
A running total field is created with the Running Total Expert.
The Running Total Expert creates a running total field by asking
you to select a field to summarize, the summary operation to
use, a condition upon which to base the evaluation, and a
condition on which to reset the evaluation.
Running Total
Create a Form Letter
Form letter Example

Form letters are an


example of how flexible
and powerful your reports
can be with Crystal
Reports. You can create any
variation of a form letter
required.
Create a Form Letter
To create the body of a form letter

1. Begin with a new report.

2. Insert a text object into the Details section.

3. Format the text object to Can Grow.

4. Stretch the text object horizontally to the width of the page.

5. Double-click the text object.

6. Enter text, database fields and other information into the text object.
Add a hyperlink to a report
 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 URLs, so your web reports
retain independence from their
location on any particular server. To
use a Relative URL, you first set the
Hyperlink type to "A file," delete
the default prompt from the File
Name field, and then replace it
with the Relative URL
Creating a hyperlink field
 Select a report object on the Design or Preview tab.
 On the Format menu, click Hyperlink.
 The Format Editor dialog box appears with the Hyperlink tab active.
 Click the type of hyperlink you want to create.
 The available types in the upper area are:
No Hyperlink
A Website on the Internet
Current Website Field Value
An Email Address
A File
Current Email Field Value
 After you have chosen a hyperlink type, enter the appropriate hyperlink information (the
URL of a website, for example).
 Click OK when you are finished.
 The hyperlink is inserted as appropriate. Click the hyperlink on the report to go to the
Use Dynamic Graphic Locations
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 us1e 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
Create Dynamic Graphic
To insert a static OLE object
 Open or create the report that will receive the inserted static OLE object.
 On the Insert menu, click Picture. The Open dialog box appears.
 Select a picture (.bmp, .tiff, .jpg, .png, or . wmf) from a directory that you have access to.
 Click Open.
 When the object frame appears, place the picture on the far left side of the Report Header section.
 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.

To make a static OLE object dynamic


 Right-click the static OLE object that you inserted, and select Format Graphic from the shortcut
menu. The static object becomes the default object. If Crystal Reports cannot find the dynamic
reference to the object, it uses the default object instead.
 In the Format Editor, click the Picture tab, and then click the Conditional Formula button adjacent to
the Graphic Location label.
 In the Formula Workshop, create the path to your static OLE object.
 Click Save and close to return to the Format Editor.
 Click OK to return to your report.
 Click Refresh to update the reference link to your static OLE object.
Build a report with alerts
Report Alerts are created from formulas that evaluate conditions
you specify. If the condition is true, the alert is triggered and its
message is displayed. Messages can be text strings or formulas
that combine text and report fields. Once a Report Alert is
triggered, it's not evaluated again until you refresh your report's
data.

You must complete three steps when creating a Report Alert:

 Name the alert.


 Define the condition that triggers the alert .
 Create the message you want to appear when the alert is triggered
(this step is optional).
Build a report with alerts
Build 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 the fastest
selling product lines, the countries that account for the top 25 percent of sales,
the states that generate the most orders, and so on.
 Note: A report must contain a summary value in order to be able to perform a
top N or bottom N selection.
Integrate an Xcelsius Flash SWF into a Crystal
report
Flash technology is a popular way to add animation to web pages. Flash files
They can be viewed in a standalone Flash Player, inserted into web pages or
inserted into Crystal Reports.
There are restrictions for SWFs created using the Crystal Reports data
connection in Xcelsius 2008. Those SWFs can be added to the following
sections only:
 Report header
 Group header
 Group footer
 Report footer

You might also like