|
Now that you've selected your database and a database table, let's start inserting some data into a report. The easiest way to enter fields is through the Field Explorer pane (as shown in Figure 3-3).
Figure 3-3: The Field Explorer pane is on the left side of the Report Design area.
Tip | You should notice this pane displayed within the left side of the Report Design area. If you do not see the Field Explorer, select View, Field Explorer from the menu bar. Make sure the Field Explorer option is selected. You can dock and undock the Field Explorer pane by dragging it to any area of the Report Design area. Once the Field Explorer is unlocked, you can resize it by dragging any of its edges. |
The Field Explorer contains the different types of fields that you may place within your report.
In Chapter 1, you learned about database fields and how they're the main type of reporting object included within a report. However, there are other types of reporting fields that you may wish to include within your reports (besides just database fields). Table 3-1 summarizes the different types of reporting fields. The Field Explorer provides the ability to add these different fields to your reports.
Reporting Field | Description |
---|---|
Database fields | Database fields are the columns of a database that contain one unit of information for a particular record. You learned about database fields in Chapter 1. |
Formula fields | Formulas are mathematical statements that often perform "what-if" calculations by changing selected values and having Crystal Reports recalculate the results. Report designers (such as yourself) create these formulas. However, you can also use any of Crystal Reports' built-in functions, which are essentially pre-existing formulas. You'll learn more about formulas in Chapter 10. |
Parameter fields | Parameters are values provided by the user and used as a constant value by a report. Parameters are used as a means of customizing the reporting operation. For example, a common use of parameters is to allow users to enter a date range (with this range being the parameter). When the report is run, only records that reside within this date range display. You'll learn more about parameters in Chapter 11. |
Running total fields | Running totals are totals that calculate the sum of a group of records, as well as increment using values from previous groups of records within the report. You'll learn more about running totals in Chapter 9. |
Group name fields | Groups are divisions of records that are related to each other in some way. For example, in a sales report, a group might consist of all sales generated within a particular sales region. You'll learn more about groups in Chapter 8. |
Special fields | Special fields are system-generated information not part of the database table. Some examples of special fields include page numbers, the date the report was printed, and the report's file path. You'll learn more about special fields in Chapter 4. |
You'll spend a lot of time in the Field Explorer pane, using it to add database fields, formula fields, and special fields. In fact, the bulk of information that you'll include within your reports is pulled from the Field Explorer pane.
Let's begin exploring the Field Explorer by adding database fields to your report. As you'll see, database fields tend to make up the majority of a report's content. No matter how snazzy and decorative a report looks, a report's main purpose is to display the records from a database.
To add database fields to your report, perform the following steps:
In the Field Explorer pane, scroll down to the Data-base Fields node.
Expand this node. You'll see the Customer table you selected previously. Here, all tables that you've selected (for use within the report) display.
Expand the Customer table node.
You'll see a list of all fields contained within the Customer table display, as shown in Figure 3-4.
Figure 3-4: Adding database fields from the Field Explorer pane
Select the Customer Name field from the Field Explorer pane.
To insert this field onto your report, drag the Customer Name field from the Field Explorer to the Report Design area.
To drag the field, you'll need to left-click and hold on the Customer Name field.
Tip | You'll notice that as you drag a field, a rectangular object frame appears at the tip of your cursor pointer. This object frame represents the field that you've selected to place on your report. |
Once you've added the database field to your report, drag the object frame to the far-left portion of the Details section.
Hold down your left mouse button as you drag the object frame. Release the mouse button to drop the Customer Name field.
Your screen should look something like Figure 3-5.
Figure 3-5: Adding a database field to a report
To move your objects within your report, you can use the same drag-and-drop procedure that you did when pulling the object from the Field Explorer. In other words:
Click and hold your left mouse button on the object.
Drag the object where you want it.
Release the mouse button.
You can also move objects by using vertical guidelines.
When you add a database field to the Details section, you may have noticed that an "upside-down pointer" object appears in the vertical ruler (which sits above the report). This "upside-down pointer" is a vertical guideline, as shown in Figure 3-6.
Figure 3-6: A vertical guideline
Vertical guidelines are non-printing lines that aid in alignment by helping you move objects with precision. Guidelines have a snap property that automatically snaps objects to them.
When you move a vertical guideline left or right, all objects attached to that guideline also move. Vertical guidelines are especially useful if you have a number of objects aligned with a database field (for example, a header and a subtotal) and you wish to move them all together.
Tip | Another trick you can use to move all objects at once is to hold down your Ctrl key and click multiple objects. You'll notice an elastic box appear around the objects as you click them. Once several objects are selected, release the Ctrl key. You can now move all of the objects as a group. |
|