Modifying Object Properties for Formatting Purposes

Now that the foundation of our report is complete, it is time to focus on how to improve the form of the report the aesthetic characteristics.

We will concentrate on modifying various object properties to further improve the presentation value of the report. In doing so, we will be using the Format Editor to access a variety of specific properties, such as fonts, borders, colors, and alignment. The Format Editor is a commonly used dialog to quickly and easily modify all your report objects, and its contents are reflective of the specific object type being formatted (text, chart, database field, and so on).

  1. From our earlier exercise, return to the Design tab of your report and right-click on the report title text object (located in the Report Header section) and select the Format Text option from the list to bring up the Format Editor dialog, as shown in Figure 8.8.

    Figure 8.8. The Format Editor dialog is available from the right-click pop-up menu.

    graphics/08fig08.jpg

    The Format Editor dialog allows you to adjust a variety of properties of the object organized within various tabs.

  2. Navigate to the Font tab of the Format Editor and select the Bold font style, a font size of 11, and a font color of Red.

  3. Select the Paragraph tab of the Format Editor and choose Centered from the Horizontal Alignment drop-down list, As shown in Figure 8.9.

    Figure 8.9. The Format Editor dialog provides for quick and easy access to a variety of object properties.

    graphics/08fig09.jpg

  4. Now select the Border tab from within the Format Editor and then select Single from each of the four border Line Style drop-down lists (left, right, top, and bottom). Under Color, click the Background check box and select Yellow from the drop-down list as the background color. Based on all of your selected properties in the Format Editor, you should now see a representative example of the text object in the Sample area at the bottom of the dialog box. Click OK to save these settings and return to the Design tab on your report.

  5. To improve the effectiveness of your report, you can modify the database field column titles to provide more meaningful descriptions for the business users of your report. Working within the Design tab of your report, double-click on the Phone object in the Page Header section of the report. When the cursor's focus is on this object, you can delete, append, or update the text as you wish. Modify this text to read Telephone Number and then click anywhere outside the object to remove the cursor's focus from the object.

As an alternative to the Format Editor, you can also use the toolbar and menu commands to quickly apply common formatting techniques, such as font and alignment characteristics.

  1. From the View menu, select Toolbars to present the Toolbar dialog. Make sure that the Standard, Formatting, and Insert toolbar items are all selected and click OK.

  2. Click on the Preview tab to see a preview display of what the report will actually look like. Again, if the Preview tab is not displayed in the application, click the Refresh toolbar button to execute the report. From the Preview mode, hold down the Shift key on your keyboard and click each of the five column titles so that they are all highlighted with a dashed perimeter. With all five columns title fields highlighted, click the Bold toolbar button, represented with a large bold letter B on the formatting toolbar. Refer to Figure 8.10 to see the results of this action.

    Figure 8.10. Common formatting properties can be quickly specified via the formatting toolbar commands, such as font styles and colors.

    graphics/08fig10.jpg

  3. With the five column title fields still highlighted, click the downward arrow located on the Font Color toolbar button, represented with an underlined letter A on the formatting toolbar. Select the bright blue color from the available list, as shown in Figure 8.10.

In order to make the Email field appear more meaningful to the business users of the report, let's format the Email database field values to resemble and behave like standard hyperlink text.

  1. To remove the cursor focus from the five column titles fields, click anywhere outside these field areas or press the Esc (escape) key on your keyboard.

  2. Click any of the actual Email field values to highlight the Email database field objects and right-click on the same object to present the pop-up menu. From the pop-up menu, shown in Figure 8.11, select the Format Field item.

    Figure 8.11. Right-clicking on any field object presents you with a list of commands for that particular object.

    graphics/08fig11.jpg

    graphics/bookpencil_icon.gif

    You can use the Hyperlink tab within the Format Editor to create hyperlinks to a Web site, email address, file, or another crystal report. A hyperlink is saved with your report and is available to other users as a way of linking additional information as it relates to your report. Hyperlink definitions can also be defined by formulas, thus making data-driven hyperlinks a very powerful feature of Crystal Reports.


  3. Select the Hyperlink tab after you have opened the Format Editor. From the available Hyperlink Types, select Current Email Field Value this option will automatically create a hyperlink based on the values stored within this field in the data source, and these values must be formatted as proper email addresses in the data source, such as abc@domain.com.

  4. Now let's make the Email field appear as a standard hyperlink value, commonly known to have a blue underlined font style. Select the Font tab within the Format Editor dialog to apply the blue font color and select the Underline check box. Click OK to return to the report Preview, and then press Esc to remove the cursor focus from all report objects.

  5. Based on the completion of the previous step, your mouse pointer should now change into a hand icon as it floats over any of the Email field values on the report. This indicates that upon clicking on any of the Email values, you will initiate an email message to be sent to that address, as shown in Figure 8.12.

    Figure 8.12. By applying formatting characteristics, you can enable the business users to initiate an email to the respective customer contact.

    graphics/08fig12.jpg

By using the Format Editor, as well as the Toolbar commands, to modify report object properties, you have very quickly and easily enhanced your report for presentation purposes. Not only did we enhance this report example visually, but we also easily incorporated Hyperlink functionality to add an additional level of interactivity to our report. For more information on using Hyperlink functionality in reports, refer to Hour 13, "Custom Formatting Techniques."



Sams Teach Yourself Crystal Reports 9 in 24 Hours
Sams Teach Yourself Crystal Reports 9 in 24 Hours
ISBN: B003D7JUVW
EAN: N/A
Year: 2005
Pages: 230

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