Professional Documents
Culture Documents
Crystal Reports Graph
Crystal Reports Graph
Overview
This document outlines how to create a two line graph in Crystal Reports (CR), and can be used as a template for creating multi-line graphs (>2 lines) as required. The example used is outlining how to graph two Sales Totals by Month, with each line representing a different Years data (1994 and 1995).
Contents
PART 1: SETTING UP THE REPORT ...............................................................2 PART 2: CREATING THE GRAPH ...................................................................4 FINDING MORE INFORMATION .......................................................................5 CONTACTING CRYSTAL DECISIONS FOR TECHNICAL SUPPORT ......................5
6/25/2002 4:31 PM
Page 1
Crystal Reports
Step 2:
@month // This formula will extract the month name as an integer using the Month(x) function. Month({Orders.Order_date}) @Order_Total // This formula may or may not be necessary; it derives the total value of any order {Order Details.UnitPrice}*{Order Details.Quantity} @1994 // This formula determines if the order happened in 1994 if year({Orders.OrderDate}) = 1994 then {@order_total} else 0 @1995 // The same formula as above but for 1995 if year({Orders.OrderDate}) = 1995 then {@order_total} else 0
Step 3:
Insert the database field {OrderID} and the formula fields @1994 and @1995 in the detail section of the report.
6/25/2002 4:31 PM
Copyright 2002 Crystal Decisions, Inc. All Rights Reserved.
Page 2
cr_line_graph_two_series.pdf
Crystal Reports
Step 4:
Create a group based on a specified order. There will be twelve items in the specified order -- January through December. To create this group: 1. Select Insert/Group. 2. Sort and Group on the Month formula IN SPECIFIED ORDER 3. In defining the specified order, follow the below pattern for each of the months After selecting " in specified order", you will type "January" in the Named Group text box. Click New, the Define Named Group dialog box appears. Define the group as "January is equal to 1". Repeat this step for the other months changing the names and month number appropriately.
Step 5:
Highlight the @1994 formula field and create a subtotal that will appear in the group footer of the group you just created.
Step 6:
Drag the group name from the header or place a group name field in the footer.
Step 8:
Hide or suppress, as you prefer, the details section. At this point, if you preview a cross-tab style report should exist:
6/25/2002 4:31 PM
Page 3
cr_line_graph_two_series.pdf
Crystal Reports
Select Insert/Graph-Chart Expert. Choose the Line Graph type. Click the DATA tab and select the DETAIL/FORMULA button.
Step 2:
In the resulting dialog box set the following options: Put graph ONCE PER REPORT On change of @month Values are: @1994 and @1995
Step 3:
Click the GRAPH DONE button. Preview your report, and at this point the line chart should exist as desired. If you would like to fine tune the graph: 1. Right click on the chart and select format chart. 2. Click Custom, the Crystal Chart Editor appears. Please note that if you want to re-edit the chart click PGEditor not Custom. 3. From the file menu, select Apply Template. 4. You will have to select a *.3df template from the c:\crw\gallery\line directory. Assuming, of course, a standard installation to the "C" drive. Try line.3df.
6/25/2002 4:31 PM
Copyright 2002 Crystal Decisions, Inc. All Rights Reserved.
Page 4
cr_line_graph_two_series.pdf
Crystal Reports
NOTE
5. Select File/Exit, Save the chart, Click Graph Done in the Graph/Chart Expert Window. 6. After applying the template, your graph should look similar to this:
This document demonstrates how to create and modify graphs in version 6 of both the Crystal Report Designer and Seagate Info Report Designer. Also includes a number of tips and tricks not currently documented in the User's Guide, and some sample graphing reports.
http://support.crystaldecisions.com/
Email Support:
http://support.crystaldecisions.com/support/answers.asp
Telephone Support:
6/25/2002 4:31 PM
Copyright 2002 Crystal Decisions, Inc. All Rights Reserved.
Page 5
cr_line_graph_two_series.pdf
Crystal Reports
http://www.crystaldecisions.com/contact/support.asp
6/25/2002 4:31 PM
Page 6
cr_line_graph_two_series.pdf