Вы находитесь на странице: 1из 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 automatically. A Crystal Report Wizard 9 menu option is added to the Tools menu and a button is added to the Standard toolbar in Excel.
WARNING! Reports created using the Add-ins automatically use the default file options (i.e. DateTime field, formats, 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. 2. 3. 4. 5. When in Excel or Access, go to Tools Crystal Report Wizard OR click Click Range Select and then click somewhere inside the database. in Excel.

Expand the selected range automatically. The range database will appear. Click Click Create Crystal Report . The Crystal Report 9 Wizard opens. 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. 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. 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. 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. 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. Next > 10. Add style to the report Type the Report Title: and select a style 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 Later
Finish

Power Formatting with Multiple Sections


Insert an Additional Section
1. 2. In Design view, click-and-drag the vertical separator for the section to duplicate to reveal Section a and Section b. where you can choose to Open the Section Expert merge, move, delete or underlay.

Conditionally Format Multiple Sections


1. 2. 3. 4. In Design view, insert another section. Add a text object to Section b with the text to appear. Open the Section Expert for Section b. Click Formula Workshop X+2 after Suppress (No 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. 2. 3. 4. 5. Click Insert Cross-Tab . Add the appropriate fields to the column, row and summarized field areas. If grouping by date, select the date field and select Group Options then select the appropriate interval and click OK . Click OK when finished. Place the cross-tab in the report.

Edit and Format a Cross-Tab Report


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

Change the Summary Operation


1. 2. 3. 4. Right-click the Cross-Tab in the upper left (blank) corner and select Cross-Tab Expert Select the appropriate summary field and click Change Summary Select a function and then click OK . Click OK when finished.

Suppress the Totals


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

Repeat Row Headers for Multi-Page CrossTabs


1. 2. 3. Right-click the Cross-Tab in the upper left (blank) corner and select Cross-Tab Expert On the Customize Style tab, select Repeat Row Labels. Click OK when finished.

Create a Chart of the Cross-Tab


1. 2. In Design view, select Cross-Tab (upper left corner). Insert Chart and select appropriate chart style.

Use Alias Name for Column and Row Dimensions


1. 2. 3. 4. 5. Right-click the Cross-Tab in the upper left (blank) corner and select Cross-Tab Expert On the Customize Style tab, select the appropriate field. In Alias for Formula: type the alias name. Click OK when finished. 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 Click OK when finished.

6.

page 2

Shared Computing Services

Crystal Reports 9
Level II, Proficient

Use the Running Totals Feature


Create a Running Total for a List of Numbers
1. 2. 3. 4. 5. 6. 7. Select Running Total Fields in Field Explorer and then . click New Provide a Running Total Name: Select the appropriate field under Available Tables and Fields and then add > it to the Summary section. Select the Type of Summary from the drop-down list. Select how to Evaluate and when to Reset in each section. Click OK when finished. Insert the running total field into your report. 2. 3. 4. 5. 6. 7. 8.

Create a Conditional Running Total


1. Select Running Total Fields in Field Explorer and . then click New Provide a Running Total Name: Select the appropriate field under Available Tables and Fields and add > it to the Summary section. Select the Type of Summary from the drop-down list. In the Evaluate section, select Use a Formula and then click Formula Workshop X+2 . Enter the conditional statement, save and close to return to the Create a Running Total dialog box. Select when to Reset. Click OK when finished.

Prompting with Parameters


Create a Parameter Field
Select Parameter Fields in Field Explorer and then click New . Enter the Name, Prompting Text, and select the Value type. Select if you want to Allow multiple values, then select if the values are to be discrete or a range. 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. 1. 2. 3. 4. 6. 7. 8. 9. To apply the parameter to the report, click Select Expert . Select the field the parameter is based on to filter by and then click OK . Select the is equal to comparison operator from the dropdown list. Select the new parameter {?ParameterName}in the criteria dropdown list and then click OK .

Create a Pick List


1. 2. 3. 4. 5. From the Create Parameter Field dialog box, click Set default values . Browse Table: select the table to use Browse Field: select the appropriate field that contains the parameters. 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. Click OK to return to the Create Parameter Field dialog box.
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. From the Create Parameter Field dialog box, click Set default values . Click Import pick list and select the text file containing the values, then click OK . Click OK when finished.

2. 3. 4.

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. 2. 3. 4. Open the Section Expert for the section and click Formula Workshop X+2 for the appropriate formatting option. Use the appropriate parameter when creating the conditional statement. Save and close the formula. Click OK when finished.

Use an Edit Mask for a Parameter


1. 2. 3. 4. 5. From the Create Parameter Field dialog box, click Set default values . Enter the appropriate characters for the Edit Mask: field. Enter the appropriate characters for the Select or enter the value to add: field. Click OK to return to the Create Parameter Field dialog box. Click OK when finished. Allows an alphanumeric character and requires the entry of a character. Allows an alphanumeric character and does not require the entry of a character. Allows a numeric digit and requires the entry of a character. 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. 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. 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. Allows you to create a conditional formula to specify that certain sections of the report are visible only when certain user passwords are entered.

Masking Characters Used in an Edit Mask for a Parameter


A a 0 9 # L ? & C .,:;-/ < > \ Password

page 4

Shared Computing Services

Crystal Reports 9
Level II, Proficient

Use a Parameter to Define the Sort Order for a Report


1. 2. 3. 4. From the Create Parameter Field dialog box, click Set default values . Add appropriate fields as default values, then click OK . Deselect Allow editing of default values when there is more than one. 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} Save and close formula. Open Sort Expert and add the Sort Formula to the Sort Fields: list, then click OK .

5. 6.

Use Subreporting as a Workaround Solution


Insert an Unlinked Subreport into a Report
1. 2. 3. 4. 5. Click Insert Subreport . Select Chose a report Browse. Select the report and then click Open . Click OK when finished. Place the subreport in the main report. Once a report has been added to another report as a subreport, it maintains no link to the original report. To create a link, go to Format Subreport and select Re import when opening.

Create a Report with a Linked Subreport


1. 2. 3. 4. 5. 6. 6. Click Insert Subreport . Select Chose a report Browse. Select the report and then click Open . On the Link tab, select the linked field from the Select data in subreport based on field. Click OK when finished. Place the subreport in the main report. Click OK when finished.

Create an On-Demand Subreport


1. 2. 3. 4. 5. 6. 7. Open the properties of the subreport. On the Subreport tab, select On-demand subreport Click X+2 after On-demand subreport caption and type the captions text to appear. Save and close the formula. Click OK when finished. Deselect the subreport before you preview. Click the subreport caption to view.

Pass Data from the Main Report into a Subreport


1. 2. 3. 4. 5. Double-click the subreport to edit. Create a parameter field to hold the transferred information. Save and close, then return to the main report in Design view. Right-click the subreport Change Subreport Links 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
1. 2. 3. 4. 5. 6. Go to Report Alerts Create or Modify Alerts Click New in Create Alerts window. Name the alert and type a message to appear. Click Condition and type conditional formula. Save and close formula. WARNING! Be sure Enabled is select, This suppresses and not filters records! The tree and record count and then click OK .
still show all

Using Report Alerts with Parameters


1. 2. 3. 4. 5. 6. Create Threshold parameter with prompting text to enter the threshold amount. Create a new alert for the threshold amount (Go to Report Alerts Create or Modify Alerts). Name the alert and type a message to appear. Click Condition and type conditional formula to include the {?Threshold} field. Save and close formula. Be sure Enabled is select, and then click OK .

Advanced Linking
Add a Table Twice to a Report and Create an Alias
1. 2. 3. 4. 5. Open the Database Expert and add the table to be used again. Select the table name (i.e. TableName_1), then click the name again to edit. Type the tables alias name then press ENTER. On the Links tab, click Clear Links and then click Yes . Create a link from the primary key of the original table to the primary key of the alias table. Click OK and then Cancel .

Change the Join Type


1. 2. 3. Open the Database Expert, Links tab and rightclick the link. Select the option button for the correct SQL Join Type and then click OK . Click OK to close then OK to refresh the data.

Creating Powerful Groups


Create a Hierarchical Group
1. 2. 3. 4. 5. Go to Report Hierarchical Grouping Options Select the field to sort by and then select Sort Data Hierarchically. Select a field for the Parent ID: field. Select a measurement for the Group Indent: field. Click OK when finished.

Create a Hierarchical Group Summary


1. Insert a summary for a field and select Sum across hierarchy before you click OK .

Customize the Group Name Field Using a Field Name


1. 2. 3. Right-click Group Header section Change Group Select Customize Group Name Field and Choose from Existing Field. Select the appropriate field name and then click OK .

Use a Formula to Customize the Group Name Field


1. 2. 3. 4. 5. Right-click Group Header section Change Group Select Customize Group Name Field Select Use a Formula as a Group Name and then click Formula Workshop X+2 . Type the formula, then save and close the formula. Click OK when finished.

page 6

Shared Computing Services

Crystal Reports 9
Level II, Proficient

Define Specified Order Grouping


1. 2. 3. 4. 5. 6. Create Grouping formula based on a field. Insert a group based on the Grouping formula and select to group in specified order. Type the group name in Named Group: and then click New . Select the comparison operator and provide the parameters. Click OK when finished with this group. 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. On the Others tab, select how all others not previously defined will be grouped. Click OK when finished.

7. 8.

Group on a Formula Field


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

3.

Use Group Selection to Filter the Records in the Report


1. 2. 3. 4. Go to Report Edit Selection Formula Group Create a formula with a condition for the Group Name. Save and close the formula. Save the report and refresh the data. Data is hidden, not filtered!

OR

1. 2. 3. 4.

Select a summary field and open the Select Expert. Select a comparison operator and a parameter for comparison. Click OK when finished. 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

Вам также может понравиться