Formatting Objects

Objective

After completing this lesson, you will be able to use the formatting options to enhance the report appearance.

The Format Editor

See the following scenario to explore some of the report formatting options.

In a modern office setting, two colleagues are engaged in a focused discussion at a computer workstation, with one standing and leaning forward while explaining, and the other seated thoughtfully asking about formatting options in Crystal Reports.

These formatting options are shown in the following screenshots.

The image shows a software dialog box titled Highlighting Expert, displaying two conditional formatting rules under Item list where one highlights values less than 10,000 with red text, and the other highlights values greater than or equal to 100,000 with aqua font on a blue background in the Item editor, which allows customization of font style, color, background, and border, with buttons for creating new rules, removing, confirming, canceling, or accessing help.

Highlighting Expert: The Highlighting Expert allows you to apply conditional formatting to the fields in your report based on specific conditions or rules.

The image displays a Format Editor dialog box from a software application, specifically the Common tab, where a user can configure settings for an object named CustomerID1; options include text properties such as tooltip text, read-only mode, suppression settings, text rotation, horizontal and vertical alignment with a dropdown menu currently expanded showing alignment choices (Default, Left, Centered, Right, Justified), and checkboxes for layout behaviors like repeating on horizontal pages and keeping the object together, with a sample text field displaying the value -5,555,555 and standard dialog buttons (OK, Cancel, Help) at the bottom, all presented in a clean, functional, and user-friendly interface.

Repositioning Options: Horizontal alignment in Crystal Reports Format Editor is used to control the positioning of text or objects along the horizontal axis within a field, text objects, or other report elements.

Using the Format Editor is another, more complex method of formatting. Some of the more frequently used features of the Format Editor are the options listed in these tabs:

Common
In the Common tab, you can suppress the field, keep the field together if a record spans more than one page, control borders of the field, limit the number of lines that the field can print, rotate and align text, add tool-tip text, and lock the size and position of the selected object.
The image shows a Format Editor dialog box from a software application, featuring multiple tabs with the Common tab selected, where various settings such as Object Name (customerName1), text rotation (set to 0 degrees), alignment options (horizontal default, vertical top), and display string are available, along with several unchecked checkboxes for options like Read-only, Suppress, and Lock Position and Size, all set within a clean, functional interface designed for customizing object properties in a data or report design environment.
Border

In the Border tab, you can select line styles, drop shadows, and the color for the border and the background. Clicking Background opens a second color selection list for you to choose a fill color for the text object.

The image displays a software interface window titled Format Editor focused on the Border tab, featuring options for line styles on all four sides with Double selected for the bottom border, a color dropdown showing Black, and checkboxes for Tight Horizontal and Drop Shadow, alongside OK, Cancel, and Help buttons at the bottom, with a sample text box labeled Text Object illustrating the border effect.
Font

In the Font tab, your options include the changing the font, style, size, and color. You can also add a strikeout (a line through text) and underline effects. The sample box shows you the results of your choices.

Hint

Many of the attributes that you see in the Format Editor have the formula buttons next to them. These buttons are used for conditional formatting, or applying a condition to a specific format using a formula.
The image displays a software dialog box titled Format Editor with five tab options at the top—Common, Border, Font, Paragraph, and Hyperlink—currently showing the Font tab, which contains settings for font customization including a dropdown menu selecting Comic Sans MS, style set to Regular, font size at 10, color set to black, effect checkboxes with Underline checked and Strikeout unchecked, and character spacing set to zero points, along with a sample text preview Text Object underlined in black; at the bottom, three buttons labeled OK, Cancel, and Help are aligned horizontally.
Paragraph

If you select a string field or text object to format, the Format Editor offers these options in the Paragraph tab.

The image depicts a software dialog box titled Format Editor with five tabs labeled Common, Border, Font, Paragraph, and Hyperlink, where the Paragraph tab is active, showing settings for indentations including fields for First Line, Left, and Right with values in inches, spacing options with a dropdown menu set to Multiple and a value of 1 times normal, and reading order options with radio buttons for Left to Right selected and Right to Left unselected, accompanied by three buttons at the bottom labeled OK, Cancel, and Help.
First Line
Enter the distance in inches (or the default measurement for your report) that you want the first line of the paragraph to be indented from the rest of the paragraph. 
Left
Enter the distance in inches (or the default measurement for your report) that you want the paragraph to be indented from the left margin of the page. 
Right
Enter the distance in inches (or the default measurement for your report) that you want the paragraph to be indented from the right margin of the page. 
Line Spacing
Enter the spacing you want for lines as a multiple of the font size you are using, or as an exact number of points. 
Of
Use this box to enter the multiple that you want to use (if you selected Multiple for Line Spacing), or the number of points (if you selected Exact for Line Spacing). 
Reading Order
Use the options in this area to define whether your text is to be read from left to right or from right to left. 
Text Interpretation
Use this list to select the type of pre-formatted data (string or memo fields only) or text you are inserting in a field. Crystal Reports extract information about the font, size, style, color, and paragraph and displays the data or text with the specified attributes. 
Number

If you select a numeric field to format, the Format Editor offers these options in the Number tab.

The image shows a software interface for customizing number formats, with the main window titled Format Editor displaying options under the Number tab, including a list of style formats, a Customize... button highlighted and connected by arrows to two smaller Custom Style dialog boxes on the right, each offering detailed options for currency symbol settings, decimal and thousand separators, rounding, negative number display, and sample previews, illustrating a step-by-step process for users to modify how numbers and currency symbols are formatted in their system.
System Default Number Format
This option checks the settings in your Windows control panel and uses those settings for your numeric fields.
Currency Symbol Area

This option enables you to display a currency symbol and its type, if applicable.

Customize
Use this button to see more detailed formatting options in the Custom Style dialog box. 
Date and Time

If you select a Date, Time, or DateTime field to format, the Format Editor offers these options in the Date and Time tab.

The image displays two side-by-side dialog boxes from a software interface, with the left box titled Format Editor showing a list of date styles and a Customize... button highlighted and connected by a yellow line to the right box titled Custom Style, which provides detailed date formatting options including date type, calendar type, order, separators, and sample preview, all set within a plain white background and designed for user customization of date formats.
Style
From this predefined list, choose a date/time style to apply to the field selected in your report. When you choose System Default Long Format or System Default Short Format, the program uses the time and date formats from the Regional Settings Properties dialog box in the Windows Control Panel. 
Customize
Use this button to see more detailed formatting options in the Custom Style dialog box. 

Text Objects and Labels

Text objects are containers that hold information. A text object can contain a character, words, or a paragraph.

The image displays three sequential screenshots from SAP Crystal Reports software showing the process of inserting and editing a Text Object within a report, where the user navigates to the Insert menu to select Text Object, then places a text box in the report header area and types the label Customer Sales, highlighting a structured report design interface with labeled sections like Report Header, Page Header, Details, and Report Footer.

Text objects and the elements inside them can then be independently formatted with fonts, color, and tabs.

To display a title or a label on your report, create a text object.

Hint

When you have completed any editing changes, do not press Enter to end the process. This action inserts a new line inside the text object. Click outside the text object to finish the editing process.

Text objects can be modified by double-clicking the text object or using a right-click using the shortcut menu.

Combining Fields with Text Objects

Embedding a Field into a Text Object

To print text and field information together, you embed the data into a text object. For example, you might want to create a form letter with the beginning "Dear Mr. Smith", where "Mr." and "Smith" are two different fields in the data source, and you manually add the salutation.

The image shows two screenshots of a report design interface for a Customer Sales report, where the first screenshot displays separate text fields labeled Data as of: and Print Date in the page header, while the second screenshot demonstrates the consolidation of these fields into a single dynamic expression Data as of {Print Date} positioned similarly, with arrows indicating the change from separate static labels to a combined dynamic label, set against a structured grid layout featuring sections like Report Header, Page Header, Details, Report Footer, and Page Footer.

If you were to put these three fields into a text object (separated by a space), Crystal Reports joins them together:

  • Mr. Paul Smith

  • Ms. Elaine Jones

  • Ms. Carol Smith-Jones

Hint

While modifying the text object, drag and drop the field into the text object to the desired position. Do not let go of the mouse button until the vertical insertion line is in where you want the field to print.

Note

Embedding a text object within another text object is not possible.

Multiple Objects Formatting

Use the Format Painter to copy formatting properties from one report object to one or more target objects. The Format Painter button displays on the Standard toolbar when you select a source object in your report. If you apply formatting to a target field that is not the same as your source field, then only the common properties are applied.

Watch this video to see how to use the Format Painter.

Some things to keep in mind about the Format Painter:

  • The Format Painter does not copy hyperlink information to a target object or field.

  • The Format Painter does not copy formatting that is applied through use of the Highlighting Expert.

  • The Format Painter does not copy formatting from text or template objects to database fields.

  • When using a Date and Time field as your source, a target field’s date or time properties are changed; the reverse is also true (that is, a Date field or a Time field used as your source also affects the date and time properties of a Date and Time field).

Note

  • The Format Painter button is not available until you select an object or field.

  • Click the button a second time, or press ESC, to exit the Format Painter.

  • You cannot apply formatting to read-only objects or fields.

  • Hold the Alt key down if you want to apply formatting to more than one object or field.

This table lists the source report objects and fields and the applicable targets you can use with the Format Painter.

Source Report Objects and Fields and Applicable Targets for Format Painter

Source object or fieldTarget object or field
Report field (not in a cross-tab)Report field (not in a cross-tab)
Report field in a cross-tabReport field in a cross-tab
Template fieldTemplate field
Text object (not in a cross-tab)Text object (not in a cross-tab)
Text object in a cross-tabText object in a cross-tab
Object in an OLAP grid headerObject in an OLAP grid header
Line objectLine object
OLE or BLOB fieldOLE or BLOB field
SubreportSubreport
Chart, map, OLAP grid, or cross-tabChart, map, OLAP grid, or cross-tab

Summary

  • The Format Editor offers extensive formatting options with tabs for different features, such as borders, fonts, and number formatting.
  • Text objects can be independently formatted, and fields can be embedded within them for combined text and field output.
  • The Report Explorer aids navigation, while the Format Painter copies formatting properties, and Text Rotation vertically aligns text and fields.