• No results found

V ERSION 7 T EST D RIVE

This Test Drive section is designed to give you some hands-on exposure to the Seagate Crystal Reports 7. These exercises step you through designing a new report and adding formatting and other enhancements to an existing report. Even if you’re an experienced Seagate Crystal Reports user, you may want to follow through these exercises to better understand how this release may be different from the version you use now.

The Hands On exercises include:

• Creating a Report - connecting to a database and creating a simple report

• Modifying a Report - adding some additional formatting and enhance-ments to a report

• Importing a Report - converting an ASCII legacy report to a Crystal Report

After you have completed these exercises, you may want to create some simple reports using a database you are familiar with, or try modifying some of the sam-ple reports included with this version. There other specific test drives you can complete for both Web Reporting and the Report Designer Component for Microsoft Visual Basic. These are included in the corresponding Getting Started Guides which can also be found on the Seagate Crystal Reports CD.

Hands On: Creating a New Report

To help you quickly create professional-quality reports, Seagate Crystal Reports includes Report Experts that walk you through the report generation process step-by-step, giving you “paint-by-number” solutions to complex reporting problems.

In most cases, Report Experts present you with a series of tabs. Each tab requests information about one aspect of the reporting process. You work through the tabs, selecting only those tabs necessary for the reporting task at hand. When the

Step by step

1 Open Seagate Crystal Reports 7, if it is not already running.

2 To create a new report, select New... from the File menu. The Report Gallery window will appear.

3 Click on the Standard button. The Create Report Expert window will appear with a series of tabs. This initial Data tab allows you to select the method used to connect to your source of data.

4 You will be connecting to an existing Access database file so click on the Data File button. The Choose Database File window will appear. Select the file named “xtreme” from the list of files and click Add.

5 Now that you’ve specified the source of the data, the Select Tables dialog box appears. We’re only interested in using one table for this simple report, so select “Customer” from the list and click OK. Click Done to close the Choose Database File dialog box. You’ll return to the Create Report Expert window. Now that you’ve selected the database and the table for your report, you’ll need to specify the fields you want to include in the report.

6 Click on the Fields tab and select the “Customer Name” database field in the Database Fields text box. Click and drag the field into the Report Fields text box. Do the same for the “Last Year’s Sales”, “City” and “Region”

fields.

The Report Expert creates column headers for you using the field names as a default. If you want to rename a column, simply type the new name in the corresponding column header field.

7 Click on the Preview Report button to view the report so far. Passing your mouse pointer over the various report objects will display information about that object in a ToolTip which is the small yellow box which pops up next to your mouse pointer. You can see the actual database field names displayed when you pass the pointer over some of the report fields.

You’ve now quickly created a basic report which has the core sales informa-tion for all customers. Now we’ll alter the report to make it more specific and easier to read.

Manipulating Data

Now that you’ve created a basic report, you can manipulate the data to modify the report any way you want. You may want to filter data to include only those customers in a certain country, for example, or you may need to present subtotals in a certain order, list companies by region, or highlight certain totals according to their amounts.

To use the Report Expert to help make these changes, select Report Expert...

from the Report menu. A Confirm Command dialog box will pop up, click Yes and the Report Expert will appear.

8 Let’s sort the report data geographically. Click on the Sort tab and drag the

“Region” and “City” fields into the Sort Fields text box. Select in ascend-ing order if not already visible in the Order drop-down box.

9 We want to show the total sales for each group on our report so click on the Total tab. Because The “Last Years Sales” field is the only numeric field in the report, the expert automatically selected it for totaling.

10 For this report, we will only show the overall top sales performers so click on the TopN tab. The Report Expert automatically selects sum of “Last Year’s Sales” and Top 5. We’ll accept the defaults as shown.

11 We’ll focus the report further by choosing only customers in the USA for this report. Click on the Select tab, highlight the “Country” field and drag it into the Select Fields text box. Select “equal to” in the second drop-down box and “USA” in the third drop-down box. This will exclude all records from the report where the country field does not match USA.

Adding a Graph

Seagate Crystal Reports contains a powerful graphing tool that converts data into graphs so you can include intuitive, presentation-quality graphs in any report.

These graphs can be completely customized and they can be inserted almost any-where in your report. Simply select the style of graph you want and the Report Export automatically creates it for you.

12 We’ll now add a graph that represents the regional subtotals of the sales fig-ures as a percentage of the total sales in the USA. Click on the Graph tab and click on the Pie button in the Graph Gallery. Select the Regular pie with 3D visual effect and click on the Data tab. The Report Expert automatically creates the graph based on the sum of “Last Year’s Sales”.

Adding a Style

To make your report more appealing, you can add a variety of elements such as borders, underlines, and logos. By using the style features in the Create Report Expert, you can add style attributes to any report.

13 To add a style to this report, click on the Style tab and select the Red/Blue Border style. We’ll take this opportunity to add a title as well by typing

“Sales by Region” in the Title field.

14 Click Preview Report and you will see the modified report complete with graph. Double clicking on one of the pie graph segments will “drill-down”

into the sales data display the matching report details for that region. You can also right-click on the graph and select Launch Analyzer to change pie slice colors or make other modifications to the graph. To use this report for the next exercise, you may want to save the report on your system.

This exercise has shown the basic steps in creating a new report. Although you don’t always have to use the Report Experts, they make connecting to your data

Hands On: Modifying Reports

In some cases, you will want to create reports that are more complex than the simple report you created in the previous exercise. Summarizing data, incorporat-ing data from more than one database or providincorporat-ing multiple views of the same data are typical requirements for many, more complex reports. Seagate Crystal Reports has several powerful tools that help you design almost any report that you can imagine.

In this exercise, you’ll start with an existing simple report and use Seagate Crystal Reports to make several modifications to the report.

Before you begin

Ensure that you have completed the previous exercise and know the name and location of the sample report you created. This will be used as the starting point for this exercise.

Step by step

1 Open Seagate Crystal Reports 7, if it is not already running.

2 Open the report you created in the previous exercise by selecting Open...

under the File menu and navigating to the appropriate file location.

Creating a Formula

In many cases, the data you want to appear in your report already exists in fields within database tables. Sometimes, however, you need to put data in your report that does not exist in any of the data fields. In such cases, you must create a for-mula. For example, to calculate each customer’sales for last year as a percentage of total sales for the region, you need to know the subtotal of sales for the region as well as the sales for each individual customer in that region.

3 Select the Design tab in the report window at the top left corner of the report. Select Formula Field... from the Insert menu item at the top of the screen. Click on the New... button, the Formula Name dialog box will appear. Name the formula “% of Sales” and click OK.

The Formula Editor window will appear. The Formula Editor lets you create, test, and modify your formula. and displays a series of buttons representing the dif-ferent types of Report Experts that are available.

4 Enter the following formula in the Formula Editor window by double-click-ing each field in the Formula Editor list boxes:

{Customer.Last Year’s Sales} % Sum ({Customer.Last Year’s Sales}, {Customer.Region})

• Double-click “Customer.Last Year’s Sales” from the Fields list (Left Pane)

• Double-click “Per cent x%y” from the Operators list (Right Pane)

• Double-click “Group Footer #1:Sum of Last Year’s Sales” from the Fields list (Left Pane)

The operator you selected automatically formats the result of the formula to print as a percentage.

When you select items from the list boxes, they are automatically entered in the formula window complete with brackets, punctuation, and other syntax items. If you enter your formula manually using the keyboard, you have to make certain you enter those syntax items yourself. It is safer and faster to build a formula by choosing list-box items.

Scroll through the Functions list box to see the wide range available to you.

Functions are built-in procedures or subroutines used to evaluate, calculate, or transform data; they make it easy for you to create formulas without coding. The Formula Editor includes financial functions that let you place arrays and ranges in formulas. You can even extend functions with your own custom functions by creating them with any COM-compliant language such as Visual Basic, Visual C++, and Delphi.

5 Click on the Save and Close button (third from the left) at the top of the Formula Editor to return to your report.

6 Click Insert to place the field in your report. When you move the pointer, it will change to a gray field object box.

7 Position the field object box in the Details section of your report, to the right of the “Last Year’s Sales” column. Click to insert the field.

8 Click Close. The Insert Fields dialog box will close.

You have now created a new field in your report which uses a simple formu-la to calcuformu-late the percentage contribution of each customer to the total sales for the region. Seagate Crystal Reports has over 160 built-in formula func-tions which allow you to perform a wide range of calculafunc-tions on data in your database.

Highlighting Important Data

To manipulate the formatting in different sections of your report, you can use for-mulas created in the Formula Editor to control field and object attributes such as color, font, border, underline, and strikeout. Using formulas, you can conditional-ly format data based on whatever criteria you select. This version of Seagate Crystal Reports also introduces the concept of highlighting - a quick and easy way to identify important data in your report.

In the following example we’ll use highlighting to display percentages of last year’s sales in red if they are less than 20% and in blue if they are greater than 30%.

9 Select the Preview tab in the report window. A preview of your report will appear.

10 Position the mouse pointer over any number in the “% of Sales” column and click to select it. A rectangle appears around that entry and the rest of the column becomes shaded to indicate that all similar fields in this column have also been selected.

11 Click the right mouse button. The shortcut menu for that column appears.

12 Select Highlighting Expert... from the shortcut menu. The Highlighting Expert window will appear.

13 In the Item List window, click on new item to create a new rule. Select “less than” from the Value is: list box and type the number 20 in the value box. In the Font Color list box, select “Red”. This completes the first condition we wanted to highlight.

Now, again click on new item in the Item List window to create the next rule. Select “greater than” from the Value is: list box and type the number 30 in the value box. In the Font Color list box, select “Blue”. This completes the second condition.

14 Click OK to save the new highlighting and return to the Preview window.

You’ll now notice that all sales percentages less than 20% or greater than 30% are now highlighted in the appropriate color. Any other value is dis-played in the default color. Highlighting is a very simple way to spot impor-tant values, especially in very complex or detailed reports.

Inserting a Map

Sometimes, there are important relationships in your report that depend on geo-graphic location. These dependencies are often very difficult to uncover using a report with conventional tables and graphs. Seagate Crystal reports provides a geographic mapping expert that provides a visual view of your data, superim-posed on an appropriate map. In this exercise, we’ll add a map to the simple sales report and interactively alter the appearance of the map.

15 Before adding the map, locate the pie graph at the beginning of the report, right-click on it and select Delete.

16 Select TopN/Sort Group Expert... from the Report menu item at the top of the screen. Change the “TopN” item to “Sort All” and click on the OK but-ton.

17 Select Map... from the Insert menu item at the top of the screen. The Map Expert window will appear. The default values shown in the Data window will map the Sum of FY98 Sales by State/County. We’ll accept these defaults.

18 Click on the Type tab at the top of the window. You can change the type of map produced as well as set the colors used to display data. We’ll accept the rest of the default values, but we will change to colors used to display the data. From the “Color of lowest interval” box, select the color in the bot-tom row labeled “Pale green”. In the “Color of highest interval” box, select the color in the top row labeled “Dark green”. Click OK to continue.

Seagate Crystal Reports analyzes the “State/County” field and determines that it contains data for all of the states in the United States. It then retrieves the appropriate map and shades each state from pale green to dark green based on the magnitude of sales. Like charts, maps support drill-down in Preview mode. If you double-click on one of the states in the map, you will be presented with underlying sales detail for that state.

19 Right-click on the map and select Launch Analyzer... from the menu. This will open a third tabbed window which presents the Analyzer view of the report. In the Analyzer, you can right-click to zoom in, zoom out and pan the map to zero in a particular region. Try zooming in on Southern California and you will eventually see additional detail representing cities, roads and rivers. Any changes you make in this view are retained in the Preview win-dow, letting you interactively customize the map view presented without recreating the map itself.

There are many other advanced modifications you can make to reports. This includes the use of cross-tabs or subreports to examine different views of the same data. Reports can be created which use built-in SQL query features to per-form report processing on the database server. Or reports can complied for distri-bution to others. To see some of the other powerful capabilities of Seagate Crystal Reports 7, take some time to browse the User’s Guide or explore the on-line documentation in the help system.

Hands On: Importing Reports

Many companies rely on several existing computer systems to help manage criti-cal business operations. Most of these legacy systems produce some kind of report which is needed to make important decisions. The investment in designing and producing these reports often makes it difficult, expensive or time consuming to modify these reports, distribute them or migrate them to newer computer sys-tems. Seagate Crystal Reports has a powerful tool that can help convert these reports into the Seagate Crystal Reports format. The Document Import Tool is designed to convert existing ASCII-based reports to make transitioning between systems or distributing legacy reports, as simple as possible.

In this exercise, you’ll start with an existing simple legacy sales report, and use the Document Import Tool to convert it to a Crystal Report.

Step by step

1 Open Seagate Crystal Reports 7, if it is not already running.

2 To create a new report, select New... from the File menu. The Report Gallery window will appear.

3 Click on the Document Import Tool button. The Document Import Tool window will appear. The blank document window is used for viewing the legacy text report and the buttons to the right are used to specify the various areas of the report.

4 To create a new report, select New... from the File menu. You will be prompted to locate a legacy report file. Use the browse button to navigate to one of the included sample files. The default directory is “Program

Files\Seagate Software\Crystal Reports\Reports\Import” and the file name is

“import1”. Select this file and click Open and OK to load the file.

The legacy text report will appear in the document window.

5 Now you will use your mouse to highlight and define various sections and

5 Now you will use your mouse to highlight and define various sections and

Related documents