Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute...

30
For Evaluations Only Do Not Distribute Crystal Report 2008 Fundamentals Jeff Hutchinson Excel Networks www.excel-networks.com

Transcript of Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute...

Page 1: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Report 2008 Fundamentals Jeff Hutchinson Excel Networks www.excel-networks.com

Page 2: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 - Fundamental Concepts

This book is used to enhance basic report writing skills. You will learn how to interface with databases, format a report, build groups, develop conditional formatting to enhance your reports, filter the records using select expert, build formulas to fix problems, as well as charting and export capabilities. Learning Crystal Reports on your own could be a very overwhelming experience as you are dealing with various reports, databases, and dynamic data. This book will guide you through the process to understand all of the important concepts. After you study this book, you will then feel very comfortable with using reporting and analyzing data. Experienced students find this book to be very enlightening because there are many features they haven’t previously used that could enhance their reports and increase productivity.

This book is designed in conjunction with an Online-Instructor-Led course (for more information see: www.excel-networks.com). Unlike other manuals, you will not need to review lengthy procedures in order to learn a topic. All you will need are the brief statements and command paths located within the book to show you how to use a concept. Furthermore, you will find that this book is often used as a reference to help comprehend a concept quickly, and an index is provided on the last page of the book to reference pages as needed. However, if more detail is needed, you can always use the Internet to search a concept. Also, if your skills are weak due to lack of use, you can refresh your memory quickly by visually scanning the concepts needed and then testing them out using the application.

Table of Contents Chapter 1 - Simple Report ......................................................................................... 3 Chapter 2 - Format ..................................................................................................... 5 Chapter 3 - Select Expert ........................................................................................... 8 Chapter 4 - Grouping ............................................................................................... 10 Chapter 5 - Database Expert ................................................................................... 14 Chapter 6 - Formulas ............................................................................................... 17 Chapter 7 - Conditional Formatting ....................................................................... 22 Chapter 8 - Charts .................................................................................................... 23 Chapter 9 - Export .................................................................................................... 26 Appendix A - Report Prototype Form .................................................................... 27 Crystal Reports 2008 - Fundamentals Index .......................................................... 28 About the Author Jeff Hutchinson is a computer instructor teaching a variety of classes around the country. He has a BS degree from BYU in Computer Aided Engineering and has worked in the Information Technology field supporting and maintaining computers for many years. He also owned a computer training and consulting firm in San Francisco, California, and after selling his business in 2001, he has continued to work as an independent computer instructor in California and Utah. Mr. Jeff Hutchinson lives in Utah and provides training for the Utah Valley University Community Education system, offering valuable computer skills for the general knowledge of students, career development, and career advancement. Understanding the technology and the needs of students has been the basis for developing this material. Jeff Hutchinson can be contacted at [email protected] or (801) 376-6687.

Page 3: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 2

Exercise Download Exercises are posted on the web site and can be downloaded to your computer. Please do the following: Open Internet Explorer. Type the web address: excel-networks.com/download/cr2008-1.exe You might get several security warnings, but answer yes and run through each one. When you click “Unzip,” the files will be located in C:\Data\CR2008-1 folder.

If there are any questions or problems, please contact Jeff Hutchinson at: [email protected]

Note: You can also download the file at: excel-networks.com/download/cr2008-1.zip

Copyright and Release Information This document was updated V3 on 5/14/2014 and is designed for Crystal Reports 11R2, 2008, 2011 and 2013. Some databases have Crystal Reports V8.5, 9, 10 installed and are still used, with many of the features remaining the same. However, some of the functionality is different from version 11.0 to Version 11.5 (11Release2). The Icons are the same for CR2008(V12), CR2011(V13) and CR2013(V14). The material is the sole property of Jeff Hutchinson and Excel Networks. Any emailing, copying, duplication or reproduction of this document must be approved by Jeff Hutchinson in writing or Email. However, students who take a class or purchase the material can use this document for personal development and learning.

Legend Numbered sections on the left are the Concepts. Italic text is used to highlight commands that will perform the concept or procedure to complete the practice exercises. Practice Exercises are a Step-by-Step approach to performing concepts. Student Projects are Independent Exercises used to perform concepts. Dark, Grayed-Out Sections are optional/advanced concepts. Bolded items are menus, ribbons, or commands used.

Page 4: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 3

Crystal Reports 2008 - Fundamental Concepts

Chapter 1 - Simple Report In this chapter, we will outline a general overview and create many different types of reports. This will provide the hands-on experience needed for comprehension and understanding.

Concept Explanation / Command String in italic. Practice Exercise 1 Appendix A - Report Prototype Form. Set up Instructions Open Crystal ReportsFileNewBlank Report+Create New

ConnectionAccess/Excel (DAO)Make New ConnectionClick on the iconC: \Data\CR2008-1\xtreme012.mdb OpenFinish

Ok. Crystal Reports Versions

Some databases have Crystal Reports V8.5, 9, 10, and are still used, but many of the features remain the same except for new features added. Some of the functionality is different from version 11.0 to Version 11.5 (11Release2). The Icons are the same for CR2008(V12), CR2011(V13) and CR2013(V14).

1.1 Create New Report

FileNewBlank Report.

1.2 Window Sections

Report Header, Page Header, Details, Report Footer, and Page Footer.

1.3 Field Explorer

Most important, it is used to add fields to report. Icon used for CR9,

CR10, and CR11R2. 1.4 Design/Preview/

Refresh

You must press the Refresh F5 key button the first time to see the Preview tab. Icon used for

CR11R2.

Icon used for CR9 &CR10.

Practice Exercise 2 FileNewBlank ReportAccess/ExcelC:\Data\CR2008-1\Xtreme012.mdbFinishEmployee table OKField ExplorerPlace in the Details section {Employee ID}, {First Name}, and {Last Name}Refresh .

1.5 Menu bar Located on top of screens. 1.6 DB Expert

Used to add tables from a database. Icon used for CR9, CR10, & CR11R2.

1.7 Report Explorer

This is used to modify or format placed fields when a report is completely laid out.

Icon used for CR11R2.

Icon used for CR9 and CR10.

1.8 Record Sort

Used to sort records in the “Details” section Icon used for CR9, CR10, and CR11R2.

1.9 Insert Text Object

Used to add titles and labels. Icon used for CR9,

CR10, and CR11R2.

1.10 Placement of From the field explorer, you can Drag n Drop a field in the details section.

Page 5: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 4

fields Also available is: R-ClickInsert to report. 1.11 Arrows on keyboard

Select field on reportUp, Down, Right, Left on keyboard.

1.12 Resizing Fields Highlight a field in the reportLocate the arrows on the bordermove the arrow to change the size of the field. Also, you can: Hold the Shift keypress the Arrow key.

1.13 Size and position

Used to change the detailed coordinates: Right-ClickSize and Position.

Practice Exercise 3 Place the following fields:{Position}, {Salary} and use the above tools covered.

1.14 Select all section objects

Right-Click in the page header section on the Left side of screenSelect all section objects.

1.15 Make Same Size

This is used to resize the placed fields to become the same size. It will match the fields with the reference point. Note: The reference point will have dots around the edge of the field. Select all section objectsIdentify the reference pointFormat Make Same SizeHeight.

1.16 Aligning Objects

This will align all section objects based on a reference point. Select all section objectsIdentify the reference pointFormatAlign. Note: You can also align fields in different sections by using the Ctrl to select. Example: select the first label, group header name and the first record in the details sectionFormatAlignLefts.

Practice Exercise 4 Adjust field positionsSelect all section objectsMake Same Size and Align fields.

1.17 Browse data Provides 500 records in list, data type and maximum records. Right-Click on any fieldBrowse Field Data.

1.18 Fields in Text

Boxes

This will add fields to a text box. Create a Text BoxPlace fields inside a text box.

Icon used for CR9, CR10, and CR11R2.

Practice Exercise 5 Add a text box in the details sectionAdd {Last Name}, space and then {First Name} in the text box.

1.19 Right Pane Layout

Adjust the side panels to Floating, Auto hide, Stacked, and Tabbing on the bottom.

1.20 Status Bar Observe the number of records located on the bottom right side of screen. Student Project A Customer table

FileNewBlank ReportXtreme012.mdbCustomer tableOKField ExplorerPlace in the Details section {Customer ID}, {Customer Name}, {First Name}, {Last Name}and {Last Year’s Sales}Refresh . (Used for CR9&10).

Student Project B Customer/Order table

FileNewBlank ReportXtreme012.mdbCustomer and Orders table OKField ExplorerPlace in the Details section {Customer ID}, {Customer Name}, {Order ID}, {Order Date}, and {Order Amount}Refresh . (Used for CR9&10).

Student Project C Product table

FileNewBlank ReportXtreme012.mdbProduct tableOKField ExplorerPlace in the Details section {Product ID}, {Product Name}, {Size}, {M/F}, and {Color}Refresh .

R-Click Here

Page 6: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 5

Optional Topics

1.21 Standard Report Wizard

Used to create a report by asking questions. FileNewStandard Report Wizard.

1.22 Find EditFind. 1.23 Grid FileOptionsLayout. 1.24 Guides The tabs located on the top of the design view:

. The red markers must be lined up if not connected.

1.25 Snap to grid FileOptionsLayout Snap To Grid. 1.26 Saving Report /Autosave

Used to place a screen capture on the first page when opening a file. To view the screen capture: FileOpen Extra Large IconsThe Icon will display the screen capture. To allow a capture when saving: FileOptionsReporting

AutosaveOKFileSave AsTest.rpt. 1.27 Help F1 key or HelpCrystal Reports Help. 1.28 Group Tree Located on the left side of the screen. Student Project D Standard Report Wizard

1. FileNewStandard Report Wizard. 2. DataMake New ConnectionXtreme012.mdbFinish. 3. Add tables: Customer tableNext. 4. Add fields: {Customer ID}, {Customer Name}, {City}, {Region}, {Last Year’s Sales}Next. 5. Add Grouping: {Country}Next. 6. Summarize: Sum of Customer {Last Year’s Sales}Next. Note: Remove any other summary listing. 7. Group Sorting: NoneNext. 8. Chart: X No ChartNext. 9. Record Selection: Choose no record selectionNext. 10. Template: Choose Block (Blue)Finish. Note: Use the page button to page to different countries.

Student Project E Mailing Label Wizard

1. FileNewMailing Label Report. 2. DataXtreme012.mdbTablesAdd the Customer tableNext. 3. Add fields: {Customer Name}, {Address1}, {Address2}, {City}, {Region}, and {Postal Code}Next. 4. Mailing Label Type: Address (Avery 5160)Next. 5. Record Selection: Choose no record selection at this time. 6. Finish.

Chapter 2 - Format In order for a report to look presentable, we will test out the many unique formatting features available.

Practice Exercise 6 FileNewBlank ReportXtreme012.mdbEmployee tableAdd fields {Employee ID}, {Last Name}and {Notes}.

2.1 Format toolbar Format toolbar:

. 2.2 Format Dialog box

Right-Click on any fieldFormat. Icon used for CR11R2.

Page 7: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 6

Icon used for CR9 &CR10.

2.3 Border tab Changes the border around a field. Practice Exercise 7 Create a text title in the Report Header section called “Employee

Report”Select a text fieldR-ClickFormatadd a border, drop shadow and background to the title.

2.4 Font tab Changes the text font, style (bold, Italic), size, and color properties. Practice Exercise 8 Select a text field such as {Last name}R-ClickFormatadd font, style,

size, and color. 2.5 General tab There are some unique concepts directly related to Crystal Reports. 2.5a Read Only Sets the selected field to Read only. Right-Click on a

fieldFormatCommon tab Read Only. 2.5b Lock Position / Size

Locks or fixes the position of selected fields in the section. Right-Click on a fieldFormatCommon tab Lock Position and Size.

2.5d Text Rotation

Rotates the field label 0, 90 or 270 degrees.

Practice Exercise 9 Select a label in the report in the Page Header sectionR-ClickFormatGeneral tabtest Lock Position, Read Only, Suppress, and Text Rotation.

2.5c Can Grow Allows a text to grow larger than a single line or 0=unlimited. Practice Exercise 10 Can Grow

R-Click on the {Notes} fieldFormat fieldCommon tab Can GrowMaximum number of Lines=0Preview Report Maximum number of Lines=2Preview Report.

2.6 Format Data Types

Each data type will display a tab to allow formatting for String, Number, Date, and Boolean.

Practice Exercise 11 R-click on a number fieldFormatNumber tab. Practice Exercise 12 R-click on a date fieldFormatDate tab. 2.7 Add Box

This must completely surround the details section. Also, Zoom into 200% to see the exact position of the box. InsertBox.

Icon used for CR9, CR10, and CR11R2.

2.8 Add a Line

InsertLine. Icon used for CR11R2. Icon used for CR9&CR10.

2.9 Add a Picture

InsertPicture. Icon used for CR9, CR10, and CR11R2.

Practice Exercise 13 Insert group “Reports To”Add a box around the details section remove the underlineadd line under the page header labels add picture in report header from C:\Data\CR2008-1\xtreme.bmp.

2.10 Special Fields Located in bottom portion of the Field Explorer. 2.10a Data Date The date the data was refreshed. 2.10b File Author

Update field: FileSummary InfoAuthor: Name.

2.10c Modification Date

The date the report was last modified.

2.10d Page N of M

Enters the page and total number of pages in report.

Page 8: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 7

2.10e Page Number

Enters the current page number only.

2.10f Print Date The current date when the report prints. 2.10g Report Title

Update field: FileSummary InfoTitle: Title name.

Practice Exercise 14 Add page number, File Author and Date Data to the page footer section. Student Project F

1. FileNewBlank ReportXtreme012.mdbOrders table. 2. Add fields {Order ID}, {Order Date}, {Required Date}, {Ship Date}, {Order Amount}, and {Payment Received}. 3. Add a title of “Unpaid Orders” to the report header. 4. Format the title to be centered in its text object. Add a double-lined border, a drop shadow, and any border and background color you choose. Make the text bold and 20pt. 5. Select all labels in the Page Header section. Make them bold and remove the underline. 6. Draw a line under the field labels in the page header and format the line with any style, width and color you choose. 7. Insert the C:\data\CR2008-1\Xtreme.bmp logo in the Report Header to the right of the title object. 8. Remove the thousand separators from the Order ID field. 9. Add a Fixed currency symbol to the Order Amount field. 10. Format the Payment Received field to read Y/N. 11. Format the Order Date, Required Date and Ship Date to display the date only.

2.11 Page Setup FilePage Setup

Optional Topics

2.12 Paragraph tab Paragraph formatting can be done in the toolbar. 2.13 Hyperlink tab Right-Click on a hyperlink fieldFormatHyperlink tab.

To use it: Right-Click on a fieldHyperlink. Practice Exercise 15 FileNewBlank ReportXtreme012.mdbCustomer tableAdd

fields {Customer ID}, {Email}, and {Web Site}R-Click on the {Email} fieldFormatHyperlink tabFormat the {Email} and the {Web Site} fields.

2.14 Template Expert

Used to reformat the entire report. Icon used for CR9, CR10, and CR11R2.

2.15 Format Painter

Paints the format of another object. Select original fieldFormat PainterSelect unformatted field.

Icon used for CR11R2.

2.16 OLE Object Object Linking and Embedding allows embedding a non-Crystal file format into a report such as Word or Excel. InsertOLE Objectenter file name.

Practice Exercise 16 OLE

InsertOLE ObjectCreate from file C:\Data\CR2008-1\ MSWord Example.docPlace in Report Header.

2.17 Current CE User Name

Displays the name of the current BusinessObjects Enterprise user.

Page 9: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 8

Chapter 3 - Select Expert Selecting or filtering the amount of records presented will bring the report in line with the desired results.

3.1 Select Expert Icon Filters records in the database. Icon used for CR9, CR10,

and CR11R2. Practice Exercise 17 FileNewBlank ReportAdd Customer table and Orders

tableOKField ExplorerPlace in the Details section {Customer Name}, {Order ID}, {Order Date}, and {Order Amount}Refresh .

3.2 String Based Criteria

Starts with, Does not Start With, Is Like and Is Not Like.

3.2a equal to “Is equal to” or “Is not equal to.” 3.2b one of “Is one of” or “Is not one of.” 3.2c less than “Is less than”, “Is not less than” or “equal to.” 3.2d greater than

“Is greater than”, “Is not greater than” or “equal to.”

3.2e is between “Is between” and “Is not between.” This includes the entered value. 3.2f starts with Uses the first letter as the criteria. 3.2g Is Like Uses wild characters such as * and ?. Practice Exercise 18 Create a select criteria for {Customer Name}Use “Equal to”, “one of”,

“less than”, “greater than”, “Is Between”, “starts with”, and “is like” criteria.

3.3 Number Based Criteria

The most commonly used is “greater than”, “less than”, and “is between.”

3.3a Less than “Is less than,” “Is not less than” or “equal to.” 3.3b Greater than

“Is greater than,” “Is not greater than” or “equal to.”

3.3c Is Between “Is between” and “Is not between.” Practice Exercise 19 Create a select criteria for {Order Amount}Use Less than, Greater than,

and Is Between criteria. 3.4 Time Based Criteria

Special criteria used for date values.

3.4a less than “Is less than,” “Is not less than” or “equal to.” 3.4b greater than

“Is greater than,” “Is not greater than” or “equal to.”

3.4c Is Between “Is between” and “Is not between.” 3.4d Is In Period These are special accounting commands such as “YearToDate”,

“MonthToDate,” “Last7Days,” “Aged0To30Days,” “Aged31To60Days,” “Ages61To90Days,” “Over90Days,” etc.

Practice Exercise 20 Create a select criteria for {Order Date}Use Less than, Greater than, and Is Between criteria.

3.5 Boolean Based Criteria

Defined as an on or off switch such as 1/0, y/n, Yes/No, or True/False.

3.5a True Use the format to change to True, Yes, or 1. 3.5b False Use the format to change to False, No, or 0. Practice Exercise 21 Add field {Orders.Payments Received}Create a select criteria for

{Order.Payment Received}Use Is True and Is False. 3.6 Show Formula Allows one to change the formula code. 3.7 Multiple The default is the “And” operator.

Page 10: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 9

Criteria Practice Exercise 22 Create a select criteria for {Customer Name}Change the Select Criteria

to “Is Like” and search for “*bike*”Create a select criteria for {Order Amount}Change the Select Criteria to “Greater Than” and search values greater than 5000.

Student Project G Create an Orders report using the Select Expert criteria below: 1. FileNewBlank ReportXtreme012.mdb. 2. Add tables Orders, Orders_Detail, Product, Product_Type. 3. Add fields {Orders.Order ID}, {Orders.Order Amount}, {Orders.Order Date}, {Product.Product Name}, {Product.M/F}, and {Product_Type.Product Type ID}) 4. Create Select Expert to fulfill the following: a. Product Type ID between 4 and 8. b. Filter the M/F field to Men’s, Ladies, and Youth. c. Set the Order Amount to be greater than $2000. d. List only the year 2001. The report will look similar to the following:

Optional Topics

3.8 Group Filters Group names. Choose the drop down arrow next to the funnelGroup.

Available in Version 2008+

3.9 Saved Data

Sub-filter of record, does not go to database to get new data. Note: Version 2008+

3.10 Case insensitive

Applies to the current report: FileReport Options. Applies to all reports on computer: FileOptionsDatabase.

3.11 Show SQL Shows the SQL result of the select expert. DatabaseShow SQL Query.

Student Project H AND/OR

Complete the Student Project on 3.7. Go to the Select Expert/Show Formula and change all the AND operations to OR. The order of the select criteria is important. 1. You should get about 32 pages of orders if the following is the order of the criteria: {Product_Type.Product Type ID} in 4 to 8 or {Product.M/F} in ["youth", "mens", "ladies"] or {Orders.Order Amount} > $2000.00 or {Orders.Order Date} in DateTime (2005, 01, 01, 0, 0, 0) to DateTime (2005, 12, 31, 0, 0, 0) . 2. Change the order in the formula section. The following order will give you approximately 9 pages: {Product.M/F} in ["youth", "mens", "ladies"] or {Orders.Order Amount} > $2000.00 or {Orders.Order Date} in DateTime (2005, 01, 01, 0, 0, 0) to DateTime (2005, 12, 31, 0, 0, 0) or {Product_Type.Product Type ID} in 4 to 8.

Page 11: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 10

Chapter 4 - Grouping Grouping is a fundamental component of Crystal Reports. It is used to group records into a common segment. This can also be used to reduce the fields needed in the details section.

4.1 Insert Group

Insert Group Icon is used to insert a group and change the options only when you create the group.

Icon used for CR9, CR10, and CR11R2.

4.2 Group Expert

Group Expert Icon used to modify a group. Allows you to change the options after the group has been created.

Icon used for CR9, CR10, and CR11R2.

4.3 Group Sorting In Ascending Order, In Descending Order, In Original Order, and In Specified Order. Note: Specified Order will be covered in the next level class.

4.4 Group Options Customize Group Name, Keep Group Together, Repeat Group Header on each page, and Use a formula for group sorting.

Practice Exercise 23 Group Options

FileNewBlank ReportXtreme012.mdbPurchases tableAdd fields: {Product ID}, {Units in Stock}, and {Units on Order}Group by: {Reorder Level} Refresh and widen the details section so the report appears on 2 pagesReportGroup ExpertOptionsOptions tab Keep group togetherOKOKInspect Report and notice the groups stay togetherTurn off the Keep group together and turn on the Repeat Group Header On Each Page.

4.5 Multiple Groups

To see the multiple groups, use the Group Expert.

Student Project I Multiple Groups

1. FileNewBlank ReportXtreme012.mdbProduct table. 2. Add to the Details section: {Product ID}, {Product name}, {Color}, {M/F}, {Price(SRP)}, and {Product Type ID}. 3. InsertGroupGroup by {Product Class} - Ascending order. 4. InsertGroupGroup by {Size} - Descending order.

4.6 Group Tree Left side of screen used to navigate through the report. 4.7 Insert Summary

Usually applied to a group footer or header field. Icon used for CR9, CR10, and CR11R2.

4.7b Grand total Places a grand total summary in the Report Footer. Student Project J Insert Summary

Continue from the previous Student Project. 1. Create a summary field in each group based on {Price(SRP)}. Note: You could use Add to all group levels in version CR11R2+. 2. Create a Grand Summary. 3. Place labels next to each summary to better identify them. Click Text box Draw BoxEnter the appropriate text. 4. Reverse the order of the groups: Group ExpertGroup1={Size} and Group2={Product Class}. Notice the summaries remain in the group footer sections.

Page 12: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 11

5. In the Details section indent Group2 name so it appears nested under the Group1 name.

4.7c Operators Minimum, Maximum, Count, Distinct Count, Nth Largest, Nth Smallest, Mode, Nth Most Frequent, Sum, Average, Sample Variance, Sample Variance, Population Standard Deviation, Correlation With, Covariance With, Weighted Average With, Median, and Nth Percentile.

Student Project K Insert Summary

Create a summary report from the Employee table: 1. FileNewBlank ReportXtreme012.mdb. 2. Add Employee table. 3. Add fields {Employee ID}, {First Name}, {Last Name}, and {Salary}. 4. Create a group by: {Reports To}. 5. Create a text box in front of group name with the words “Department Number.” 6. Insert a Summary group with the following criteria:

The report will look similar to the following::

4.8 Percentage Located in the bottom part of the Summary Icon:

Student Project L Calculating Percentages

1. FileNewBlank ReportUsing the Xtreme012.mdb. 2. Add a Customer table. 3. Add the following to the Details Section: {Customer ID}, {Customer Name}, {City}, {Region}, and {Last Year’s Sales}. 4. InsertGroupGroup by {Country} in ascending order.

Page 13: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 12

5. InsertSummary

6. InsertSummary

7. Final Report

4.9 Group by date Group by each day, week, month, quarter, year, etc. Student Project M Summarize by Date

Create a summary by date report from the Employee table: 1. FileNewBlank ReportXtreme012.mdb. 2. Add Employee table. 3. Add fields {Employee ID}, {First Name}, {Last Name}, {Hire Date}, and {Salary}. 4. Create a group by {Hire Date}. Section will be printed: for each Quarter 5. Open the Group Expert and change the Section will be printed: for each Year.

Page 14: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 13

Student Project M Continued Hint: Open the Group Expert and choose Options.

The report will look similar to the following:

Optional Topics

4.10 Drill Down Double click on the group in the Preview view. 4.11 All Levels Add to all group levels. Version 11R2+. Not

available V11.0 4.12 Reorder Groups

Up/Down arrow in Section Expert, design viewdrag n drop.

4.13 Group Sort Expert

Use the Group Sort Expert to list the top groups based on “Top N”, “Bottom N”, “Top Percentage”, “Bottom Percentage.” Sorts by group name.

Icon used for CR9,CR10, and CR11R2.

Student Project N Top N Group

1. FileNewBlank ReportXtreme012.mdb. 2. Add tables: Customer and Orders table. 3. Add fields: {Customer name}, {Order ID}, {Order Date}, and {Order Amount}. 4. Group by: {Customer Name}. 5. Create Summary: Sum of {Order Amount} and place it in group. Footer 1. Note: Without a group or summary field, the Group Sort Expert tool will not be available. 6. Suppress Details: R-Click on DetailsSuppress. 7. Select the Group Sort Expert Icon . 8. Show only the Top 5 orders.

Page 15: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 14

4.14 Sort by Summary

You can sort the Summary fields by using the Group Sort Expert and specifying in the Top N the number of summaries in the report or a large number greater than the number in the report.

Practice Exercise 24 Sort by Summary

1. FileNewBlank ReportXtreme012.mdb. 2. Add table: Customer. 3. Add fields: {Customer ID}, {Customer name}, and {Last Year’s Sales}. 4. Group by: {Country}. 5. Create Summary: Sum of {Last Year’s Sales} and place it in Group Footer 1. 6. Suppress Details: R-Click on DetailsSuppress. 7. Select the Group Sort Expert Icon . 8. Show the Top 999 records.

4.15 Sort Records vs. Group Sorting

Individual detail section records are sorted using the sort Icon and groups are sorted in the option of the group .

4.16 Sort Control Record sort, InsertSort ControlApply sort field.

Chapter 5 - Database Expert Accessing databases is vital to generating correct reports and we will explore the different features available.

Optional Topics

5.1 Database Expert Icon

Add 2 tables from a database and choose the links tab.

Icon used for CR9, CR10, and CR11R2.

5.2 DB Expert Options

You must choose 2 tables to see the link tab.

5.3 Auto-arrange button

Rearranges the table order.

5.4 Link button Links up tables. 5.5 Clear Links Clears all links. 5.6 Delete Link Deletes selected link. 5.7 Index Legend 1st ,2nd, etc. Index.

5.8 My Connections Displays the server or data file to which you are currently connected. If you just opened Crystal Reports, this option will display “no items found”.

5.9 Database Links This will turn on/off the ability to autolink. FileOptionsAutomatic Smart Linking.

Practice Exercise 25 Database Linking

This is an example of a database that does not automatically link up. The linked fields names do not match. 1. FileNewBlank ReportAdd an Access database interface

Page 16: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 15

Detailed Link Relationships

C:\Data\CR2008-1\Employees.mdb. 3. Add tables {tblEmployee_List} and {tblSupervisors}. 4. Verify links. Browse to view data types and verify records. 5. Add the link manually if necessary.

5.10 Link Options Select the line/link between two tablesDouble click on the link between or choose the Link Options buttonChange the relationship to Inner, Left-outer, Right-outer, and Full-outer.

5.11 Enforced Joins

The default relationship is the Equal which identifies the common data that is related to two tables. Other relationships are available to define unique relationships.

5.12 Inner Includes records from both tables only if the joining fields are equal. This is the

default join in a SQL/ODBC connection. 5.13 Left-outer Includes all records from the left table and records from the right table only if the

joining fields are equal. Displays record set that contains all field values from the left table regardless of having matching information on the right table.

5.14 Right-outer Includes all records from the right table and records from the left table only if the joining fields are equal. Displays record set that contains all field values from the right table regardless of having matching information on the left table.

5.15 Full-outer Displays record set that contains all field values from the left table and all field values from the right table.

5.16 Not Enforced By selecting this option, the link being created will not necessarily be sent to the SQL statement. Only if fields have been selected from a table, or the table is used to join to another table with utilized fields, will this option send the linking criteria to the SQL statement.

5.17 Enforced From

This option enforces the link to the right table. If a field is used from the right table and not from the left, the SQL statement will still require that both tables be referenced for record retrieval. However, if the fields from the left table are the only ones utilized in the report, the SQL statement will only reference the left table for record retrieval.

5.18 Enforced To This option enforces the link to the left table. If a field is used from the left table and not from the right, the SQL statement will reference both tables for record retrieval.

5.19 Enforced Both

This option enforces the link regardless of the source location of the fields used in the report.

5.20 Equal link [ = ]

An equal link retrieves a record set where the linked field value has exact matches in both the left and right tables.

5.21 Greater Than link [ > ]

A greater-than link retrieves a record set where the linked field from the left table is greater than the linked value in the right table

5.22 Greater Than or Equal to link [ >= ]

A greater-than or equal link retrieves a record set where the linked field from the left table is greater or equal to the linked field value in the right table.

5.23 Less Than link [ < ]

A less-than link retrieves a record set where the linked field from the left table is less than the linked value in the right table.

5.24 Less Than or Equal to link [ >= ]

A less-than or equal link retrieves a record set where the linked field from the left table is less or equal to the linked field value in the right table.

5.25 Not Equal A not equal link retrieves a record set where the linked field value from the left

Page 17: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 16

Database Interface Connections

link [ != ] table does not equal the linked field value in the right table. The SQL syntax for the not equal is dependent on the ODBC data source driver. It is referenced as either != or <> depending on the database.

5.26 Access/Excel (DAO)

Allows a direct connection to MS Access and other files using Microsoft’s Data Access Objects to avoid using an ODBC connection. Note: Excel 2003 problem encountered -If the invoice number is both text and numbers, it will convert one and leave the other blank. If you use OLE DB (ADO) it reads both values in properly.

5.27 Database Files Use this option to connect directly to PC data files that can be accessed through a physical file location from the C: drive or other mapped network drive. This option connects to Access, Paradox, Btrieve, Dbase and Foxpro.

5.28 ODBC (RDO) The ODBC/RDO (Open Database Connectivity/Remote data Objects) folder is typically used for server based databases like Oracle, Sybase, Informix and MS-SQL server. ODBC usually connects to a local database source.

Practice Exercise 26 ODBC Database Interface

Set up the ODBC interface on Windows. 1. StartSettingsControl PanelAdmin ToolsData Sources (ODBC) 2. System DSN tabAddMicrosoft Access (*.mdb)Finish. 3. Data Source name: Xtreme Database

Description: SelectC:\Data\CR2008-1\Xtreme012.mdbOK.

To use the newly created ODBC interface 1. Open Crystal Report 2008. 2. FileNewBlank Report. 3. Database Expert:

Create New ConnectionODBC (RDO) Data Source name: Xtreme Database Next: User ID: Password: Select tables: Customer and OrdersOk. Note: Add table to list on the right.

4. Add fields: Open the Field Explorer and add the desired fields. 5.29 OLAP Choose this option when creating reports using On-Line Analytical

Processing data sources. 5.30 OLE DB (ADO) This is a Microsoft data connection similar to ODBC in its concept and

requires the use of an OLE DB provider, which is similar to an ODBC driver. OLE DB usually accesses data across the network directly to a native database.

5.31 OLE DB (ADO) Excel XML Format

This driver has been redesigned in CR2008 to accept Excel XML file format. Choose OLE DB (ADO) NextChoose Microsoft Office 12 Access InterfaceDatasource: XXX Office Database Type: ExcelFinish.

5.32 Outlook This is a connection driver that allows reports to utilize Outlook PST files.

5.33 Salesforce.com Internet Driver to access salesforce.com database across the internet. 5.34 XML and Web Allows Crystal Reports to extract data stored in XML format.

Page 18: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 17

Chapter 6 - Formulas Formulas can be used to fix problems in the databases or adjust records retrieved. You do not need programming experience to learn the basic building blocks of developing formulas.

6.1 Formula Syntax

There are two programming languages supported: Crystal Standard and Visual Basic Language.

6.2 Special Characters

These are special characters recognized by the formula editor: / / ( ) { } [ ] “ ”

6.3 Data Types The following are the data types supported: Boolean, String, Date, Time, Datetime, Number, and Currency.

6.4 Operators: The following are the most common operators supported: + - / * > < >= <= =

6.5 Formula Workshop The Icon is used for all versions of Crystal Reports.

6.5a Show/Hide Workshop Tree

Icon used for CR11R2+.

6.5b Field tree Alt + F. Icon used for CR11R2+.

6.5c Function tree

Alt + U. Icon used for CR11R2+.

6.5d Operator tree

Alt + P. Icon used for CR11R2+.

6.6 Check Formula Syntax Checker. Icon used for CR11R2+.

6.7 Find The find and replace (Ctrl F) will find the needed formula based on a

keyword: Click Function TreeFind What: SumFind

Services 5.35 Repository Business Objects Server 5.36 More Data Sources

Btrieve, IBM DB2, IDAPI Database DLL, Informix, Lotus Domino, Oracle, or Sybase.

Formulas and fields Functions Operators Completed Formulas

Formula Editor Area

Page 19: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 18

Formula buttonFind NextFind Next. 6.8 Help

Press F1 or Type in the word “Sum”Select itPress F1 or the Icon.

6.9 Formula Editor This is where you type the formula. 6.10 Auto-complete This will provide a list of functions that start with that letter. Type First letter

of the function nameCntl Space bar. Practice Exercise 27 Open the formula editorType the letter ACtrl Space Bar Type the

letter VE or AVEThe list should change. 6.11 Number Calculations

Numbers can be formatted by: R-Clicking on the number FormatNumber tab.

Practice Exercise 28 Setup Report

FileNewBlank ReportXtreme012.mdbAdd fields {Customer ID}, {Customer Name} and {Last Year’s Sales} Group by {Country}.

6.11a Line formula

Total up 2 fields in the details section. Example: {Units} * {Price}=LineTotal

Practice Exercise 29 Line Formula

Create the formula: Adjusted Sales={Last Year’s Sales} * 1.10

6.11b Sum Function

Sums up fields in a group similar to the Summary . Sum(Field, GroupName)

Practice Exercise 30 Function

Create formula CountrySum= Sum({Last Year’s Sales}, {Country}) Create formula CountryAve= Average({Last Year’s Sales}, {Country})

6.11c ToNumber

Converts text to a number.

Student Project O Number Formulas

Determine the discount of the product. The retail value is “Product.Price (SRP)” and the sold price is “Orders.Price.” 1. FileNewBlank ReportXtreme012.mdb Add Orders_Detail and Product table. 2. Add fields {Orders_Detail.Order ID}, {Product.Price(SRP), {Order_Detail.Unit Price} and {Order_Detail.Quantity}. 3. Group by {Product.Product Name}. 4. Create Formula: Line Total.

{Orders_Detail.Unit Price} * {Orders_Detail.Quantity} 5. Create Formula: Discount.

(({Product.Price (SRP)} - {Orders_Detail.Unit Price}) / {Product.Price (SRP)})*100

6. Insert Summary Insert Summary IconField Name: {@Line Total}Calculate: Sum

Summary Information: Group #1 Place in the Group Footer 1 section) 7. Create Formula: Sales Tax

Sum ({@Line Total},{Product.Product Name} ) * .065 8. Create Formula: Total Sum ({@Line Total},{Product.Product Name} ) + {@Sales Tax} 9. Create Formula: Grand Total You can’t create a grand total from the Total or Sales Tax formulas, because they are not placed in the details

Page 20: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 19

section. Sum({@Line Total}) + Sum({@Line Total})*.065 Place in the Report Footer Section 10. The placed fields should look similar to the following:

6.12 Date Calculations

Dates can be formatted by: R-Clicking on the DateFormatDate tab.

Practice Exercise 31 Date Difference

FileNewBlank ReportOrders tableAdd {Order ID} fieldCreate Formula: Delivery={Ship Date} – {Order Date}

Practice Exercise 32 Date Projection

Continue from Previous Practice Exercise: Create Formula: Follow-up={Order Date} + 35

6.12a CurrentDate

Extracts the current date from the computer clock. Example: CurrentDate or CurrentDate()

Practice Exercise 33 Currentdate

Create Formula: Order Age={CurrentDate} – {Order Date}

6.12b ToText Converts Dates to a text value and provides some formatting. Example: ToText(Field, #DecPlaces)

Practice Exercise 34 ToText

Create Formula: MonthYear= ToText({Order Date}, “MM-yyyy”)

6.12c Year, Month, Day

Extracts the Year, Month and Day from a date. Example: Year(Date), Month(Date), Day(Date)

Practice Exercise 35 Year

Create Formula: Year Ordered=year({Order Date})

Student Project P Date Formulas

1. FileNewBlank ReportXtreme012.mdbAdd Employee table. 2. Add field {Last Name} to the details section. 3. Create Formula: 20yr Anniversary {Employee.Hire Date} +365.25*20 Note: 365 are the number of days in a year and .25 takes leap year in to account. 4. Create Formula: Days Employed CurrentDate - {Employee.Hire Date} 5. Create Formula: Career Employee {@Days Employed} > 6500 Note: you will need to create the formula in step 3 prior to starting step 4. Also, when finished, change the format to the True/False to Yes/No. 6. Create Formula: Employment History {Employee.First Name} + " joined Xtreme on " + ToText ({Employee.Hire Date},"MMMM dd, yyyy") + ". This was on a " + ToText ({Employee.Hire Date}, "dddd") + "." 7. Place the following fields and formulas similar to the following:

Page 21: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 20

6.13 Boolean Formulas

Boolean fields can be formatted by: R-Clicking on the fieldFormatBoolean tab. You can format the results to True/False, 1/0, or Yes/No.

Practice Exercise 36 Boolean Formulas

FileNewBlank ReportCustomer tableAdd fields {Customer ID} and {Last Year’s Sales} Create Formula: High Sales={Last Year’s Sales} > 100000 Create Formula: USA Sales={Country} = “USA”

6.14 String Concatenation

This will patch the text strings into a single string using operators: + - all values must be a string. Create Formula: Full Address={Address1}+”, “+{Address2} & - uses string and numeric values. Create Formula: Customer={Customer ID}&”-“&{Customer Name}

Practice Exercise 37 String Concatenation

FileNewBlank ReportCustomer tableAdd {Customer ID} fieldCreate Formula: Full Name={Last Name} + “, “ + {First name} Address3={City}+”, “+{Region}+”, “+{Postal Code}

6.15 If Then Else Formulas

This will make decisions based on some criteria.

Practice Exercise 38 If Then Else

Create Formula: High Sales if {Last Year’s Sales} > 100000 then “High Sales” else “Low Sales”

6.16 String Formulas

Manipulates Text Values.

Practice Exercise 39 String Formulas

Create Formula: USA Name if {Country} = “USA” then “United States of America” else {Country}

6.16a ToText Converts numeric numbers to a string value and allows you to format the number of decimal places. Example: ToText(Field, #DecPlaces)

Practice Exercise 40 ToText

Create Formula: NewID={Customer ID}+”-“{Name} Create Formula: FixedNewID=ToText({Customer ID},0)+”-“{Customer Name}

6.16b Left Extracts a specified number of characters from the left. Example: Left(Field, NumberFromLeft)

Practice Exercise 41 Left

Create Formula: Short Name=Left({First name}, 1)+”. “+ {Last Name}

6.16c Right Extracts a specified number of characters from the right. Example: Right(Field, NumberFromRight)

6.16d Mid Extracts a specified number of characters from the middle of a text string. Example: Mid(Field, StartingPoint, NumberCharacters)

6.16e Length Counts the number of characters. Example: Length(Field) Practice Exercise 42 Create Formula:

Page 22: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 21

Length Name Size=Length({Customer Name}) 6.16f Picture This has nothing to do with graphics but reformats how text strings look

such as Social Security Number 555-666-7676 , Phone Number (555) 654-7656) or Part number wcs-4534-7765. Example: Picture(Field, “xxx-xxxx”)

Practice Exercise 43 Picture

Create formula: FixPostalCode If length({Postal Code})=5 Then Picture({Postal Code}, "xxxxx-0001") Else {Postal Code}

6.16g IsNull IsNull(Field) Practice Exercise 44 IsNull

Create Formula: New PO If isnull({Postal Code}) Then “No Postal Code” Else {Postal Code}

6.16h Not IsNull Not IsNull(Field) Student Project Q String Formulas

1. FileNewBlank ReportXtreme012.mdb Add Employee and Employee_Address table. 2. Create Formula: Contact Address

if isnull ({Employee_Addresses.Emergency Contact Address2}) then {Employee_Addresses.Emergency Contact Address1} else {Employee_Addresses.Emergency Contact Address1} + ", " + {Employee_Addresses.Emergency Contact Address2} 3. Create Formula: Contact Phone

If Length ({Employee.Emergency Contact Phone}) = 10 Then Picture ({Employee.Emergency Contact Phone}, "(xxx) xxx-xxxx") Else “Bad Phone Number”

4. Create Formula: Emergency Contact Left ({Employee.Emergency Contact First Name},1 ) + ". " + {Employee.Emergency Contact Last Name}

5. Create Formula: Employee ToText ({Employee.Employee ID}, 0) + " - " + {Employee.First Name} [1] + ". " + {Employee.Last Name} 6. Create Formula: Home Address {Employee_Addresses.Address1}+ if not IsNull ({Employee_Addresses.Address2}) then “, “ + {Employee_Addresses.Address2} 7. Place the following fields and formulas similar to the following:

Optional Topics

6.17 DateAdd DateAdd(intervalType, Number, StartDate) 6.18 ChrW ChrW(UnicodeValue) Search the web for ASCII Characters. 6.19 Datediff DateDiff(intervalType, startDateTime, endDateTime) 6.20 SubScripts An alternate way to extract letters from a text string.

Page 23: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 22

Example: {Field}[1], {Field}[1 to 3], {Field}[-1] Practice Exercise 45 FileNewXtreme012.mdbEmployee tableAdd fields {Employee

ID}, {First Name}, and {Last Name})Create Formula: New Name{First Name}[1] + “. “ + {Last Name}

6.21 Search Formulas

Allows you to search for the available functions.

6.22 Switch Formulas

Click the different formulas on the far left screen.

Chapter 7 - Conditional Formatting Records can be highlighted or emphasized to enhance the results of the report.

7.1 Highlight Expert

FormatHighlight Expert. Icon used for CR11R2+.

Practice Exercise 46 FileNewBlank ReportXtreme012.mdbEmployee tableAdd {Employee ID} and {Salary} fields)Use the Highlight expert to create: High Salary>80000, Medium Salary>40000 and Low Salary <= 40000) Note: If you do Medium salary first, it will not find the High Salary value.

Student Project R Highlight Expert

1. FileNewBlank ReportXtreme012.mdb. 2. Add tables Orders, Order_Details, and Product. 3. Add fields {Product.Price (SRC)}, {Order_Detail.Quantity} and

Order_Details.Quantity}. 4. Create a formula field: Line Total= {Order_Detail.Quantity} *

Order_Details.Quantity} 5. Suppose you want to color code the orders based on the Line Total of

the product sold. Add the following Highlight Expert parameters: a. You want orders with a line total greater than 0 to have a

yellow background. b. You want orders with a line total of $30 or more to have a

green background. c. And finally, you want orders with a line total of $40 or more

to have a blue background. 7.2 Conditional Formatting

Whenever you see the Icon it can be used to perform conditional formatting. Select fieldFormatFormat field or R-Click on fieldFormat text.

Student Project S Conditional Formatting

1. FileNewBlank Report Xtreme012.mdbCustomer table. 2. Add {Customer ID}, {Customer Name}, {City} and {Last Year’s Sales} fields to the details section. 3. Insert Group Group by Country in ascending order. 4. Now you are ready to do the conditional formatting. Right click the {Last Year’s Sales} field in the Details section, and then choose Format field. Click on the Font tab and then select the X-2 button after the Color drop-down list. 5. If the field is greater than the average sales for the region, you want to print it in blue. Enter the following formula:

If {Customer.Last Year's Sales} > Average ({Customer.Last Year's Sales}, {Customer.Country} ) then crBlue

Page 24: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 23

7.3 Section Expert

ReportSection ExpertRecord. Allows you to add a watermark, color the background, and suppress a section conditionally.

Icon used for CR9, CR10, and CR11R2.

Practice Exercise 47 Suppress

FileNewBlank ReportXtreme012.mdbAdd Customer tableAdd fields {Customer ID}, {Customer Name}, {Last Year’s Sales}, {City} and {Region}Group by {Country}ReportSection ExpertSelect the Details SectionSuppress X-2Enter Boolean formula: {Last Year’s Sales} < 100

Practice Exercise 48 Page Before

ReportSection ExpertSelect the Group Header #1 sectionPage Before X-2Enter boolean formula: {Country}= “England”

Practice Exercise 49 Color

ReportSection ExpertSelect the Details sectionColor X-2Enter the formula: if {Country}= “USA” then CrTeal Else CrNoColor

Optional Topics

Practice Exercise 50 Alternating Lines

ReportSection ExpertSelect the Details sectionColor X-2Enter the formula: Choose(Remainder(RecordNumber, 2) +1, CrSilver, CrNoColor)

Chapter 8 - Charts Charts can pull information out of a report you wouldn’t be able to see any other way. Often times, report writers, unaware of Crystal Report’s charting capabilities, will export the data to Excel in order to generate a report.

8.1 Insert Chart

InsertChartPlace in the Report Header. Icon used for CR9, CR10, and CR11R2

8.1a On Change of

The different chart categories.

8.1b Chart Value

The values charted.

Page 25: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 24

8.2 Chart Expert Some of these options are repeated in other formatting options. 8.2a Chart Type tab

Common chart types: Bar, Pie and Line Charts. Some of the charts have a depth (3D) and you can change the chart to be either horizontal or vertical.

8.2b Chart Data tab

The two most common layout types are Advanced (default type) and Group (allows you to tie the chart bars to the groups to allow drilldown).

8.2c Axis Allows you to change the X and Y numeric axis by changing the range the values represent (Data axis Min/Max).

8.2d Options Allows you to change the data points by adding the data value or label on the chart. It also allows you to add or remove the legend.

8.2e Color Highlight

Allows you to change the color of the bars on the chart.

8.2f Text Allows you to add titles to the chart. 8.3 Format Chart Formats the border and background of the outside edge of the chart. 8.4 Format Background

Formats the inside edge border color and the overall background color of the chart.

8.5 Chart Options Modify Chart characteristics. 8.5a Appearance Changes the Overlap, Gap Width, Riser Shape (Shape of the bar) and depth. 8.5b Titles Adds titles to various parts of the chart. 8.5c Data Labels Adds Data labels. 8.5d Legend Adds and adjusts the legend. 8.5e Gridlines Adds gridlines to the chart. 8.5f Axis Changes the X and Y numeric values of the chart. 8.6 Format Chart Objects

This will allow you to R-click on the chart objects in the chart to make various changes. Some of the changes that can be made are: Format Axis, Format Chart Frame, Format Grid Lines, Format Series Riser, Format Axis Label and Format Title.

Student Project T Chart

Create a using the Customer table and Last Year’s Sales. 1. FileNewBlank ReportXtreme012.mdbAdd Customer tableAdd fields {CustomerID}, {Name}, {First}, {Last}, and {Last Year’s Sales} 2. InsertChartPlace it in the report header. 3. Add the following: On Change Of: {Contact Title}

Show Values: Sum of Last Year’s Sales. 4. Change Data fields: R-ClickChart ExpertData tab. 5. Change Chart Type: R-ClickChart ExpertType tab. 6. To Format the Border around chart: R-ClickFormat Chart. 7. To Format the background of chart: R-ClickFormat Background. 8. To change titles and add labels: R-ClickOptionsTitles/DataLabels. 9. To change the appearance of bars: R-ClickOptionsAppearance tab. 10. To auto-arrange the chart position: R-ClickAuto-Arrange Chart.

Optional Topics

8.7 Auto-arrange Chart

Resets the chart to its original size and position.

8.8 Save/Load Template

Saves and loads a chart that has been previously defined.

8.9 Group Layout Chart ExpertDataLayout Group. Allows one to Drilldown on a chart and links the group structure to the Chart.

Page 26: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 25

Student Project U Group Drilldown Chart1

1. Continue from previous example. 2. Allows the chart to drill down. 3. Create a group by Title. 4. Create a summary in group footer 1 of Sum/{Last Year’s Sales}. 5. Chart ExpertData tabGroup button.

Practice Exercise 51 Group Drilldown Chart2

1. FileNewBlank ReportXtreme012.mdbAdd Employee tableAdd fields {Employee ID}, {First Name}, {Last Name}, and {Salary}. 2. InsertChart(Place it in the report header). 3. Add the following: On Change Of: {Reports To}

Show Values: Sum of {Salary}. 4. Format the chart as desired. 5. Create a group by {Reports To}. 6. Create a summary in group footer 1 of Sum/{Salary}. 7. Chart ExpertData tabGroup button. 8. Double click on the chart to see the drill down.

8.10 Chart Templates

Right-Click on ChartSave as Template / Load Template.

8.11 Group Header Charts

This will allow you to place the chart in a group header.

Practice Exercise 52 FileNewBlank ReportXtreme012.mdbAdd Employee tableGroup by: {Reports To}Add fields: {Employee ID} and {Last name}InsertChart On Change Of: {Position}

Show Values: Sum of {Salary}. Place chart in the Group Header: ReportSection ExpertSelect the Group Header #1Select Underlay Following Sections.

8.12 Maps The map feature will allow you to plot Country or Region on a worldwide map. This is an additional feature that may not be available in your installed version.

Student Project V Maps

1. FileNewBlank ReportXtreme012.mdbAdd table Customer. 2. Add fields {Customer ID}, {Customer Name}, {Last Year’s Sales}. 3. Add a group by {Country}. 4. Add a summary to the {Last Year’s Sales} by summing up Country

Group and placing the summary in the Group Footer 1. 5. Insert a Map Insert Map.

Data Tab Place Map: Once per reportX Header Geographic field: Country Map Values: Sum of Last Year’s Sales.

Type Tab Ranged

Text Tab Map Title: Last Year’s Sales Mapped by Country X Full Legend

6. Use the “Save As” command to save the report. Name it Map Report.rpt. Close the report.

Page 27: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 26

Chapter 9 - Export The most common export capability is Excel and PDF. There are also many other legacy features available if needed.

9.1 Export Feature FileExportExport Report. 9.2 Adobe (PDF) Commonly used to email the final report. 9.3 MS Excel 97-2000

Page based export, 256 column limit, Doesn’t export line or box objects, May create multiple worksheets. Will merge cells if data covers more than one cell

9.4 MS Excel 97- 2000 (Data Only)

Doesn’t merge cells. Focuses on conversion of data and Exports most of the formatting.

9.5 Destination Application and Disk File

Other Export Formats

9.6 Default Options Set Defaults when you export a report. FileExportReport Export Options.

9.7 HTML 4.0 Latest Standard

9.8 MS Word(RTF)

Produces standard RTF and has the following options: Page based export, Retains text objects such as forms and text frames, Retains drawing objects, and if text is outside the printable area, it will push in.

9.19 MS Word Editable RTF

All text is converted to be fully editable: Converts all text objects to text lines, doesn’t use text frames, text formatting is retained, background and fill colors may not be retained, graphic images may shift text to fit, and doesn’t export line objects or box objects. 7. Page breaks may not match word page breaks.

9.10 ODBC Formats

Export to ODBC data source.

9.11 Rich Text Format (RTF)

Very clean and used to export to non-word applications.

9.12 Separated Values (CSV)

Comma Separated Value: 1. ASCII Format separated fields with commas. 2. Neutral interchange format to export to other applications.

9.13 Tab-Separated Text (TTX)

ASCII Format. Instead of commas, it uses tabs.

9.14 Text (TXT) Plain Text Format. Loses formatting and requires lines per page and characters per inch.

9.15 XML Extensible Markup Language. Creates raw XML data.

Page 28: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Appendix A - Report Prototype Form

Purpose The purpose statement helps you focus on your primary needs. It gives the report both a starting point and a goal.

Audience

Who is your intended audience?

Report title You might change the title later, but use the proper title in your prototype report.

Database information Define the data used in the report.

Header

Company logo, a print date, and the title of the report.

Footer Page number.

Body of report

The body should contain all the data needed to fulfill your initial statement of purpose.

Groups

Determine if the data is organized into groups. How? By customer? By date? By hierarchy? Or, by other criteria?

Sorting Data can be sorted based on a specific record or in a group.

Record selection Determine if you need all data or a subset by year, region, country, etc.

Calculations or formulas

Determine if the report needs any fields calculated.

Summarized data

Do you want to total, average, count, or determine the maximum or minimum value included in all the values in any column in the report? Do you want to include a grand total at the bottom of a selected column?

Page 29: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Crystal Reports 2008 Fundamentals

Page 28

Crystal Reports 2008 - Fundamentals Index

Access/Excel (DAO) ........................................16 Add a Line .........................................................6 Add a Picture .....................................................6 Add Box .............................................................6 Additional Summary Options ........................11 Adobe (PDF) ....................................................26 Aligning Objects ................................................4 Auto-arrange button .......................................14 Auto-complete .................................................18 Boolean Based Criteria ....................................8 Boolean Formulas ...........................................20 Browse data .......................................................4 Case insensitive..................................................9 Chart Expert....................................................24 Chart Options ..................................................24 Chart Templates..............................................25 Charts ...............................................................23 Check Formula ................................................17 Clear Links ......................................................14 Conditional Formatting ..................................22 Create New Report ...........................................3 Crystal vs Visual Basic ...................................17 Data Types .......................................................17 Database Expert ..............................................14 Database Linking ............................................14 Database Links ................................................14 Database Location .............................................3 Date Calculations ............................................19 DB Expert .................................................... 3, 14 DB Expert Options ..........................................14 Default Options ...............................................26 Delete Link .......................................................14 Design/Preview ..................................................3 Drill Down........................................................13 Excel XML .......................................................16 Export Feature ................................................26 Field Explorer....................................................3 Fields same size .................................................4 Find ....................................................................5 Format ................................................................5 Format Background ........................................24 Format Chart ..................................................24 Format Chart Objects ....................................24 Format Data Types ...........................................6 Format Dialog box ............................................5 Format Painter ..................................................7 Format Properties .............................................5

Formula Editor ............................................... 17 Formulas .......................................................... 17 Full-outer ......................................................... 15 Grid .................................................................... 5 Group ........................................................... 9, 10 Group by date.................................................. 12 Group Charts .................................................. 25 Group Expert .................................................. 10 Group Layout .................................................. 24 Group Options ................................................ 10 Group Sort Expert .......................................... 13 Group Sorting ................................................. 10 Group Tree .................................................. 5, 10 Help .............................................................. 5, 18 Highlight Expert ............................................. 22 If Then Else Formulas .................................... 20 Index Legend ................................................... 14 Inner ................................................................. 15 Insert Chart ..................................................... 23 Insert Group .................................................... 10 Insert Summary .............................................. 10 Insert Text Object ............................................. 3 Left Pane Layout ............................................... 4 Left-outer ......................................................... 15 Link button ...................................................... 14 Link Options .................................................... 15 Menu bar ........................................................... 3 MS Excel 97-2000 (Data Only)....................... 26 MS Word Editable RTF ................................. 26 Multiple Criteria ............................................... 8 Multiple Groups .............................................. 10 Number Calculations ...................................... 18 ODBC (RDO) .................................................. 16 ODBC Formats ............................................... 26 OLAP ............................................................... 16 OLE DB (ADO) ............................................... 16 OLE Object ....................................................... 7 Operators ......................................................... 17 Page Header....................................................... 7 Page Setup ......................................................... 7 Placement of fields ............................................ 3 Record ................................................................ 8 Record Sort ........................................................ 3 Reorder Groups .............................................. 13 Report Explorer ................................................ 3 Report Prototype............................................. 27 Resizing Objects ................................................ 4

Page 30: Crystal Reports 2008 Fundamentals - excel-networks.com · For Evaluations Only Do Not Distribute Crystal Reports 2008 - Fundamental Concepts This book is used to enhance basic report

For Eva

luatio

ns O

nly

Do N

ot Dist

ribute

Excel Networks

Page 29

Right-outer ...................................................... 15 Salesforce.com ................................................. 16 Save/Load Template ....................................... 24 Saved Data ......................................................... 9 Saving Report/Autosave ................................... 5 Search Formulas ............................................. 22 Section Expert ................................................. 23 Select Expert ..................................................... 8 Show Formula ............................................... 8, 9 Show SQL .......................................................... 9 Size and position ............................................... 4 Snap to grid ....................................................... 5 Sort Control .................................................... 14 Sort Records .................................................... 14

Special Characters .......................................... 17 Special Fields ..................................................... 6 Standard Report Wizard ................................. 5 Status Bar .......................................................... 4 String Based Criteria ....................................... 8 String Concatenation...................................... 20 String Formulas .............................................. 20 SubScripts ....................................................... 21 Switch Formulas ............................................. 22 Template Expert ............................................... 7 Text Boxes ......................................................... 4 Time Based Criteria ......................................... 8 Window Sections ............................................... 3