Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Peter Norton's Guide to Visual Basic 6
(Publisher: Macmillan Computer Publishing)
Author(s): Peter Norton
ISBN: 0672310546
Publication Date: 09/09/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Using the Design Window

The Design window (see Figure 14.2) is separated into two sections that provide onscreen information which helps you design a report. The large white area of the Design window is the Edit box. This is where you design and format your report. The horizontal lines in the Edit box separate the report into several sections. As you add new data groups to your report, more sections appear in the Edit box. The gray area to the left of the Edit box displays additional information to assist you in placing the data and other objects on the report. The horizontal lines extend into the gray area, identifying which section is which.


Figure 14.2.  You access the Design window through the Design Window tab in the main window.

Several common features are incorporated into Crystal Reports that you have probably used in other applications. These include a ruler that can be displayed to assist in the placement of data on the form and a Snap-to-Grid feature like the one in the Visual Basic development environment, which assists in lining up objects on the report. Crystal Reports functions and features are accessed via the toolbar at the top of the main window, the main menu, or by using the pop-up menus directly on the report. Crystal Reports also provides wizards to help you add the following objects to the report:

•  Column totals
•  Selection conditions
•  Data groups
•  Formulas (calculated fields)
•  Sort orders

The right-click pop-up menus provide access to a selected object’s related functions. Some of these options are as follows:

•  Changing font styles
•  Formatting the data
•  Adding borders
•  Changing colors
•  Browsing the data from the database
•  Adding conditions

After you select your database, the Design window is displayed to enable you to insert and format the data you need in your report. When you start a new report, the five sections listed in Table 14.1 are created automatically in the Design window.

Table 14.1. Section types found in the Design window.

Section Name Description

Title Displays the report title, data, and any other information that must appear at the top of the report. Information displayed here is shown only once.
Page Header Similar to the Title section; this information is displayed at the top of every page.
Details Displays the detail information from a query.
Page Footer Usually displays the page number and any other information that you want at the bottom of each page.
Summary Displays information only on the last page of your report.

You build reports by inserting data fields, formulas, and other information into the Details section of the Design window. You use the Insert menu to select or build the fields you want to insert on the report. You add subtotals and other group values by selecting a field and then building the conditions to generate the new subtotal or group value. These group sections are created as needed, and the values are placed in the associated group section. If you want the value to be some place else on the report, you simply select it and drag it there.

Using the Preview Window

You can see how your report will look when it is displayed or printed by switching to the Preview window. Whenever you select this tab, Crystal Reports retrieves the data from the database, performs any defined calculations, and then displays the report (see Figure 14.3). After the data is displayed, you can review the positioning and formatting of all the information on the report. Additionally, you can see the results of all summaries, calculations, and filters. In effect, this is what the final report looks like.


Figure 14.3.  Use the Preview tab to view a report during the design process.

While on the Preview window, you can still modify the format of your report without having to return to the Design window. The Preview window does have a different look and feel than the Design window. Each field in the database can contain hundreds of values, depending on the number of records in the database. When you place a field in the report on the Design window, a single field box is displayed that represents all those values. When you select this field, sizing handles appear, and the border changes color (see Figure 14.4).


Figure 14.4.  Although you can’t see the yellow border in this figure, you will see it when working with the report.

On the Preview tab, you are working with the actual data. Instead of a box with 9s or Xs in it, the data values are displayed. When you select a field, a sizing box appears around every value from the selected field. Despite the difference in look and feel, the process of building and modifying the report is the same in both windows.

Working with the Crystal Reports Wizards

Crystal Reports contains several wizards you can use when creating reports. When you start a new report by choosing File, New, the Create New Report dialog box is displayed as shown in Figure 14.5.


Figure 14.5.  The Create New Report dialog box displays the available report wizards.

The series of buttons in the Create New Report dialog box represents the different report wizards from which you can choose. Each wizard takes you through the steps required to create that style of report. If you want to build a new report based on an existing one, click the Another Report button. The program will make a duplicate of the original report that you can modify as needed to create the new report. If you want to build a report from scratch, click the Custom button. Several Report Type and Data Type buttons appear at the bottom of the Create New Report dialog box (see Figure 14.6).


Figure 14.6.  Custom report buttons enable you to create a new report.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited.