Combining and Layering Report Objects

The concepts of combining and layering report objects becomes relevant when you need to precisely control the relationship between two or more objects when occupying a common space on the report. For example, let's assume that rather than having our country field read USA, we would like to combine the Country database field with a text object so that it will read, Country/Pays: USA displaying the textual description for country in both English and French. To accomplish this, you can easily combine a text and a database field into one common report object.

We will continue to build on the earlier exercises, and add a more descriptive text object to our report to produce the desired results. However, we will start by adding a group definition to our report. The group definition will allow us to logically present each customer within the country in which they are located.

  1. From the Insert menu, select Group to present the Insert Group dialog. Select the Country field (located under the Customer table) from the uppermost drop-down list. Leave the sort order as Ascending and click OK to return to the report.

  2. Verify that you are working in the Design view of the report click on the Design tab if necessary. You should now see two new sections listed in the left column area of the design environment Report Header #1 and Report Footer #1. From the Insert menu, select Text Object and drop the object to the right of the Group #1 Name field in the Group Header section. Type Country/Pays: for the textual content of this new object (notice the space after the colon), as shown in Figure 8.13.

    Figure 8.13. The Insert menu allows you to quickly add a group and text object in to your report.

    graphics/08fig13.jpg

  3. Highlight the Group #1 Name field object, click and drag it over the new text object field (you can drag the entire object after the mouse pointer has turned into a four-way cross icon), and drop it on to the text object when the flashing vertical cursor indicates that it will fall precisely to the right of the textual description you have entered.

    graphics/bookpencil_icon.gif

    Dragging and dropping objects in order to combine them is a very precise maneuver and might require some practice. If necessary, stop here and rehearse this step until you are comfortable with this technique.


  4. After you have successfully combined these objects together, the design application still references the newly combined object as a Text object. We now need to widen the object's display area. Click this object to highlight it and drag the left-side perimeter handle farther to the left until you reach the left margin of the design area, as shown in Figure 8.14.

    Figure 8.14. You have now combined a database field object with a text object to form one common report object.

    graphics/08fig14.jpg

  5. With the combined text object highlighted, use the steps identified earlier in this hour to modify the object's properties to present the field values in a bold red font style, as shown in Figure 8.15. Click the Preview tab to see a how the report results will be displayed. (Use the Refresh toolbar button if the Preview tab is not visible.)

    Figure 8.15. After combining two or more objects, you can specify formatting properties for the newly combined report object.

    graphics/08fig15.jpg

  6. We will now add a corporate logo to our report and use this to discuss object layering. Select Repository Explorer from the View menu. When the Repository Explorer dialog is visible, expand the Crystal Repository item and then expand the Images node to reveal two sample images we can use. Highlight the Xtreme Logo image and drag it into the Report Header section. Drop the image into the Report Header section so that its left perimeter will be aligned directly above the left perimeter of the Telephone Number column, as shown in Figure 8.16.

    Figure 8.16. Drag and drop the Xtreme Logo image object into place in the Report Header section.

    graphics/08fig16.jpg

Notice, as illustrated in Figure 8.16, that you have partially covered the report title object with the new logo image. This could have certainly been avoided by placing the image object farther to the right, but in this case we will use the Move property of the report title field to once again make it visible.

  1. Right-click the report title text object, select Move, and then select To Front from the additional pop-up options. This will position the report title object on top of the logo image, as you can see in the report preview.

  2. To resolve the issue of overlapping objects in the Report Header section, adjust the two objects so that the report title is displayed farther to the left of the logo image, as shown in Figure 8.17. Save your report sample if you wish.

    Figure 8.17. By adjusting the objects located in the Report Header, you have resolved the need to layer these objects.

    graphics/08fig17.jpg

  3. As a final step, use the Format Expert dialog to modify the report title text so that it appears in a bold, navy blue, size 20 Arial font with no displayed borders. Your report should now appear very much like the example shown at the beginning of the hour in Figure 8.2.

As a result of these exercises, we now have a very useful report that displays each customer contact record distinctively grouped within the country in which they are located. By combining and layering report objects, you are able to more precisely control the presentation characteristics of your reports. In doing so, you can easily leverage your accessible database fields, yet present a more meaningful descriptive field value to the business users of the report, as we did with the bilingual representation of the country field object.



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