The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by SkillForge, 2018-11-20 21:25:59

Crystal Reports Introduction

Crystal Reports Introduction

Lesson 8: Conditional Formatting 251

7. Save and preview the report.

Figure 8- 15 Exercise 8-6 Results
Copyright ©2017 Pathfinder Learning, LLP

252 Lesson 9: Summary Reports and Charting

Lesson 9: Summary Reports and Charting

Unit time: 75 minutes
In this lesson, you will be introduced to:
1 Creating a Summary Report
2 Using Drill-Down to View Report Details
3 Creating Charts with the Chart Expert
4 Formatting and Editing Charts
5 Formatting Individual Chart Objects

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 253

Creating a Summary Report

One of the primary objectives when developing a report, is to ensure that the information is both easy to read and
easy to understand. If page after page of transactional data is presented, it is difficult to find what you are looking
for. In many cases, the user simply needs a bottom line type answer to a question, like the total of sales for a month
or the average profit for a week. This scenario requires a report designer to group and summarize the data, hide the
detailed transactions while showing the totals.

Summary reports provide the reader with a high-level view of the data. If data were grouped by month, the summary
report would show twelve rows of information and possibly a total line. All of the detailed transactions for the
months would be omitted from the report. If the reader needs details about a specific month, a feature known as drill
down may be employed to produce a secondary report containing the selected month’s transactions.

Figure 9-1 Summary Report Example

Crystal Reports provides two methods for hiding transactional data. Depending on whether the user will be limited
to the summary calculations or have access to the underlying records, this will dictate the preferred hiding method.

Hide: (Drill-Down OK)
The Hide property hides a section whenever you run the report. For example, in a summary report, the Hide
property can be used to display only the summaries, but not the details behind the summaries. When the
Hide property is applied to a section, it becomes visible when the drill-down cursor is used to drill down on
the section contents. This property is absolute; it cannot be conditionally applied using a formula.
To apply the Hide functionality, right-click the report section and select Hide (Drill-Down OK).

Copyright ©2017 Pathfinder Learning, LLP

254 Lesson 9: Summary Reports and Charting
Suppress (No Drill-Down)
The Suppress property also hides a section when you run the report. Unlike the Hide property, however, you
cannot apply the Suppress property and then drill down to reveal the section contents. This property can be
applied absolutely, or conditionally using a formula. This is useful for writing form letters. For example, in a
form letter, you might create two Details sections: one to suppress when sales are over $X and one to
suppress when sales are under $X.
To apply the Suppress functionality, right-click the report section and select Suppress (No Drill-Down).

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 255

Exercise 9-1 Produce a Summary Report

A report requirement is to show all of the freight charges for the year 2006 grouped by month with the
freight totaled for each month and a grand total of freight for the year.

1. Open the My 2006 Shipped Orders file (from Lesson 04).

2. Switch to the Design tab if necessary.

3. Click the Insert Summary button.

a. Select Orders.Freight as the field to summarize.
b. Verify the Calculate this summary: field is set to Sum.
c. Verify the Summary location is Grand Total (Report Footer).
d. Check the Add to all group levels box.
e. Click OK.

Figure 9-2 Insert Summary Settings

4. Move the Group #1: ShippedDate title field from the Group Header #1 section and place it next to the
Orders.Freight calculation field in the Group Footer #1 section.

Copyright ©2017 Pathfinder Learning, LLP

256 Lesson 9: Summary Reports and Charting

5. In the Group Footer #1 section, right-click on the Group #1: ShippedDate field and select Format
Field…

a. Customize the field to display the full name of the month only. To do this, on the Date and Time

tab, click the button.

b. Select the Date tab

c. In the Year dropdown (located on the middle-left side of the Custom Style dialog box), choose

None.

Figure 9-3 Custom Date Style Settings

d. Click OK to return to the Format Editor.
e. Click OK to return to the Design tab.
6. Right-align the Group #1: ShippedDate title in the Group Footer #1 section.
7. In the Report Footer section, next to the Orders.Freight calculation field, insert a Text Box.
a. Add the text Total Freight - 2006.
b. Format the textbox to be bold and right-aligned.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 257

8. Return to the Design tab.
9. Verify your report is similar to the image below.

Figure 9-4 Example of Design Tab

10. Preview the report to observe the totals at the end of each month and a grand total for the entire year.
11. Verify your report is similar to the image below.

Figure 9-5 Totals Preview

12. Return to the Design tab.
13. Right-click on the Details section and select Hide (Drill-Down OK).
14. Right-click on the Group Header #1: Orders.ShippedDate – A section and select Hide (Drill-Down

OK).
15. Verify the Design tab is similar to the image below. (observe the crosshatch pattern in the hidden

sections):

Figure 9-6 Design Tab Example

Copyright ©2017 Pathfinder Learning, LLP

258 Lesson 9: Summary Reports and Charting
16. Switch to the Preview tab.
17. Verify your report is similar to the image below.

Figure 9-7 Exercise 9-1 Results

18. Save the file as My 2006 Freight Summary Report.
19. Leave the file open for the next exercise.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 259

Exercise 9-2 Produce a Summary Report
In this exercise, the previous report will be further customized to show a full 12 months of data for 2007.

1. Continuing with the My 2006 Freight Summary Report from the previous exercise, change the filter
criteria to show all months for the year 2007.

a. Click on the Select Expert button.

b. Change the years from 2006 to 2007.

Figure 9-8 Exercise 9-1 Year Update

c. Click OK.
d. Click Refresh Data.
2. Switch to the Design tab.
3. In the Details section, remove the ShipAddress and ShipCity fields.
4. Move the Freight field and all subtotal fields to the middle of the report.
5. In the Report Header section, update the report title to show Orders Shipped – 2007.
6. Move the text box to the center of the Report Header section.
7. In the Report Footer section, update the text to show Total Freight – 2007.
8. Verify the Design tab is similar to the image below.

Figure 9-9 Updated Design Tab

9. Preview the report.

Copyright ©2017 Pathfinder Learning, LLP

260 Lesson 9: Summary Reports and Charting
10. Verify your report is similar to the image below.

Figure 9-10 Exercise 9-2 Finished Report

11. Save the file as My 2007 Freight Summary Report.
12. Leave the file open for the next exercise.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 261

Utilizing Drill-Down to View Report Details

Reports that have had sections hidden, but allow for drill-down provide a convenient way of letting the report viewer
decide which areas of the report need further explanation. Information in a hidden section will not appear on screen
or on paper when printed, but the user can access the hidden information when displayed on a screen. Once the
information is displayed on the screen, the user can then print the report.

To generate a drill-down report, place your mouse pointer over a summary item in the summary report. The mouse
pointer will change from a black arrow to a magnifying glass pointer.

Figure 9-11 Item with Drill-Down Capability (Magnifying Glass Icon)

By double-clicking the summary item a new tab will be created with the name of the selected item.

Figure 9-12 New Tab Produced by Drill-Down Request

This report can be printed if required. If the new drill-down report is no longer necessary, clicking the × symbol on

the tab will close the sub-report without saving.

Figure 9-13 Sub-Report Close Control

Copyright ©2017 Pathfinder Learning, LLP

262 Lesson 9: Summary Reports and Charting
NOTE: If drill-down sub-reports are present in your report and you return to the Design tab to modify section
behavior, a warning message will be displayed advising you of the impending deletion of all tabs containing sub-
reports. This is typically not an issue since the sub-reports can be recreated without much difficulty.

Figure 9-14 Sub-Report Closure Warning

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 263

Exercise 9-3 Using the Drill-Down Feature in Summary Reports

This exercise demonstrates how to utilize the drill-down feature. In addition, when the drill-down feature is
used, a new title will be added to the sub-report.

1. With the My 2007 Freight Summary Report file from the previous exercise, switch to the Preview tab
if necessary.

2. Place your mouse pointer over any month’s total and double-click the left mouse button.

3. Observe a new tab was created that uses the name of the month as the tab name. This sub-report will
have the individual transactions for the selected month.

Figure 9-15 Sub-report for September

4. Return to the Design tab.
5. Right-click on the Group #1: ShippedDate field located in Group Footer #1 and select Copy.
6. Right-click in the Group Header #1 section and select Paste.
7. Drop the orange paste box in the upper-left corner of the Group Header #1 section.

Figure 9-16 Inserted Title for Drill-Down Reports

Copyright ©2017 Pathfinder Learning, LLP

264 Lesson 9: Summary Reports and Charting
8. Format the newly created heading any way you choose (i.e. left-aligned).
9. Return to the Preview tab.
10. Verify your report is similar to the image below. Observe that all of the sub-reports have their respective
month names at the top of the report.

Figure 9-17 Exercise 9-2 Results

11. Close the monthly drill-down report.
12. Save the file as My 2007 Summary Report.
13. Leave the file open for the next exercise.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 265

Creating Charts with the Chart Expert

When creating reports via one of the wizards (Report, Cross-tab, or OLAP wizard), a limited set of chart types will
be presented. Cross-tab and OLAP are beyond the scope of this course.

Figure 9-18 Options when Using Wizards

In order to access the full complement of charting capabilities, you need to access the Chart Expert. The Chart
Expert can be launched after a wizard has been completed or after you have created a blank report.
If you want to add a chart to an existing report, you can display the Chart Expert in one of two ways. Either click the
Insert Chart button on the Insert Tools toolbar or choose Insert Chart from the Insert dropdown menu.

Chart Layouts
There are four chart layouts available in Crystal Reports. Different layouts correspond to different types of
data.

Advanced
The Advanced layout is used when you have multiple chart values or when you do not have any
group or summary values on your report.

Group
The Group layout is used when you have at least one group and one summary field for the group,
defined in your report.

Cross-Tab
The Cross-Tab layout is used when you have a cross-tab report.

OLAP
The OLAP layout is used when you have an OLAP grid.

Placing and Sizing Charts

When selecting the Insert Chart button, the mouse pointer becomes attached to a large orange drop
box. This orange box represents the size of the chart to be created. In all likelihood, the orange box will not

Copyright ©2017 Pathfinder Learning, LLP

266 Lesson 9: Summary Reports and Charting
fit within any of the sections in the report. By placing the upper edge of the chart in a section, the section
will automatically extend its height to accommodate the newly inserted chart.

Figure 9-19 Chart Placement Box

When the chart is added, it remains selected. Observe the shaded outline and sizing handles around the
chart. The chart can be moved to another location in the same section, or moved to another section on the
report. The chart can be resized by using the sizing handles, or by right-clicking the chart and choosing Size
and Position from the context menu.
NOTE: Make sure you have the entire chart selected before you attempt to move or resize it. If you
see sizing handles around any individual chart elements, such as the title or an individual bar or pie
wedge, you will move or resize the individual element instead of the entire chart.
Remember that where you place a chart determines the data that it displays. If you place an Advanced or
Group chart in the report header or footer, it will display data for the whole report.

Figure 9-20 Chart for Entire Report

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 267

If you place the chart in a group header or footer, the chart will appear for every group, showing data for
only that particular group.

Figure 9-21 Chart for Each Group (Month)

Cross-Tab and OLAP charts display the data from the particular objects they are based on. If you place a
cross-tab object and matching chart in a group header or footer, the cross-tab and chart will display data only
for the group they are in. Since OLAP grids do not change with their location on the report, a matching
OLAP chart will not change if it is moved.
Cross-Tab and OLAP charts are always in the same section as their matching cross-tab object or OLAP grid
object. You may have an OLAP grid in the report footer and its matching chart in the report header, but if
you try to move the chart into a group header or footer, it will not work. If the OLAP grid is moved from the
report footer to a group footer, the chart will automatically move to the matching group header.
Note: The charts that appear in the Design tab are dummy charts that do not depict actual data in the
database. When the report is displayed in the Preview tab, live data will be depicted in the chart.

Copyright ©2017 Pathfinder Learning, LLP

268 Lesson 9: Summary Reports and Charting
Exercise 9-4 Creating a Chart
This exercise demonstrates how to add a chart to a report. In addition, you will properly size and position
the chart.

1. With the My 2007 Summary Report file from the previous exercise, switch to the Design tab if
necessary.

2. Extend the height of the Report Header by twice its height.
3. In the Report Header, move the report title to the far left side.
4. Increase the height of the text box two rows high.
5. Decrease its width to make the text occupy two rows.
6. Select the Sum of Orders.Freight field in the Group Footer #1 section.
7. Click the Insert Chart button.
8. Drop the orange box in the Report Header by placing the top right corner of the orange box towards the

top right corner of the Report Header section. Because the Orders.Freight field was selected when the
chart was created, it is the field that chart calculations are based upon.
9. If necessary, increase the width of the chart by grabbing the small blue box handle located in the middle
left edge of the chart border.
10. Preview the chart.
11. Verify your chart is similar to the image below. Observe that the chart is plotting for the twelve months
because it was placed in the Report Header. The chart in the Design tab is NOT an accurate
representation of actual chart data. The chart must be viewed in Preview tab to show the actual data.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 269

Figure 9-22 Exercise 9-4 Results

12. Save the file as My 2007 Summary Report with Chart.
13. Leave the file open for the next exercise.

Copyright ©2017 Pathfinder Learning, LLP

270 Lesson 9: Summary Reports and Charting

Formatting and Editing Charts

Once a chart has been created, the need to modify certain visual or logical properties is almost a certainty. Perhaps
the report reader would rather see an area chart instead of a bar chart. You may want to change the titles that appear
on the chart. You may even want to change the chart from an Advanced chart to a Group chart, or vice versa.
To access the Chart Expert after the chart has been created, either select the chart and then from the Format
dropdown select Chart Expert… or right-click on the chart and select Chart Expert…

NOTE: The Crystal Reports Format Painter works with charts, as well as textual elements. However,
note that only the few formatting items that appear on the chart Format Editor, such as a border, drop
shadow, and so forth, will be copied from one chart to others. No chart-specific items, such as chart type,
legend, or titles, will be copied by the Format Painter.
The Chart Expert is a tabbed dialog box that provides tremendous flexibility for designing charts. Options are
defined by progressing through the Chart Expert’s six tabs: Type, Data, Axes, Options, Color Highlight, and Text.

The Type Tab
The first order of business is to choose the general type of chart, such as pie, bar, or area chart. When you
make a general choice, you typically see a more specific set of choices shown as thumbnails on the right. To
use the specific type of chart, click the thumbnail that best represents what you want to use. You will see a
description of the layout and uses of the chart in the scroll box below.
Certain chart types give you a choice of horizontal or vertical direction. If you choose vertical with a bar
chart, for example, the bars will grow out of the bottom of the chart. If you choose horizontal, they will
spread from the left of the chart toward the right.

The Data Tab
The Data tab is where you choose the layout for the chart, whether it will be an Advanced, Group, Cross-
Tab, or OLAP chart. See below on details for each. Once you choose the Layout, the data portion of the
screen will change based on the type that was chosen.

Advanced
An Advanced chart plots data from individual database records in your report. Charts created with
the Advanced layout possess logic independent of the grouping strategy contained within the report.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 271

The Advanced dialog box lets you choose data from the report or database to create a chart (fields do
not have to be used on the report to be used to create the chart). Because several different fields in
the database can affect the chart’s appearance, a little more thought is required when using this
dialog box.

Figure 9-23 Chart Expert – Data Tab – Advanced Charting

Available Fields
The Available Fields list shows report, formula, subtotal/summary, running total, and
database fields in the report. You can select any of these fields that you need for creating
your chart (except summary / subtotal fields, which can be used only in the Show Value(s)
list). If you are unsure what kind of data is in a field, select it and click the
button to see a sample of database data. Once the required field has been identified for use
in either the On change of or Show Value(s) control, select the field and click the greater-
than button next to the section where you want the field placed. The field will be
copied to the section on the right.

Values to be Displayed
The dropdown list in the upper right gives you three choices: On change of, For each record,
and For all records. The choice you make here determines how often a new chart element
(bar, pie slice, and so on) will appear in the chart.

For Each Record
If you choose For each record, a new element appears in the chart for every record
in the report. This may be useful for very small tables that have only a few records
in them. However, if your database has more than a few records, making this choice
will probably render a chart that is too crowded to be of any real value. Using this
option allows you to add one field from the Available Fields list to the Show Values
area of the screen.

Copyright ©2017 Pathfinder Learning, LLP

272 Lesson 9: Summary Reports and Charting

For All Records
If you choose For all records, you create a grand total chart, showing just one
element that displays a total of all records on the report. If you choose this option,
you won’t be able to add any fields to the Show Values area of the screen.

On Change Of
By choosing On change of in the dropdown list and choosing one or more fields
from the Available Fields list (except group summary or subtotal fields), you can
create a chart that summarizes values for the chosen field or fields. This option
creates an invisible group within the chart, creating a new chart element every time
the chosen field changes. For example, if your report contains no groups but you
choose On change of Customer.Country, your chart will have a new element appear
for each unique country that appears in the database. Whatever field you add to the
Show Value(s) list will be summarized or subtotaled by country, and the result will
be used as the value for the chart.

You can choose one or two fields to add to the On change of list. If you
choose one field, the chart will contain only one section with all the
elements located in it. If you choose two fields, the chart will be broken into
side-by-side sections, with the first-chosen field making up the first section.
Then, individual elements for the second field will appear within each of the
sections based on the first field.

You have control over the way the Chart Expert uses these groups. This is
controlled by the Order… and TopN… buttons.

Figure 9-24 Chart Expert – Data Tab – Additional Controls

Order Button
If you click the Order button, you’ll see the Chart Sort Order dialog box
with a drop-down list containing Ascending, Descending, Specified Order,
and Original Order options. You may choose to show the chart elements in
A to Z order, Z to A order, or using specified groupings. If the chosen field
is a date, time, or date/time field, you can choose how often you want a new
chart element to appear (monthly, weekly, every minute, hourly, and so on).

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 273

Figure 9-25 Chart Sort Controls

TopN Button
If you click the TopN button, you’ll see the Group Sort Expert dialog box,
where you can choose to include only the Top N, Bottom N, Top N
Percentage, or Bottom N percentage groups in your chart. You also define
what number to use for N.

Figure 9-26 Group Sort Expert Controls

Show Value(s)
Once a field has been chosen in the On change of dropdown to determine when a new chart
element will appear, you can add a field or fields to the Show Value(s) list to indicate which
values Crystal Reports will use to size the chart element. If you add multiple fields to this
list, the chart will contain multiple bars, lines, and so forth; one for each field you add to the
list.

Copyright ©2017 Pathfinder Learning, LLP

274 Lesson 9: Summary Reports and Charting

Summary Operation

If you add a number or currency field to this list (and you haven’t chosen For each
record in the top drop-down list), Crystal Reports automatically uses the Sum
function to subtotal the field for each invisible group.

If you choose another type of field, like a text field, Crystal Reports automatically
uses the Count function.

If you wish to change the summary function (for example, to graph the average sales
amount instead of the total), you can select the field you want to change in the Show

Value(s) list and click the button.

A dialog box will appear with a drop-down list containing the available summary
functions for that type of field.

Figure 9-27 Summary Aggregation Options

Choose the summary function you want used.
By checking the Show as a percentage of check box, you can choose a higher-level
group total or grand total, and chart elements will display the percentage of the
higher totals that each of the invisible group totals represents.
NOTE: If you choose On change of for an Advanced Chart and add a formula field
to the Show value(s) list, the Don’t Summarize check box will be enabled when you
select the formula. Clicking this check box for the formula allows you to display the
formula’s value directly in the chart without it being summarized again.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 275

Group

A Group chart will graph data from fields in an existing report group. You have to have at least one
group defined, with at least one subtotal or summary field, before you can use this button.

Figure 9-28 Chart Expert – Data Tab – Group Charting

On Change Of
The On change of dropdown list lets you choose when you want the graph to start a new
element. If, for example, you choose Orders.OrderDate, a new bar will show up in a bar
chart for every month (assuming the summary report is displaying information in a monthly
order.). Or for another example, if you choose Employees.Last Name, a new slice in a pie
chart will appear for every employee.

Show
The Show dropdown list lets you choose what makes up the chart element. If, for example,
you create a bar chart with On change of set to Orders.OrderDate, and Show set to Sum of
Orders.OrderAmount, you’ll see a new bar for every date. The bar’s height or width
(depending on whether you chose a horizontal or vertical bar chart) will be based on the
subtotal of OrderAmount for the group.

The Show dropdown list is populated according to what subtotal and summary fields you
place in the group header or footer of the group chosen in On change of.

Cross-Tab
The Cross-Tab button is available only if you have one or more cross-tab objects on your report. If
you have only one cross-tab object, this button will be enabled even if you have not selected the
cross-tab first. However, if you have more than one cross-tab, you must select the cross-tab that you
want to chart before you start the Chart Expert.

Copyright ©2017 Pathfinder Learning, LLP

276 Lesson 9: Summary Reports and Charting

Figure 9-29 Chart Expert – Data Tab – Cross-Tab Charting

On Change Of
The On change of dropdown list includes the two outer fields you chose for the cross-tab
row and column; if you used multiple row and column fields, only the first row or field can
be used. Crystal Reports will create one chart element (bar, pie slice, and so on) for each
occurrence of this field in the cross-tab.

Subdivided by
The Subdivided by drop-down list is initially set to None. If you leave it this way, the chart
will create only one series of chart elements, based on the field in the On change of
dropdown list. If, however, you want to create two series of elements for side-by-side
comparison, or if you are using a 3D riser or 3D area chart and want to see multiple elements
three-dimensionally, choose the other row/column field in the Subdivided by drop-down list.

Show
The Show dropdown list shows the summary field or fields you placed in your cross-tab.
Choose the field that you want to use in your chart. This field determines the size of the
chart elements (height of a bar, size of a pie slice, and so forth).

OLAP
The OLAP button is available only if you have one or more OLAP grid objects on your report. If
you have only one OLAP grid, this button will be enabled even if you have not selected the OLAP
grid first. However, if you have more than one OLAP grid, you must select the grid that you want to
chart before you start the Chart Expert.
Creating a chart based on an OLAP grid is very similar to creating a chart based on a cross-tab.
There are just a couple of differences between the two. There is no summary field to choose (OLAP
grids display only one value, so there is no choice to make). Also, the dimension hierarchy of your
OLAP grid may be a little different than the multiple row/column fields you added to a cross-tab
object.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 277

The Axes Tab

The Axes tab gives you complete control over how Crystal Reports displays the X, Y, and Z (if you are using
a 3D chart) axes of the chart.

Figure 9-30 Chart Expert – Axes Tab

By making choices in the Axes tab, you can control how Crystal Reports displays axes on your charts. The
axes are the areas of the chart that describe or depict the data values in the chart. If, for example, you have a
bar chart in which each bar represents sales volume for a country, the bottom of the chart where each country
is listed is called the group axis, also known as the X axis. The left side of the chart where the numbers
representing the volume appear is called the data axis, also known as the Y axis.

Show Gridlines
Click the Major or Minor check boxes to add gridlines to the chosen axes. Major Gridlines fall
directly in line with the axis labels that Crystal Reports assigns to the axis. Minor Gridlines appear
in between the axis labels and work only for numeric labels. Depending on the type of chart you are
using, you may not notice any difference between major and minor gridlines. Also, some charts will
always have a group axis gridline, regardless of what you choose on the Axes tab.

Data Values

If you leave the Auto Range check box for the Data Values option on, Crystal Reports automatically
formats the chart according to the number of elements it includes. If you wish to customize this, you
can turn off the Auto Range option and add starting and ending values for the axis, as well as choose
the number format (decimals, currency symbols, and so on) to use for the labels. If you choose a
certain number format, such as a currency symbol, and then recheck Auto Range, the axis will
automatically be renumbered, but the number format you chose will stay in place.

The Auto Scale option affects the beginning numeric value that the data axis starts with. If you
choose Auto Scale, Crystal Reports uses the values of the chart elements to choose an appropriate
starting number for the data axis.

Copyright ©2017 Pathfinder Learning, LLP

278 Lesson 9: Summary Reports and Charting

Number of Divisions
If you leave the Number of Divisions set to Automatic, Crystal Reports will create a predefined
number of labels and gridlines for the data axis. Clicking the Manual radio button and specifying a
number in the text box will create the specified number of divisions, along with labels and gridlines,
for the data axis.
NOTE: Not all of the options on the Axes tab will necessarily apply to the style of chart you are
using. For example, a pie chart does not use any axes options. If the chart you have chosen does not
use axes, the tab will not appear in the Chart Expert.

The Options Tab
The Options tab allows you to customize general options for your chart, such as whether to display it in color
or black and white, whether to show a legend and where to place it, and other options. The Options tab will
change based on the type of chart you have chosen.

Figure 9-31 Chart Expert – Options Tab

Chart Color
Options include Color or Black and White. If you are printing your reports on a black-and-
white printer, it may be preferable to leave the chart in color and let the printer assign gray
tones to the chart elements. These may actually look better than the ones Crystal Reports
assigns. Experiment to determine what works best with your particular printer.
Data Points
The Data Points section lets you choose whether you want labels, numbers, or both to appear on
your chart elements. If, for example, you choose Show Label with a pie chart, each of the slices of
the pie will be labeled with the item that the slice refers to. If you choose Show Value the number
format dropdown allows you to choose the format you want to see. Choosing $1, you will see the
actual dollar amounts (with no decimal places) appear above each bar.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 279

Layout
You can allow Crystal Reports to automatically arrange the chart by clicking the check box.

Legend
The Show Legend check box determines if a legend appears on your chart. The legend is the color-
coded key that indicates what the elements of your chart refer to.

You can also choose where to place the legend with options in the Placement dropdown list. The
choices are Right, Left and Bottom.

Customize Settings
By clicking the Transparent background checkbox, items can be stacked so that items behind the
chart can be seen.

The Marker Size and Marker Shape dropdown lists let you choose how markers look on a line chart.
Markers are the points on the line chart that are connected by the lines.

Additional options may appear depending on the type of chart that is chosen.

The Color Highlight Tab

The Color Highlight tab allows you to define the colors assigned to chart objects that meet a certain criteria.
For example, any bar in a bar chart whose value is greater than $60K will be assigned the color red. Another
example would be ensuring the color of a pie slice for a specific country will be assigned the color blue.

Figure 9-32 Chart Expert – Color Highlight Tab

Item List

The Item List is where conditional logic is created, developed, managed, and deleted. To create a

condition, click the button.

Copyright ©2017 Pathfinder Learning, LLP

280 Lesson 9: Summary Reports and Charting

Item Editor
The next step is to use the Item Editor to select a field from the database from the top-most
dropdown list.
Once a field has been selected, the logic needs to be selected. The logical choices are is greater than,
is less than, is equal to, etc...
The final logical component is to define the date, value, or word by which the preceding choices are
based. Depending on the field being examined, a dropdown is a convenient way to select items.
When encountering longer lists, like dates or amounts, the lists can be quite lengthy. It is usually
quicker to simply type the date or value directly into the field.
Once the logic has been constructed, the only remaining action is to assign the color code. The
Format Color list provides 16 colors to choose from as well as a Custom option where a pallet of 48
colors is presented. The designer can also create any color of their choosing by clicking the

button and supplying the appropriate RGB or HSL codes (Red,
Green, Blue; Hue, Saturation, Brightness).
The Text Tab
The Text tab allows you to assign text to different parts of your chart, and change the appearance of these
text items.

Figure 9-33 Chart Expert – Text Tab

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 281

Titles

You can add a chart title, subtitle, and footnote. Also, you can place titles on the group, data, and
series (or data2) axes of your chart.

By default, the Auto-Text check boxes are all selected and the text boxes next to them are dimmed.
You will notice that Crystal Reports has added titles into certain items automatically, depending on
the data that the chart is based on. If you don’t wish to use Crystal Reports default titles on the chart,
uncheck the Auto-Text check box for the desired title and then type the material you want to appear
on the chart in the associated text boxes on the Text tab. If you leave a text box blank, that title will
not appear on the chart.

Font

To change the appearance of the different items, select the item you want to change in the list on the
lower right of the Text tab. Then, click the Font button to choose the font face, size, and appearance
for that item. A sample of the font you choose appears in the shaded box above the Font button.

Zooming In and Out on Charts

You may zoom in and out on a limited number of chart types. If you have created a Bar or Line chart, you
will notice additional options, such as Select Mode and Zoom In, available on the context menu when you
right-click. You may also select a chart and use the Zoom options from the Chart dropdown menu.

Figure 9-34 Chart Zoom Control

If you choose the Zoom In option, your mouse cursor will change to a magnifying glass with a plus sign.
While you may be tempted to just click somewhere inside the chart expecting to zoom in, you must actually
hold down your mouse button and draw an elastic box with the mouse. When you release the mouse button,
the chart will zoom in to the area you surrounded. You may continue to highlight additional areas to zoom
in further on the chart.

While in a zoomed in state, selecting the Pan feature will allow the chart to be scrolled left and right to view
other groups that have moved off screen by virtue of the zoom in action. The mouse pointer will change to a
double left/right arrow to indicate that pan mode has been enabled.

Copyright ©2017 Pathfinder Learning, LLP

282 Lesson 9: Summary Reports and Charting
To zoom back out, right-click the chart and choose Zoom Out from the context menu, or choose the
associated option from the Chart pull-down menu. The mouse cursor will change to a magnifying glass with
a minus sign. Click anywhere on the chart to zoom back out. Continue clicking until the chart has zoomed
out to its fullest extent.
When finished zooming in or out on a chart, choose Select Mode from the chart context or dropdown menus.
Your mouse cursor will return to its default four-arrow state so that you can select the chart to move or resize
it on the report.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 283

Exercise 9-5 Editing a Chart

In this exercise, you will take the chart created in the previous exercise and apply customizations to several
visual characteristics to make the chart easier to read.

1. With the My 2007 Summary Report with Chart file from the previous exercise switch to the Design
tab if necessary.

2. Right-click on the chart and select Chart Expert…

3. On the Axes tab, in the Data values section, uncheck the box labeled Auto range.

a. Set the Min to 1000.
b. Set the Max to 5000.
c. In the Number of divisions section, select Manual and enter 7 in the adjoining field.

4. On the Options tab, uncheck the box labeled Show Legend.

a. Check the box labeled Show value.
b. Set the Number Format to $1.

5. On the Color Highlight tab, click the New button.

a. Change the top-most dropdown to select Sum of Orders.Freight.
b. Select is greater than from the middle dropdown list.
c. Type 3500 in the lower field.

6. In the Format Color section, select Lime.

7. On the Text tab, uncheck Title.

a. Change the text to read 2007 Freight Amounts by Month.
b. Uncheck the Data Title.
c. Change the text to read Dollars.
d. Click OK.

8. Preview the chart.

Copyright ©2017 Pathfinder Learning, LLP

284 Lesson 9: Summary Reports and Charting
9. Verify the chart is similar to the image below.

Figure 9-35 Chart with Partial Customization

10. Click one time on any value displayed in the middle of the bars. Right-click on the selected value and
select Format Data Label…

11. In the Format Data Labels dialog box, select the Layout tab and change the Labels location to
Outside Maximum.

12. Click OK.
13. Click one time on any Y-Axis value (Dollars). Right-click the selected item and select Format Axis

Label…
14. In the Format Axis Labels dialog box, select the Number tab.

a. Change the Category from Number to Currency.
b. Set the Decimal Places to 0.
c. Click OK.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 285
15. Verify your report is similar to the image below.

Figure 9-36 Exercise 9-5 Results

16. Save My 2007 Summary Report with Chart file.
17. Close the file.

Copyright ©2017 Pathfinder Learning, LLP

286 Lesson 9: Summary Reports and Charting

Formatting Individual Chart Objects

With so many controls available for formatting the appearance and logic of charts, and with all of the different chart
types offering different capabilities, storing all of the controllable options in a single dialog box would be
impractical.
Crystal Reports has a variety of tools available for detailed formatting of charts. The five tools most widely used by
designers are accessible when right-clicking a chart and viewing the context menu. The five tools are:

 Chart Expert
 Format Chart
 Format Background
 Chart Options
 Auto-Arrange Chart

Figure 9-37 Object Format Controls

Chart Expert
This is the primary tool used when constructing a chart or modifying the core logic and features of a chart.
Format Chart
This tool allows the designer to add borders to the chart, add a drop shadow, embed hyperlinks into the chart,
and change the chart object’s name. These settings apply to the container holding the chart, not the chart
itself.
Format Background
Although similar to the Border tab controls in the Format Chart dialog box, these controls serve the chart
itself as opposed to the chart container.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 9: Summary Reports and Charting 287

Chart Options

The Chart Options dialog box is perhaps the most widely used of all of the formatting tools. The tools here
provide the greatest artistic flexibility when deciding how information is presented in the chart. Depending
on the chart being modified, some features are unavailable.

 Appearance: Sets the appearance of the bars or slices in pie charts. Overlap, gaps, shapes, and 3D
effects are controlled here.

 Titles: Add, remove, or edit any of the titles and labels in the chart.

 Data Labels: Add the labels and/or values to the chart as well as control the placement and format of
the labels.

 Legend: Show or hide the legend as well as control all of the artistic qualities, like color, shape, and
style.

 Gridlines: Turn on or off the major and minor gridlines for the Group and Data axis.

 Axis: Show or hide vertical and horizontal axis.

 Multi-Axis: Control the behavior of multiple data sets on independent axis.

Auto-Arrange

The Auto-Arrange tool is useful when you don’t have a lot of time to try to manipulate all of the chart
objects in an attempt to create a visually appealing chart. Clicking Auto-Arrange will examine the chart and
its data and attempt to design a visually appealing result. Because what is considered visually appealing is
highly subjective, this is sometimes just a good starting point for further visual adjustments. It is a good idea
to save your work before invoking this feature; Undo does not always save the day.

Copyright ©2017 Pathfinder Learning, LLP

288 Lesson 10: Exporting Reports

Lesson 10: Exporting Reports

Unit time: 75 minutes
In this lesson, you will be introduced to:
1 The Need to Export
2 Exporting Formats
3 Available Export Destinations
4 Previewing with HTML

Copyright ©2017 Pathfinder Learning, LLP

Lesson 10: Exporting Reports 289

The Need to Export

Crystal Reports is a fantastic tool for developing and reading reports. In an ideal world, every user in an organization
would have Crystal Reports installed on their computers. This would ensure that all reports would be readable by all
users. Most organizations only purchase enough licenses for the designers and perhaps a few key analysts. The cost
of licensing often precludes widespread distribution and installation of the application. Thankfully, there are
mechanisms built into Crystal Reports that will allow viewers not in possession of the Crystal Reports application to
view reports.
It is not uncommon for report readers to operate from a variety of different operating system platforms; i.e.
Windows, Apple, Linux, Android. It is also not uncommon for a myriad of applications to be used. Common
application formats like Microsoft Word and Excel, HTML, ODBC, PDF, XML, and even plain text are widespread
throughout most organizations. Exporting reports into one of these formats is a convenient means of gaining large
scale distribution for your report.
An added benefit of exporting to one of the aforementioned formats is that the report can then be saved to a network
drive or posted to a website where users can access the information on an on-demand basis. If the report requires
immediate attention, it can be sent directly to the user via email.
Exporting a report can be performed by either clicking File  Export  Export Report or by clicking the Export

button located in the Standard toolbar.

Figure 10-1 Export Dialog Box

The upper dropdown provides a list of export type options. These include popular formats such as .RPT, .XLS,
.DOC, and .TXT formats. The lower dropdown provides a list of export destinations such as file, application, and
email.
Depending on the format chosen, a follow-up dialog box will appear. This dialog box provides customization
options specific to the selected output format.

Copyright ©2017 Pathfinder Learning, LLP

290 Lesson 10: Exporting Reports
Export Types
The formats that Crystal Reports uses can be categorized into two export types: page based and record based.
Page Based
This format attempts to replicate the look and feel of the original report as closely as possible. The
fonts, borders, colors, and spacing as well as graphics, such as charts and logos, are preserved as
close as the destination format will allow.
Record Based
This format is not so much concerned with the look and feel of the original reports. For this export
type, it is the data that is important. This type is used to export data that will later be imported into
another application such as Excel.

Copyright ©2017 Pathfinder Learning, LLP

Lesson 10: Exporting Reports 291

Exporting Formats

Below is a list of the most commonly used export formats.
Character Separated Values
This is a record based export format. In the export file, each column is separated by a predefined character
called a delimiter. Delimiters identify where one field of information ends and a new field of information
begins. If the delimiter used is a comma, then the file is known as a comma separated value or CSV file. If
the delimiter used is a tab, then the file is known as a tab separated file, or TTX file. These export formats
can be opened by most systems such as Excel or Notepad.

Figure 10-2 Separated Values Dialog Box

Crystal Reports (RPT)
This is the native file format for Crystal Reports. Files saved in this format will possess an RPT file
extension. This format saves the data as well as all of the artistic treatments and graphics. This is the same
as using the Save As feature with the Save Data with Report option selected.
Crystal Reports Read-Only (RPTR)
This is a special Crystal Report specific export format. This is a read only version of an RPT file. The data,
report definitions and database connection are exported in the resultant file. This file can only be opened by
the Crystal Report Viewer. This protects the report from accidental modification. The Report cannot be
modified and an RPTR file cannot be used to create an RPT file
One of the advantages to this format is that it retains a connection to the data source(s). If the data were to
be modified, the RPTR file can be updated to incorporate the new information.

Copyright ©2017 Pathfinder Learning, LLP

292 Lesson 10: Exporting Reports

Microsoft Excel
The report is exported on a page by page basis and added to a single worksheet. The worksheet derives its
name from the name of the report. If the worksheet becomes full, Crystal Reports creates an additional
worksheet and continues the exportation of data.
If there are more columns in the report than Excel can handle, then the additional report columns are omitted
from the export. The XLS Format can only support 256 columns while the XLSX format can handle 16,384
columns.
There are three export options available:

Microsoft Excel (97-2003) – (XLS)
This is a page based export option. If a report object is larger than 1 cell, the cells will be merged.
This format retains most formatting, but lines and boxes are omitted from the report.

Figure 10-3 Excel 97-2003 Export Options

Microsoft Excel (97-2003) Data-only – (XLS)
This is record based export option. If a report object is larger than 1 cell, the cells will not be
merged, each object is only added to one cell. This format retains most formatting. This option also
retains a subset of the original report formulas. The supported formulas are SUM, AVERAGE,
COUNT, MIN and MAX.

Figure 10-4 Excel Export Options – Data Only
Copyright ©2017 Pathfinder Learning, LLP

Lesson 10: Exporting Reports 293

Microsoft Excel Workbook Data-only – (XLSX)
This is similar to previous Excel record format. The difference is that this format supports 16,384
columns while the previous options can only handle 256 columns worth of information.
HTML (3.2 and 4.0)
This is a page based format. This format generates an HTML file format. This format is highly useful
because it retains the vast majority of the look and feel of the original report and can be viewed in any
standard Web browser. These formats preserve the layout in HTML the format. Crystal Reports can export
to HTML in version 3.2 or version 4.0. The images in the report are saved externally and a hyperlink is
added to the html output, therefore more than one file may be created while using this export.

Figure 10-5 HTML Export Options

Portable Document Format (PDF)
Exporting to the Portable Document Format (PDF) is a page based export type. This export retains both
layout and formatting options. Export Report will look the way the data is displayed in the Preview tab and
generate a virtual printout that is stored to a file. PDF documents cannot be altered without specialized
software. This is a popular format to save reports in because the file is easily emailed to report viewers.
PDF viewing software is easily, and freely, downloadable. Examples of popular PDF viewing software
include Adobe Reader, Foxit Reader, and Slim PDF reader.
A wonderful feature in the PDF export tool is the ability to create PDF bookmarks that mirror the group tree
navigation tool in Crystal Reports. This facilitates speedy navigation through the PDF.

Copyright ©2017 Pathfinder Learning, LLP

294 Lesson 10: Exporting Reports

Figure 10-6 PDF Export Options

Text (TXT)
This option exports the report in plain text. This option does not retain any formatting, graphic, or formula
information.

Figure 10-7 Text Export Options

Microsoft Word
This option exports the report in the Microsoft Word format (RTF). The text and drawing objects of the
original report are retained. Although the option is to save the file in a Microsoft Word format, the file
extension is not DOC as would be expected. Crystal Reports exports to a more generic RTF format to ensure
compatibility. Microsoft Word will open an RTF without any issues.
There are two export options available:

Microsoft Word (97-2003) – (RTF)

Figure 10-8 Word Export Options
Copyright ©2017 Pathfinder Learning, LLP

Lesson 10: Exporting Reports 295
Microsoft Word (97-2003) - Editable – (RTF)

Figure 10-9 Word Export Options - Editable

The difference between these two formats is the ability to remove hyperlinks and the ability to insert
a page break after each page in the report. In addition, the editable format retains text formatting but
does not background color, fill pattern and others may not be retained. In addition page number and
page N of M does not work in the editable format.
eXtensible Markup Language (XML)
This is a record based option. This option exports the report in XML format (eXtensible Markup Language).
This uses the SAP Crystal Reports XML schema for the export. This option is usually used for data
exchange.
Record Style – Column with spaces
This option will export the report data to a raw ASCII format with spaces and a fixed record length. This
format is ideal for transferring data to older applications.

Figure 10-10 Record Style Export Options

Record Style – Column without spaces
This format is the same as the previous Record Style format but without the inclusion of spaces.

Copyright ©2017 Pathfinder Learning, LLP

296 Lesson 10: Exporting Reports
Report Definition
This will create a text file (TXT) of your report, which doesn’t actually include any report data, but rather
formulas, variables, group strategies, etc. Once the file is saved, it can be opened in any word processor or
text editor. This can be used as a key ingredient when creating documentation regarding the design of the
report. Screenshots of the report layout could be added to further improve the scope of the documentation.

Figure 10-11 Results of Report Definition Export File

Copyright ©2017 Pathfinder Learning, LLP

Lesson 10: Exporting Reports 297

Available Export Destinations

Crystal Reports supports several export destinations. Below are a few of the options.
Application
The reporting engine exports the report to a temporary file in the specified format and then opens the file in
the appropriate application. If the output is not what is desired, the user needs only to close the previewing
application and the exported file is deleted. If the file does meet the viewer’s requirements, it is the
responsibility of the viewer to save the file with an appropriate name and location.
Disk File
The reporting engine exports the report in the specified format to a location and filename of the report
viewer’s choosing.
Exchange Folder
The reporting engine exports the report in the specified format to a Microsoft Exchange folder designated by
the viewer
MAPI (Messaging Application Programming Interface)
The reporting engine exports the report in the specified format and e-mails it as an attachment via an
installed and configured MAPI mail client (e.g. Microsoft Outlook, Microsoft Mail, or Microsoft Exchange.)

Copyright ©2017 Pathfinder Learning, LLP

298 Lesson 10: Exporting Reports

Previewing with HTML

Crystal Reports has the ability to show what a report would look like when viewed through a web browser. This is
known as HTML Preview and it is very similar to the standard Preview tab that has been used throughout this course.

To preview a report in the web browser, click the HTML Preview button located on the Standard toolbar (to the
right of the Preview button.)

This will create a new tab in the report showing the report as it would appear in a web browser. The designer can
now easily switch back and forth between the Design view and HTML Preview mode quickly and easily.

Figure 10-12 HTML Preview Tab

NOTE: The HTML Preview feature is available when reports are published to Crystal Reports Server or
BusinessObjects Enterprise. In the case of reports that are published to either of these web distribution
environments, no configuration is required and the HTML Preview feature works automatically.

The feature is also available for standalone reports if you use the Report Application Sever (RAS) to generate
the preview. To enable the feature in this situation, configure the HTML Preview feature under the Smart
Tag & HTML Preview tab of the Options dialog box in Crystal Reports. In this tab, you need to specify the
involved web server, platform, virtual server URL, and RAS server.

Figure 10-13 Program Options for Smart Tags and HTML Preview
Copyright ©2017 Pathfinder Learning, LLP

Lesson 10: Exporting Reports 299

Exercise 10-1 Exporting Crystal Reports to PDF Format
This exercise will give you experience with exporting a report to an external application for viewing.

1. Browse to the location of the saved class files and open the folder named Exercise Files\Lesson 10.
2. Select the E10-1 Export Report file and then click Open.

3. Click the Export button on the Standard toolbar.
4. Select PDF from the Format dropdown list.
5. Select Application from the Destination list.
6. Click OK
7. From the Export Options dialog box, check the box labeled Create bookmarks from group tree.
8. Click OK.
9. The locally installed PDF viewer application should open to display the finished product. Depending on

the PDF viewer, the bookmarks may manifest themselves in a variety of ways.

Figure 10-14 Exercise 10-1 Results

10. Close the PDF application without saving the file.

Copyright ©2017 Pathfinder Learning, LLP

300 Lesson 10: Exporting Reports
11. Click the Export button on the Standard toolbar.
12. Select PDF from the Format dropdown list.
13. Select Disk file from the Destination list.
14. Click OK
15. From the Export Options dialog box, check the box labeled Create bookmarks from group tree.
16. Click OK.
17. Direct the save location to a folder of your choosing on your local computer.
18. Click Save.
19. Browse to the location the file was saved in with the previous step and open the saved PDF file. The
result should be the same as when exporting to application.
20. Close the PDF file.
21. Leave the Crystal Reports file open for the next exercise.

Copyright ©2017 Pathfinder Learning, LLP


Click to View FlipBook Version