Chapter 7. Creating the Destination Report

When you need another report from a database, it isn’t always necessary to create the report from scratch. Many are simply variations of existing reports. We’ve already created a Mileage Report that groups trips by month (refer to Chapter 6). To create a new report that is similar to the first one, we can duplicate the initial report and then make any necessary changes to the fields, Subsummary parts, and sort instructions. In this chapter, we’ll duplicate the Mileage Report and modify the duplicate to create a destination-based report, enabling you to quickly see your year-to-date mileage for each destination, as well as the number of trips to each destination.

Creating the Destination Report

Duplicate the Layout

Duplicate the Layout Switch to Layout mode (View > Layout Mode).

Duplicate the Layout Ensure that the Mileage Report layout is displayed. If it isn’t, choose its name from the layouts menu at the top of the status area.

Duplicate the Layout

Duplicate the Layout Choose Layouts > Duplicate Layout. A duplicate is created named Mileage Report Copy and becomes the active layout.

Duplicate the Layout To rename the layout, choose Layouts > Layout Setup. The Layout Setup dialog box appears.

Duplicate the Layout Enter Destination Report in the Layout Name text box, remove the check mark from Include in layouts menu, and then click OK to dismiss the dialog box.

Duplicate the Layout

Group by Destination

The sort field associated with a Subsummary is responsible for breaking the data into groups. In the Mileage Report, Month is the field on which the leading Subsummary is sorted, resulting in a separate group for each month. Because the Destination Report will be grouped by destination, we need to change the leading Subsummary’s part definition to use Destination as the sort field.

Group by Destination In Layout mode with the Destination Report layout selected, choose Layouts > Part Setup.

Group by Destination In the Part Setup dialog box, select Sub-summary by Month (Leading) and click Change.

Group by Destination In the Part Definition dialog box, select Sub-summary when sorted by, select Destination in the field list, ensure that no check boxes are checked, and click OK. Click Done to dismiss the Part Setup dialog box.

Group by Destination

Group by Destination On the layout, delete the Year field from the Subsummary part by selecting the field and pressingGroup by Destination/Group by Destination.

Group by Destination Double-click the Month field to replace it. In the Specify Field dialog box, select the Destination field, ensure that Create field label is unchecked, and click OK. Month is replaced on the layout by Destination.

Group by Destination

Group by Destination Widen the Destination field to 2.5" by selecting the field and Group by Destination-dragging one of the handles on its right side.

Group by Destination

Refine the Layout

Delete the Destination field and label. Since the destination is now listed in the leading Subsummary, there’s no point in repeating it within the Body part. We’ll need to delete the field and close up the gap that the deletion leaves.

Delete the Destination field and label. Select the Destination field in the Body part and pressDelete the Destination field and label./Delete the Destination field and label..

Delete the Destination field and label. Select the Destination label in the Header and pressDelete the Destination field and label./Delete the Destination field and label..

Delete the Destination field and label. Delete the Destination field and label.-click the Date field (in the body) and the Date label (in the Header) to select them as a pair. Drag the pair to the right to close up the gap made by the deletion of the Destination field.

Correct the title. Using the Text Tool, edit the title to read Destination Report. Drag the title to center it on the 5.5″ mark on the horizontal graphic ruler.

Here are the changes you’ve made so far.

Correct the title.

Change the title in the trailing Subsummary. Using the Text Tool, edit the Monthly Subtotal text in the trailing Subsummary to read Destination Total. Click the Align Right icon on the Text Formatting toolbar.

Set the color of the Destination Total text to match the color of the Miles Sum and MilesExpSum fields to the right of it.

Change the title in the trailing Subsummary.

Align the Destination Total text. Use the Size palette to set the Destination Total text’s position at 8.750 inches from its right edge (aligning it with the right edge of the End Mileage field directly above it).

Change the title in the trailing Subsummary.

Modify the Grand Total text. Using the Selection Tool, select the Grand Total text in the Trailing Grand Summary. Click the Align Right icon on the Text Formatting toolbar. Use the Size palette to set the Destination Total text’s position at 8.750 inches from its right edge, aligning it with the Destination Total text.

Color the trailing Subsummary. Click the trailing Subsummary tab and make it the same custom color as the Header, Trailing Grand Summary, and Footer.

Modify the Grand Total text.

Transparent text backgrounds. To make a text string or field blend with the background color, you can either set the string or field’s fill color to the background color or set its pattern to transparent.

Select the three items in the trailing Sub-summary (the Destination Total text and the two fields) and set their fill pattern to transparent.

Transparent text backgrounds.

Create a Trip Count Field

To make the summary statistics a little more useful, we’ll create a new Summary field that will display the trip count (number of trips) for each destination.

Create a Trip Count Field Switch to Layout mode and ensure that the Destination Report layout is displayed. Choose File > Define > Database.

Create a Trip Count Field Switch to the Fields tab of the Define Database dialog box. Enter Trips as the Field Name for the new field, choose Summary from the Type pop-up menu, and click Create.

Create a Trip Count Field

Create a Trip Count Field On the Options for Summary Field “Trips” dialog box, select Count of as the summary statistic and select Destination in the Available Fields list as the field to summarize. Click OK and then OK again to dismiss the dialog boxes. The new field and its label are placed in the Body part.

Create a Trip Count Field

Create a Trip Count Field Create a Trip Count Field-select the Trips label and field. Drag them into position in the trailing Subsummary (as shown below). To remove the extra space at the bottom of the Body part, drag the bottom of the Body part up as high as it will go.

Create a Trip Count Field

Create a Trip Count Field For the label and field, set a distance from the right edge of 6.972 inches and distance from top of 1.528 inches. (Align the field’s right edge with the right edge of the Business Purpose field. Align the top of the Trips label and field with the top of the Destination Total label.)

Create a Trip Count Field Now we need to format the Trips field and label. Select the Destination Total text string, click the Format Painter icon on the Standard toolbar, and click the Trips label. Now select the MilesSum field (beside the Destination Total text string), click the Format Painter icon on the Standard toolbar, and click the Trips field.

Create a Trip Count Field

Create a Trip Count Field Reduce the width of the Trips field by dragging one of its left-hand handles to the right. (The field only needs to be wide enough to show three digits.) Finally, Create a Trip Count Field-drag the Trips label to the right to close up the gap.

Create a Trip Count Field Save the Layout by choosing Layouts > Save Layout. Or you can switch to another mode (such as Preview) and save changes when prompted to do so.

Create a Trip Count Field

The completed layout (Layout mode).

Create a Trip Count Field

The completed layout (Preview mode).

Extra Bits

  • Replacing a field rather than deleting the original and dragging a new field onto the layout has the advantage of retaining the original field’s formatting.

  • When setting the width of the Destination field, the object is to give it sufficient space so that long destinations aren’t truncated.

  • The Trips field could actually be a count of almost any field in the Body part of the layout, such as Business Purpose or End Mileage.

  • For the Destination Report to display properly, you’ll have to sort the data. Choose Records > Sort Records, and sort on Destination and Start Mileage.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.1.195