Putting On the Finishing Touches

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

At this point, the report we created answers the business question of how many resorts VistaNations has in each country and the names of the resorts. We can make the report a little more visually appealing by making some simple changes and using some basic graphic elements. This will also give you a chance to use the design interface, toolbar, and menus a bit.

Indenting Groups

One of the first and easiest enhancements to make is to indent the detail data beneath a group name. By default, Crystal left-aligns the group name and the data. You can easily change this by doing the following:

  1. Click the Design tab.

  2. Click the Country field in the Details section.

  3. Press the right arrow key twice to indent the field data.

  4. Click the Preview tab to see the effect of your change.

The group data should now display indented, as shown in Figure 1.29.

click to expand
Figure 1.29. Indented group data

Boxes and Lines

Lines and boxes can be added around text labels and fields to call attention to a particular area of the report. In our report, we’ll draw a box around the two column headings, Country and ResortName, by doing the following:

  1. Click the Design tab.

  2. Choose Insert > Box.

  3. Use the pencil drawing tool to draw an outline box around the two column headings in the Page Header.

The result is shown in Preview mode in Figure 1.30.


Figure 1.30. Drawing boxes

Tip 

Another simple visual effect is to add a line by choosing the menu options Insert > Line.

Pictures

One of the easiest ways to make your reports look more professional is to add a picture image. Let’s add the VistaNations logo to the Page Header so that it appears at the top of every page in the report.

The VistaNations logo exists in a TIF image file. To add a graphic to the page header, do the following:

  1. Click the Design tab.

  2. Choose Insert > Picture.

  3. Locate and select the image using the Open menu.

  4. Click the mouse inside the Page Header section to anchor the image.

Table 1.6 shows the types of graphics that can be placed in a Crystal report.

Table 1.6: Types of Graphics

File Extension

Meaning

.BMP

Microsoft Windows bitmap format

.WMF

Microsoft Windows Metafiles

.TIF

Tagged Information File format; also known as TIFF images

.JPG

Joint Photographic Expert Group format; also known as JPEG images

.PNG

Portable Network Graphics format

The result of adding the graphic can be seen by previewing your work, as shown in Figure 1.31.

click to expand
Figure 1.31. Adding a graphic

Resizing and Moving Objects

When Crystal adds fields and text to a report, it adds them in a default size that may or may not completely display the object. Notice the Print Date variable that was automatically added, as shown in Figure 1.32. You can see that the last letter appears to be cut off in Design mode and would display truncated in Preview mode as well.


Figure 1.32. Print Date variable

You can fix this by manually resizing the field area using the object resize handles shown in Figure 1.33. These handles are shown as very small squares centered on each border of the object. Moving your mouse over the square displays a two-headed arrow, signaling that you can drag and drop the border to resize the object.


Figure 1.33. Object resize handles

With an object selected and the object resize handles visible, you can reposition the object in the design or preview windows using drag-and-drop techniques. The resize symbol is an intersection set of two double-headed arrows. When you see this symbol, you can drag and drop the object to move it any place in the report, including to different sections.

Saving a Report

We’ve done a good deal of work on this report. Let’s save what we’ve done so that we can use it later. Saving a Crystal Reports file in the Windows environment is like saving any other type of file. Reports are saved in a file with an .RPT extension. To save a report, use the menu sequence File > Save. A Save As dialog opens to prompt you to provide a filename and automatically sets the type as Crystal Reports. We’ll save this report as CH01.RPT. You can save it to any location accessible to your computer.

Warning 

Files created with Crystal Reports 9 cannot be opened with older versions of Crystal Reports.

start sidebar
A Word about Report Naming Conventions

Small companies may have just a few reports, while large companies may have hundreds of reports. It is a good investment of your time to sit down with the IT (Information Technology) folks in your organization and agree on some report naming conventions.

Each Crystal report is stored in an operating system file that has an .RPT extension. Some companies embed information in the name of a report; for instance, D582-CM.RPT is a report created in Department 582 by someone with the initials CM. Another convention might involve the content of the report, for instance, Employee Sales.RPT or MonthlyProjections.RPT. (Check with your operating system rules before using blank spaces in filenames.)

Before you decide on conventions, consider the operating systems and devices to which you will be deploying reports. Many operating systems, including Microsoft’s, allow long filenames, which means that you can make the portion of the filename that comes before .RPT very robust and meaningful and include spaces. Other operating systems, such as Unix, prefer the 8.3 (pronounced eight-dot-three) naming convention, or short filename, where the number of characters that comes before the period should be eight or fewer. Similarly, small handheld devices, such as cell phones, can store less information and have smaller output displays, so short filenames might be easier to manage.

Agreeing on a good naming convention early in the process will help you find your reports more easily later on!

end sidebar

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