The Report Design Area

book list add book to my bookshelf create a bookmark purchase this book online

mastering crystal reports 9
Chapter 1 - Building Your First Report
Mastering Crystal Reports 9
by Cate McCoy and Gord Maric
Sybex 2003

The result of the Standard Report Creation Wizard is the generation of a report that is opened in Preview mode in the Crystal Reports designer, as shown in Figure 1.21.

click to expand
Figure 1.21. Previewing the report

Navigating the Report

How can you tell you’re in Preview mode? Well, the screen is quite busy, and we’ll explore all of it, but let’s focus our attention on a horizontal area a third of the way down the screen under the toolbars (see Figure 1.21). This horizontal area contains the following:

  • Tabs for Design and Preview mode

  • The current date and time

  • An X button you can click to close this report but stay in Crystal Reports

  • Forward and backward navigation buttons to move one page at a time through the report

  • First and last navigation buttons to move to the first page or last page in the report

  • An estimate of the number of pages in the report and the current page number

    Warning 

    The page count estimate is usually incorrect until you navigate through the pages directly. For instance, the estimate in Figure 1.21 shows pages 1 of 1+. At this point, Crystal has made its best guess and knows that there is more data than will fit on a single page, but it does not yet know how many pages will be required to display it. Clicking the forward and backward buttons will update the page count estimator.

Using Preview Mode

The intent of Preview mode is to display the data as the user of the report will see it. From Figure 1.22, you can see that we have a column of data for Country and a column of data for ResortName, the two fields we chose using the Report Creation Wizard. We grouped the data based on Country and sorted it in ascending order, and sure enough our data is being displayed using these criteria.

click to expand
Figure 1.22. Preview mode

Notice that Crystal took care of arranging the fields in the report automatically. While this was thoughtful, it might not be aestheticly pleasing, so rest assured that you can change it to your liking in Design mode.

Group Tree

Whenever you perform grouping in your report, a group tree is displayed in Preview mode in the Crystal Reports design area. The group tree is a vertical area that appears anchored to the left side of the screen, as shown in Figure 1.23. It is used as a navigation technique to let the user jump to a particular group within the report.


Figure 1.23. Group tree

By clicking a group name in the group tree, the data that appears in the preview area changes to the data that references the chosen group. For instance, we clicked the text line Bahamas in the group tree, and the display area moved the Bahamas group to the top of the screen, indicating that there are two resorts in the Bahamas, as shown in Figure 1.24.

click to expand
Figure 1.24. Using the Group tree

Design Mode

The Design mode layout area is where you’ll do most of your work. In this area, you rearrange, add, and delete text, fields, and objects to create a visually appealing report. Notice in Figure 1.25 that we don’t see actual data in Design mode; instead, we see placeholders for fields, group names, and summarization totals.

click to expand
Figure 1.25. Design mode

The wizard placed the following objects into appropriate places on the report:

Fields:

Country, ResortName

Groups:

Group #1 Name: This is the group created on the Country field.

Summary:

Count of Country: This is the summarization on the Country field.

Text Labels:

Country (field name), ResortName (field name), and Grand Total

Graphic Elements:

Single underline beneath each group name

Single underline beneath the last item in each group

Double underline beneath the Grand Total

Automatic Fields

Also notice in Figure 1.25 that Crystal added some additional information that you did not request while you were working through the Report Creation Wizard. Namely, the following two piece of information were automatically added to the report for you:

  • Print Date

  • Page Number

Print Date is a variable that shows the date the report was displayed on the screen or printed to a printer. Page Number is a variable that, as you would expect, displays the sequential page number currently being viewed.

Sections

How did Crystal know where to place the variety of elements it created during report generation? It followed some simple rules regarding section bands. Crystal Reports is known as a banded report writer. It has five basic bands, or sections, that information can be added to in a report. When you use the Report Generation Wizard, Crystal adds information to the appropriate band based on the element’s type. Once the report is generated, you can make changes to the placement that Crystal set up for you.

The five basic bands represent physical layout areas on a piece of paper, and their purposes are described in Table 1.4.

Table 1.4: Five Basic Report Bands

Band Name

Description

Examples of Elements

Report Header

Items placed in this section appear once per report; the information is placed at the very beginning of the report.

Report title

Page Header

Items placed in this section appear once per page and on every page of a report; the information is placed at the very beginning of the page.

Column headings, print date

Details

Items placed in this section repeat for each data record retrieved from the data source.

Fields

Report Footer

Items placed in this section appear once per report; the information is placed at the end of the Details section.

Grand totals

Page Footer

Items placed in this section appear once per page and on every page of a report; the information is placed at the end of the page.

Page number

From the above descriptions, you’ll notice that the Page Footer appears after the Report Footer. This is indeed correct. The information placed in the Report Footer appears at the end of the data from the Details section. Imagine a page that has data only to about the one-third of the page mark. At that point, the Report Footer prints. The Page Footer, on the other hand, appears at the very end of the page in the last inch of the printable area. Figure 1.26 shows the bands as they relate to their physical layout on a piece of paper.


Figure 1.26. The five basic bands   

Additional Sections

In addition to the five basic bands, or sections, two additional sections are added for each group that you create. We added one grouping based on the Country field, so our report shows a header and footer band for that group:

  • Group Header #1: Resorts.Country-A

  • Group Footer #1: Resorts.Country-A

As with the other header and footer areas, items placed in the header area appear above the group, while items placed in the footer area appear below the group.

Sections in Design Mode

In Design mode, the five basic section bands appear anchored to the left side of the screen and next to the design layout area. Additional header and footer bands appear for each group created, as shown in Figure 1.27.


Figure 1.27. Design mode sections

Sections in Preview Mode

In Preview mode, a section band appears to the right of the group tree and to the left of the actual data in the preview area. The names of the band may appear abbreviated, such as PH for Page Header and GH1 for Group Header #1, or will display with their complete names.

For each group added, an incrementing number identifies the group. The report we’re creating has only one group, so you see GH1 and GF1 for Group Header #1 and Group Footer #1 repeated for each new country. Remember that Country was the field upon which we based our group.

Toolbars and Menus

click to expand
Figure 1.28. Toolbars and menus

Table 1.5: Good Windows Conventions

Area Name

Purpose

Title bar

Every window should have a title; it displays the name of the application, in this case, Crystal Reports, and the name of the current object, in this case, the report name.

Menu

Contains drop-down text-based navigation to the tasks that can be performed in the application; the first two and last two menus are standard in most applications: File, Edit, Window, and Help.

Toolbar

Contains shortcut icons to menu items; moving the mouse slowly over the icon displays a short tool tip in text to describe the task performed by the icon.

Crystal Reports follows the typical Windows convention for changing the menu options and toolbar options available at any given point by displaying context-appropriate options.

Tip 

You can drag and drop the toolbar sections alongside one another and reorder them; click very near the left edge of the section you want to move to select it.

Use of content on this site is expressly subject to the restrictions set forth in the Membership Agreement
 
Conello © 2000-2003     Feedback


Mastering Crystal Reports 9
Mastering Crystal Reports 9
ISBN: 0782141730
EAN: 2147483647
Year: 2005
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net