Common Formatting Features

The most common formatting feature is to simply change font color or font face. This can be done by choosing the features directly on the Formatting toolbar, as seen in Figure 13.1.

Figure 13.1. Formatting toolbar for all your standard formatting needs.

graphics/13fig01.jpg

In Hour 5, the Highlighting Expert was introduced. Because it is an expert and quite self-explanatory, we will assume that you have already learned the fundamentals of the highlighting expert. For more information, refer back to Hour 5.

graphics/bookpencil_icon.gif

Because this lesson is considered a more advanced topic, it will focus on the more advanced formatting features. For more information on standard formatting functionality, see Hour 8, Fundamentals of Report Formatting.


ToolTips

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

In this example, Xtreme Mountain Bike's first requirement is to let the business user know more about the formula that was created to show the number of days late for each order. Xtreme's management has asked for the following text to appear whenever a user mouses over the Days Until Shipped fields on the report: "Since our corporate standard for quality shipping is same-day service, anything not shipped on the day it was ordered is considered late in red."

  1. Open Chap5.RPT, or the report created earlier in Hour 5. Select File, Open and browse to find Chap5.rpt and open it.

  2. Format the field. Right-click on the Days Until Shipped Field in the Details Section of the report and choose Format Field.

  3. Add the ToolTip text. In the Format Editor dialog, select the Common tab. In the ToolTip Text box, enter the following text: Since our corporate standard for quality shipping is same-day service, anything not shipped on the day it was ordered is considered late in red. (see Figure 13.2).

    Figure 13.2. Format Editor, Common tab with ToolTip text added.

    graphics/13fig02.jpg

  4. Test the ToolTip text. Press OK to finish the formatting. In Preview, scroll the mouse over the same field and see that the rollover text now appears as Xtreme's management requested. Before proceeding, save the report as Chap13_1.rpt by choosing File, Save As.

Lines and Boxes

Adding lines and boxes to a report makes it easier to read as well as visually shows grouping for business users of reports.

Xtreme's management would like to expand formatting on Chap13_1.rpt. They would like lines under each Detail section as well as a box around each group to show more actively where the groups begin and end (and to indicate that the subtotals belong to the records above the subtotal instead of below).

  1. Use Chap13_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 will change to a pencil. Move the mouse to the left-bottom 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 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 13.3.

    Figure 13.3. Preview of report to show a line under each detail record.

    graphics/13fig03.jpg

  4. Add the box by choosing Insert, Box. The mouse will change to a pencil. Move the mouse to the top-left of the Alley Cats 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 13.4.

    Figure 13.4. Preview of report to show lines and boxes.

    graphics/13fig04.jpg

  5. Save the report as Chap13_2.rpt using File, Save As.

graphics/lightbulb_icon.gif

A feature of boxes is that they can be rounded. By right-clicking on a box, choosing Format Box, and selecting the Rounding option, the rounding factor can be changed by the slide or the percentage buttons. Figure 13.5 shows how Xtreme's report would look with rounded boxes.

Figure 13.5. Preview of report showing rounded boxes.

graphics/13fig05.jpg


Vertical Text

Another visually pleasing feature is the ability to rotate text. This can be very effective when used in conjunction with the Underlay Section property for sections.

Xtreme's management would like the Group Header (Customer Name) to appear down the left side of all the records (rotated by 90 degrees).

  1. Start by using Chap13_2.rpt in Design Mode.

  2. Format the Group Name Field. In the Group Header section, right-click on the Group Name Field and choose Format Field. Select the Common Tab. Change the Text rotation to 90 degrees and click OK.

  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 right-most square on the field. By holding down the left-mouse button, resize the object to about 1/4". Now choose the bottom square on the field and stretch the height to 1". Figure 13.6 shows how it should look.

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

    graphics/13fig06.jpg

  4. Refresh the report to see your progress by pressing F5. It will show the text rotated, although it is not running down beside the records as seen in Figure 13.7

    Figure 13.7. Preview of report with text rotation.

    graphics/13fig07.jpg

  5. Set the Group 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 13.8.

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

    graphics/13fig08.jpg

    graphics/alarmclock_icon.gif

    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 in order to have the company name appear to be top-justified as shown in Figure 13.8.


  6. Save as Chap13_3.rpt.

Text rotation can be used to conserve and make better use of the available report real estate as well. For example, extra wording around charts and graphs could be used in this way see the Chart.rpt example included with the Crystal Reports sample reports.

Hyperlinks

Report objects do not just have to be something to look at. They can be actionable as well. For example, adding a hyperlink to the report means that when the user scrolls over the particular field, the mouse changes to a hand icon, indicating that if the user selects the field the hyperlink will be executed.

Xtreme's management wants the group name field to link to the Crystal Decisions Web site.

  1. Start by using Chap13_3.rpt in Preview mode.

  2. Right-click on the rotated text group name field and select Format Field. In the Hyperlink tab, select Website on the Internet and type the following into the edit box. http://www.crystaldecisions.com. Click OK.

  3. Refresh the data by pressing F5. Scroll the mouse over the group name field. Notice that the mouse changes to a hyperlink hand. If selected, it will take the user to Crystal Decisions' Web site.

  4. Save the report as chap13_4.rpt.

graphics/lightbulb_icon.gif

Remember that ToolTips can be created to change the text that appears when the mouse rolls over an object. A ToolTip with the same text as the hyperlink could be used so that the user can see where the link will take him.




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