Sie sind auf Seite 1von 7

Crystal Reports 9, Level 200

Proficient Level
Updated 12/14/05

Use Excel and Access Add-Ins


When you install Crystal Reports 9, the Excel and Access Add-In are added WARNING!
Reports created using the Add-ins automatically use
automatically. A Crystal Report Wizard 9 menu option is added to the Tools the default file options (i.e. DateTime field, formats,
menu and a button is added to the Standard toolbar in Excel. fonts, and full size page preview) and cannot be
changed regardless of whether or not customized
settings have been set.
Create a Report From Microsoft Excel or Access
EXCEL SAMPLE: C:\Program Files\Crystal Decisions\Crystal Reports 9\Samples\En\Databases\xtreme.xls
ACCESS SAMPLE: C:\Program Files\Crystal Decisions\Crystal Reports 9\Samples\En\Databases\xtreme.mdb

1. When in Excel or Access, go to Tools J Crystal Report Wizard OR click in Excel.


2. Click Range Select and then click somewhere inside the database.
3. Click Expand the selected range automatically. The range database will appear.
4. Click Create Crystal Report . The Crystal Report 9 Wizard opens.
5. Choose the information to display on the report
Under Available Fields: select the fields to display, then click > to add the fields to the list.J Next >
6. Group the information on the report
Under Available Fields: select the fields to display, then click > to add the fields to the list. J Next >
7. Add summary information to the report
For the Group: select the group to summarize from the drop-down list, then select the function from the drop-down list.
Select ; Add Grand Totals to add a grand total in the Report Footer. J Next >
8. Sort the group based on the summarized fields
This is the Top N Sorting. Select the way to sort, the field to sort by and the sort order. J Next >
9. Select a subset of information to display on the report
From Available Fields: select the field to filter, then click > to add the field to the Filtered Fields: list. Select the comparison
operator from the drop-down list and then add the criteria. J Next >
10. Add style to the report
Type the Report Title: and select a style J Next >
11. Choose how to save the report, then view it
Click Browse … to navigate to the drive and folder to store the file.
How would you like to view the report?
Select: €Preview (read-only), €Edit with Crystal Report Designer, or €View LaterJ Finish

Power Formatting with Multiple Sections


Insert an Additional Section Conditionally Format Multiple Sections
1. In Design view, click-and-drag the vertical separator for 1. In Design view, insert another section.
the section to duplicate to reveal Section a and Section b. 2. Add a text object to Section b with the text to appear.
3. Open the Section Expert for Section b.
2. Open the Section Expert where you can choose to
4. Click Formula Workshop X+2 after Suppress (No
merge, move, delete or underlay.
Drill Down) and create the conditional statement.
Crystal Reports 9
Level II, Proficient

Working with Cross-Tab Reports


„ Pivot Table experience is beneficial.

Create a Cross-Tab Report


1. Click Insert Cross-Tab .
2. Add the appropriate fields to the column, row and summarized field areas.
3. If grouping by date, select the date field and select Group Options… then select the appropriate interval and click OK .
4. Click OK when finished.
5. Place the cross-tab in the report.

Edit and Format a Cross-Tab Report


1. Right-click the Cross-Tab in the upper left (blank) corner and select Cross-Tab Expert…
2. On the Style tab, select a style.
3. On the Customize Style tab, select appropriate formatting for the sections of the cross-tab.
4. Click OK when finished.
5. To format individual cells and titles, select the individual cells and format using the formatting toolbar.

Change the Summary Operation Suppress the Totals


1. Right-click the Cross-Tab in the upper left (blank) 1. Right-click the Cross-Tab in the upper left (blank)
corner and select Cross-Tab Expert… corner and select Cross-Tab Expert…
2. Select the appropriate summary field and click 2. On the Customize Style tab, select the appropriate field
Change Summary and then select ; Suppress Subtotal.
3. Select a function and then click OK . 3. If necessary, select ; Suppress Column Grand Totals.
4. Click OK when finished. 4. Click OK when finished..

Repeat Row Headers for Multi-Page Cross- Create a Chart of the Cross-Tab
Tabs 1. In Design view, select Cross-Tab (upper left corner).
1. Right-click the Cross-Tab in the upper left (blank) corner
and select Cross-Tab Expert… 2. Insert Chart and select appropriate chart style.
2. On the Customize Style tab, select ;Repeat Row Labels.
3. Click OK when finished.

Use Alias Name for Column and Row Dimensions


1. Right-click the Cross-Tab in the upper left (blank) corner and select Cross-Tab Expert…
2. On the Customize Style tab, select the appropriate field.
3. In Alias for Formula: type the alias name.
4. Click OK when finished.
5. Format the appropriate field using the Formula Workshop X+2 .
EXAMPLE for changing the font color:
if Month(GridRowColumnValue (“AliasName”) in [1,2,3] then crRed
else if Month(GridRowColumnValue (“AliasName”) in [4,5,6] then crBlue
else if Month(GridRowColumnValue (“AliasName”) in [7,8,9] then crLime
else crFuchsia
6. Click OK when finished.

page 2 Shared Computing Services


Crystal Reports 9
Level II, Proficient

Use the Running Totals Feature


Create a Running Total for a List of Create a Conditional Running Total
Numbers 1. Select Running Total Fields in Field Explorer and
1. Select Running Total Fields in Field Explorer and then
then click New .
click New . 2. Provide a Running Total Name:
2. Provide a Running Total Name: 3. Select the appropriate field under Available Tables
3. Select the appropriate field under Available Tables and and Fields and add > it to the Summary section.
Fields and then add > it to the Summary section. 4. Select the Type of Summary from the drop-down list.
4. Select the Type of Summary from the drop-down list. 5. In the Evaluate section, select €Use a Formula and
5. Select how to Evaluate and when to Reset in each section. then click Formula Workshop X+2 .
6. Click OK when finished. 6. Enter the conditional statement, save and close to
7. Insert the running total field into your report. return to the Create a Running Total dialog box.
7. Select when to Reset.
8. Click OK when finished.

Prompting with Parameters


Create a Parameter Field
1. Select Parameter Fields in Field Explorer and then click New .
2. Enter the Name, Prompting Text, and select the Value type.
3. Select if you want to Allow multiple values, then select if the values are to be discrete or a range.
4. To set a default entry, click Set default values .
a. Select the table for the Browse Table: field and the appropriate field with the parameters for the Browse Field: field.
b. Select or enter the value to add: select the default value and then add > it to the Default Values list.
OPTIONAL: If you are using a date/time field, you may select Range Limited Field and provide a beginning and ending date for the
range. This will not allow selections outside the range limit.
c. Click OK to return to the Create Parameter Field dialog box.
5. Click OK when finished.

6. To apply the parameter to the report, click Select Expert .


7. Select the field the parameter is based on to filter by and then click OK .
8. Select the is equal to comparison operator from the dropdown list.
9. Select the new parameter {?ParameterName}in the criteria dropdown list and then click OK .

Create a Pick List


1. From the Create Parameter Field dialog box, click Set default values .
2. Browse Table: select the table to use
Browse Field: select the appropriate field that contains the parameters.
3. Select or enter the value to add: select all values and then click > to add then to the Default Values list. „This will only
allow up to 250 values. For more, import a pick list.
4. Click OK to return to the Create Parameter Field dialog box.
5. Click OK when finished.

Shared Computing Services page 3


Crystal Reports 9
Level II, Proficient

Import a Pick List


1. First, create a text file with all values needed for the pick list.
a. Create new blank report with the table that contains your values for the pick list.
b. Add the field with the values for the pick list in the Detail section and preview.
c. Export as a text file.
d. Open the text file in Notepad and delete the space at the beginning of each line, then save and close.
2. From the Create Parameter Field dialog box,
click Set default values .
3. Click Import pick list and select the text file containing the values, then click OK .
4. Click OK when finished.

Add a Parameter Field to a Text Object


In Design view, insert a text object and then drag the parameter field into the text object.

Use a Parameter to Conditionally Display a Message


1. Open the Section Expert for the section and click Formula Workshop X+2 for the appropriate formatting option.
2. Use the appropriate parameter when creating the conditional statement.
3. Save and close the formula.
4. Click OK when finished.

Use an Edit Mask for a Parameter


1. From the Create Parameter Field dialog box, click Set default values .
2. Enter the appropriate characters for the Edit Mask: field.
3. Enter the appropriate characters for the Select or enter the value to add: field.
4. Click OK to return to the Create Parameter Field dialog box.
5. Click OK when finished.
Masking Characters Used in an Edit Mask for a Parameter
A Allows an alphanumeric character and requires the entry of a character.
a Allows an alphanumeric character and does not require the entry of a character.
0 Allows a numeric digit and requires the entry of a character.
9 Allows a numeric digit and does not require the entry of a character.
# Allows a digit, space or +/- and does not require the entry of a character.
L Allows a letter and requires entry of a character.
? Allows a letter and does not require entry of a character.
& Allows any character or space and requires the entry of a character.
C Allows any character or space and does not require the entry of a character.
.,:;-/ Separator character. Inserting separator characters is like hard coding the formatting for the parameter. When the
field is placed on the report, the separator character appears in the field as a character.
< Causes following character to be converted to lower case.
> Causes following character to be converted to upper case.
\ Causes the following single character to be taken as literal. Use this to add separators that are different from the
defined separator characters.
Password Allows you to create a conditional formula to specify that certain sections of the report are visible only when certain
user passwords are entered.

page 4 Shared Computing Services


Crystal Reports 9
Level II, Proficient

Use a Parameter to Define the Sort Order for a Report


1. From the Create Parameter Field dialog box, click Set default values .
2. Add appropriate fields as default values, then click OK .
3. Deselect †Allow editing of default values when there is more than one.
4. Create a Sort Formula using the Sort Parameter.
EXAMPLE
If {?Sort Parameter} = “City” then {Customer.City}
else if {?Sort Parameter} = “Region” then {Customer.Region}
else {Customer.Customer Name}
5. Save and close formula.

6. Open Sort Expert and add the Sort Formula to the Sort Fields: list, then click OK .

Use Subreporting as a Workaround Solution


Insert an Unlinked Subreport into a Create a Report with a Linked Subreport
Report
1. Click Insert Subreport .
1. Click Insert Subreport . 2. Select €Chose a report J Browse….
2. Select €Chose a report J Browse…. 3. Select the report and then click Open .
3. Select the report and then click Open . 4. On the Link tab, select the linked field from the Select
4. Click OK when finished. data in subreport based on field.
5. Place the subreport in the main report. 5. Click OK when finished.
6. Place the subreport in the main report.
Once a report has been added to another report as a 6. Click OK when finished.
subreport, it maintains no link to the original report.
To create a link, go to Format J Subreport and Create an On-Demand Subreport
select ;Re import when opening.
1. Open the properties of the subreport.
2. On the Subreport tab, select ;On-demand subreport
3. Click X+2 after On-demand subreport caption and
Pass Data from the Main Report into a type the caption’s text to appear.
Subreport 4. Save and close the formula.
1. Double-click the subreport to edit. 5. Click OK when finished.
2. Create a parameter field to hold the transferred information. 6. Deselect the subreport before you preview.
3. Save and close, then return to the main report in Design view. 7. Click the subreport caption to view.
4. Right-click the subreport J Change Subreport Links…
5. Create a field link from the subtotal, grand total or formula
field in the main report to the parameter field in the subreport.

Shared Computing Services page 5


Crystal Reports 9
Level II, Proficient

Create Report Alerts


Create a Report Alert Using Report Alerts with Parameters
1. Go to Report J Alertsf Create or Modify Alerts… 1. Create Threshold parameter with prompting text to
2. Click New in Create Alerts window. enter the threshold amount.
3. Name the alert and type a message to appear. 2. Create a new alert for the threshold amount (Go to
4. Click Condition and type conditional formula. Report J Alerts f Create or Modify Alerts…).
5. Save and close formula. 3. Name the alert and type a message to appear.
WARNING!
6. Be sure ;Enabled is select, This suppresses and not filters 4. Click Condition and type conditional formula to
and then click OK . records! The tree and record count include the {?Threshold} field.
still show all 5. Save and close formula.
6. Be sure ;Enabled is select, and then click OK .

Advanced Linking
Add a Table Twice to a Report and Create an Change the Join Type
Alias 1. Open the Database Expert, Links tab and right-
1. Open the Database Expert and add the table to be used again. click the link.
2. Select the table name (i.e. TableName_1), then click the name 2. Select the option button for the correct SQL Join
again to edit. Type the table’s alias name then press ENTER. Type and then click OK .
3. On the Links tab, click Clear Links and then click Yes . 3. Click OK to close then OK to refresh the data.
4. Create a link from the primary key of the original table to the
primary key of the alias table.
5. Click OK and then Cancel .

Creating Powerful Groups


Create a Hierarchical Group Create a Hierarchical Group Summary
1. Go to Report J Hierarchical Grouping Options… 1. Insert a summary for a field and
2. Select the field to sort by and then select ;Sum across hierarchy before you click OK .
select ;Sort Data Hierarchically.
3. Select a field for the Parent ID: field.
4. Select a measurement for the Group Indent: field.
5. Click OK when finished.

Customize the Group Name Field Use a Formula to Customize


Using a Field Name the Group Name Field
1. Right-click Group Header section J Change Group… 1. Right-click Group Header section J Change
2. Select ;Customize Group Name Field and €Choose Group…
from Existing Field. 2. Select ;Customize Group Name Field
3. Select the appropriate field name and then click OK . 3. Select €Use a Formula as a Group Name and then
click Formula Workshop X+2 .
4. Type the formula, then save and close the formula.
5. Click OK when finished.

page 6 Shared Computing Services


Crystal Reports 9
Level II, Proficient
Define Specified Order Grouping
1. Create Grouping formula based on a field.
2. Insert a group based on the Grouping formula and select to group in specified order.
3. Type the group name in Named Group: and then click New .
4. Select the comparison operator and provide the parameters.
5. Click OK when finished with this group.
6. Repeat steps 3-5 until all groups are defined.
a. To list in a specific order, edit Group #1 and click the Specified Order tab.
b. Select group name and move © to top of list.
7. On the Others tab, select how all others not previously defined will be grouped.
8. Click OK when finished.

Group on a Formula Field


1. Create a Group Parameter with prompting text to ask the user to select a field to group the report by.
2. Create a Group Formula using the {?Group Parameter}.
EXAMPLE:
if{?group parameter} = “City” then {Customer.City} else {Customer.Region}
3. Insert a group based on the {@Group Formula} field.

Use Group Selection to Filter the Records in the Report


1. Go to Report J Edit Selection Formula J Group… OR 1. Select a summary field and open the Select
2. Create a formula with a condition for the Group Name. Expert.
3. Save and close the formula. 2. Select a comparison operator and a parameter for
4. Save the report and refresh the data. comparison.
„ Data is hidden, not filtered! 3. Click OK when finished.
4. Save the report and refresh the data.
„ Data is hidden, not filtered!

Using Control Structures


Use a Select Expression for Evaluation
1. Add selection criteria on the appropriate field equal to your selection.
2. Create an Evaluation formula.
EXAMPLE:
Select Sum({TableName.FeildName},{TableName.FieldID})
case is <50: “***Needs Attention***”
case is <60: “Poor”
case is <70: “Fair”
case is <80: “Good”
case is <90: “Excellent”
default: “Superior”
3. Insert the Evaluation formula into your report.

Shared Computing Services page 7

Das könnte Ihnen auch gefallen