Common Formatting Features

The most common formatting feature is changing font color or font face. This can be done by choosing the features directly on the Formatting toolbar, as shown in Figure 9.1.

Figure 9.1. The Crystal Reports Formatting toolbar lets you change object formatting.

graphics/09fig01.jpg

Chapter 6 introduced the Highlighting Expert. I will assume that you have already learned the fundamentals of the highlighting expert.

Working with ToolTips

All report objects can have rollover text or ToolTips available when the report is viewed. For example, if you would like to use descriptive text to explain why a certain formula was created, you could do this with a ToolTip.

In the example created in Chapter 6, you now want to inform the end user about a formula. The text should appear whenever a user mouses over the Days Until Shipped fields on the report. The following steps create a ToolTip:

  1. Open Chap6.rpt, or the report created earlier in Chapter 6. Select File, Open and browse to find Chap6.rpt and open it.
     
  2. Format the e-mail field at the far right. Right-click on it and choose Format Field.
     
  3. Add the ToolTip text. In the Format Editor dialog, select the Common tab. To the right of the ToolTip Text box, click on the formula editor button (see Figure 9.2), and enter the following formula, which makes a custom message for each e-mail address:
     

    
     
     
    
    "Click here to compose an e-mail to " +
    
    {Customer.Contact First Name} + " " +
    
    {Customer.Contact Last Name} + "."
    
    
     

    Figure 9.2. On the Common tab, click the ToolTip text formula button.

    graphics/09fig02.jpg  
  4. Test the ToolTip text. Click OK to finish the formatting. In Preview, scroll the mouse over the e-mail field and see that the rollover text now appears as a custom message, which is different when viewed by each e-mail recipient. Before proceeding, save the report as Chap9_1.rpt by choosing File, Save As.
     

Lines and Boxes

Adding lines and boxes to a report can make it easier to read as well as visually grouping items for business users.

To add lines under each Detail section as well as a box around each group, follow these steps:

  1. View Chap9_1.rpt in Design mode. If the report is not already open, open it using Ctrl+O. Make sure that the report is in Design Mode by choosing Ctrl+D.
     
  2. Insert the line by Choosing Insert, Line. The mouse changes to a pencil. Move the mouse to the bottom-left of the fields in the Details Section. Hold down the left mouse button to begin drawing the line. Scroll the mouse to the right until you reach the end of the Details Section. Once reached, release the mouse button.
     
  3. View the result in Preview mode. Select F5 to refresh the report to see the line with the data as shown in Figure 9.3.
     

    Figure 9.3. Use the Preview mode view of a report to show a line under each detail record.

    graphics/09fig03.jpg  
  4. Add the box by choosing Insert, Box. The mouse changes to a pencil. Move the mouse to the top-left of the Country/Pays USA data in the Group Header. Hold down the left mouse button to begin drawing the box. Scroll the mouse down to the bottom left of the Summary amount in the Group Footer and then scroll to the right until the end of the Group Footer section. Once reached, release the mouse button. The resulting box should appear similar to Figure 9.4.
     

    Figure 9.4. Preview a report to show lines and boxes.

    graphics/09fig04.jpg  
  5. Choose File, Save As and save the report as Chap9_2.rpt.
     

TIP

A feature of boxes is that they can be rounded. To do this right-click on a box, choose Format Box, and select the Rounding tab. The rounding factor can be changed by the slide or the percentage buttons. Figure 9.5 shows how Xtreme's report would look with a rounded box at 30%.

Figure 9.5. Preview of a report showing rounded boxes.

graphics/09fig05.jpg

 

Creating a Vertical Text Watermark

Another visually pleasing feature is the capability to rotate text. This can be very effective when used in conjunction with the Underlay Section property for sections. Follow these steps to make a sample watermark:

  1. Start by using Chap9_2.rpt in Design mode. Choose Insert, Text Object to add a text field in the Report Header. Enter DRAFT for the text.
     
  2. Right-click on the Text field and choose Format Text. Select the Common tab. Change the Text Rotation to 90 degrees and click OK. Go to the Font tab, where you can change the font size to 48pts. Because you want this watermark to be semi-transparent, choose the More item from the Color drop-down, where you can specify a custom color. Choose a light gray (or silver). Increase the Character font spacing by specifying 70 pts in the dialog, then exit the dialog by clicking OK twice.
     

    NOTE

    This color section, common to all objects within Crystal Reports 10, enables you to specify colors using RGB or Hue, Saturation, and Luminance. By choosing corporate colors and adding them to the custom colors, you can extend corporate branding into report presentation.

  3. Resize the field. Because the field needs to go down the page, it needs to be resized to be narrow and long. Select the field and choose the rightmost square on the field. Resize the object by holding down the left mouse button. Now choose the bottom square on the field and stretch the height to 5''. Figure 9.6 shows how this should look.
     

    Figure 9.6. Design tab with text rotation applied to group name field.

    graphics/09fig06.jpg  
  4. Refresh the report to see your progress by pressing F5. It shows the text rotated, although it is not running down beside the records as shown in Figure 9.7.
     

    Figure 9.7. Preview of the report with text rotation.

    graphics/09fig07.jpg  
  5. Set the Report Header to Underlay. Because the text does not yet flow to the record level, it must be underlayed. This is a section property. Right-click in the Group Header 1 section located on the left side of the report design area, choose Section Expert, select Underlay Following Sections, and click OK. The desired results should appear similar to Figure 9.8.
     

    Figure 9.8. Preview of the report with rotated text flowing beside detail records.

    graphics/09fig08.jpg  

    CAUTION

    Realize that when rotating text, the justification rules might be opposite of what would normally be expected. In the case of 90 degrees, the text must be right-justified to have the company name appear to be top-justified, as shown in Figure 9.8.

  6. Save as Chap9_3.rpt.
     




Special Edition Using Crystal Reports 10
Special Edition Using Crystal Reports 10
ISBN: 0789731134
EAN: 2147483647
Year: 2003
Pages: 341
Simiral book on Amazon

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