32.3 Create the Layout for Your Report

The steps in this section will show you how to create a layout that displays the objects in the desired locations on your preprinted form. You will start by adjusting the margin of your report, then creating the mailing label portion that will print at the top of each page that shows the address information for the customer. You will then create the body of the report, which contains the order information that display the date, order number, description, number, price per item, and total price.

32.3.1 Set up your report layout

Before you can start adding layout objects, you will need to adjust the margin of your layout.

To set up the layout:

  1. Click the Paper Layout button in the toolbar to display the Paper Layout view of your report.

  2. To make it easier for you to manipulate your layout objects, expand the size of the Paper Layout window.

  3. Click the Edit Margin button in the toolbar to view the margin portion of the layout.

  4. Using the resize handles, adjust the size of the margin (the solid black bar) to the dimensions of your form. In our example, our form is 8.5 inches by 11 inches (21.6 centimeters by 27.9 centimeters), so we will expand the margin to 8.5 inches (21.6 centimeters) across, and 11 inches (27.9 centimeters) down.

    Tip:

    You can use the corner resize handles to adjust the size of your margin.
  5. Click the Edit Margin button in the toolbar again to return to the body of the layout.

    Now, you are ready to create your report layout.

32.3.2 Create an address label for your form

In this section, you will use the Report Block Wizard to create a mailing label for the address section of your preprinted form.

To create an address label:

  1. In the Paper Layout view, click the Report Block tool in the tool palette.

  2. Using the rulers along the edges of the Paper Layout view, drag a rectangle starting at 1 inch (2.5 centimeters) from the left and 0.25 inches (0.5 centimeters) from the top, to 6 inches (15 centimeters) from the left and 1.25 inches (3 centimeters) from the top. Release your mouse button to display the Report Block Wizard.

  3. On the Style page of the Report Block Wizard, select Mailing Label, then click Next.

  4. On the Groups page, click G_CUSTOMER and click Down in the Available Groups list to specify the Print Direction and move this group to the Displayed Groups list, then click Next.

  5. In the Mailing Label Text field, create a mailing label by clicking the appropriate columns and buttons (for example, click EMPLOYEE_NAME in the Available Fields list, then click > and New Line, and so on), so that the Mailing Label Text field looks like this:

    &<EMPLOYEE_NAME> 
    &<CUSTOMER_NAME>
    &<C_STREET_ADDRESS> 
    &<C_CITY>, &<C_STATE_PROVINCE> &<C_POSTAL_CODE>
    

    Note:

    For more information on building a mailing label report, see Chapter 6, "Building a Mailing Label Report".
  6. Click Next.

  7. On the Template page, select No template, then click Finish to display your report layout in the Paper Layout view. It should look something like this:

    Figure 32-6 Paper Layout view of the initial layout

    Description of Figure 32-6 follows
    Description of "Figure 32-6 Paper Layout view of the initial layout"

  8. The region that you just created is a boilerplate object called B_TBP. While this object is selected, view the Object Navigator and notice the new boilerplate object:

    Figure 32-7 Report Block boilerplate object in the Object Navigator

    Description of Figure 32-7 follows
    Description of "Figure 32-7 Report Block boilerplate object in the Object Navigator"

  9. While the object is selected, choose Tools > Property Inspector to display the Property Inspector (or right-click the object and choose Property Inspector).

  10. In the Property Inspector, under General Layout, set the Horizontal Elasticity property to Variable. This ensures that appropriate space is available for the mailing label text.

  11. Save your report.

32.3.3 Add the order item details to your report

In this section, you will add a report block that displays the order items and details that correspond to the customer identified in each mailing label. These items and details are required for your preprinted form.

To add order item details to your report:

  1. In the Object Navigator, click the repeating frame R_G_CUSTOMER that surrounds the boilerplate object B_TBP created in Section 32.3.2, "Create an address label for your form".

  2. In the Paper Layout view, with R_G_CUSTOMER selected, use the corner resize handles to adjust the size of the repeating frame to the size of your preprinted form (in our example, 8.5 inches (21.6 centimeters) across and 11 inches (27.9 centimeters) down). Make sure the frame does not extend beyond the single page boundary.

  3. Click the Report Block tool in the tool palette.

  4. Using the rulers as guides, drag a region 0.25 inches (0.5 centimeters) from the left and 1.5 inches (4 centimeters) from the top, to 8.25 inches (21 centimeters) from the left and 2 inches (5 centimeters) from the top. Release your mouse button to display the Report Block Wizard.

  5. On the Style page of the Report Block Wizard, select Group Left, then click Next.

  6. On the Groups page, click the following groups and click Down in the Available Groups list to specify the Print Direction and move them to the Displayed Groups list, then click Next:

    • G_ORDER_DATE

    • G_ORDER_ITEMS

  7. On the Fields page, click the following fields in the Available Fields list and click the right arrow (>) to move them to the Displayed Fields list, then click Next:

    • ORDER_DATE

    • PRODUCT_ID

    • PRODUCT_DESCRIPTION

    • QUANTITY

    • UNIT_PRICE

    • ITEM_TOTAL

  8. On the Labels page, remove the label names since they are not required for the preprinted form, and adjust the widths as follows, then click Next:

    Fields and Totals Labels Width
    ORDER_DATE <none> 9
    PRODUCT_ID <none> 8
    PRODUCT_DESCRIPTION <none> 40
    QUANTITY <none> 4
    UNIT_PRICE <none> 8
    ITEM_TOTAL <none> 10

    Note:

    The Width values are based on the space available on the preprinted form.
  9. On the Template page, select No Template, then click Finish to display your report layout in the Paper Layout view. It should look something like this:

    Figure 32-8 Paper Layout view of the preprinted form example with mailing label and order item details

    Description of Figure 32-8 follows
    Description of "Figure 32-8 Paper Layout view of the preprinted form example with mailing label and order item details"

  10. Save your report.

32.3.4 Adjust the layout and add summaries

Now that you have added the elements you want displayed on your report, you need to set up the layout so that only records required for the preprinted form display on each page, and that the correct amount of information displays in the available amount of space on the form. Also, the form requires that a summary of each page displays in the same location on the page.

To adjust the layout and add page summaries:

  1. In the Object Navigator, click M_G_ORDER_ITEMS_GRPFR, as shown in the following image:

    Figure 32-9 Selected frame in the Object Navigator

    Description of Figure 32-9 follows
    Description of "Figure 32-9 Selected frame in the Object Navigator"

  2. In the Paper Layout view, you should see the same object selected, as shown in the following image:

    Figure 32-10 Selected repeating frame in the Paper Layout view

    Description of Figure 32-10 follows
    Description of "Figure 32-10 Selected repeating frame in the Paper Layout view"

  3. In the Object Navigator, double-click the properties icon next to M_G_ORDER_ITEMS_GRPFR to display the Property Inspector, and set the following properties:

    • Under General Layout, set the Vertical Elasticity property to Fixed to ensure that only this area is available for the order items to display.

  4. In the Object Navigator, double-click the properties icon next to R_G_CUSTOMER to display the Property Inspector, and set the following properties:

    • Under Repeating Frame, set the Maximum Records per Page property to 1, to ensure that only one customer's information prints per page.

  5. In the Object Navigator, double-click the view icon next to the Paper Layout node to display the Paper Layout view.

  6. In the Paper Layout view, click the Field tool in the tool palette.

  7. Draw a region 7 inches (18 centimeters) from the left and 10.25 inches (26 centimeters) from the top, to 8 inches (20 centimeters) from the left and 10.5 inches (27 centimeters) from the top.

    Note:

    This field, as well as the second field you will create, should not be located within the repeating frame called M_G_ORDER_DATE_GRPFR. If you cannot fit these fields on the page, resize the repeating frame so that you can place the fields below the repeating frame, but still on the same page.
  8. Double-click the new field object (F_1) to display the Property Inspector, and set the following properties:

  9. Following the steps above, create another field directly below F_PAGE_TOTAL in the Paper Layout view, then set its Name property to F_ORDER_TOTAL and Source property to CS_ORDER_TOTAL.

  10. The new layout objects should now look like this:

    Figure 32-11 F_PAGE_TOTAL and F_ORDER_TOTAL fields in the Paper Layout view

    Description of Figure 32-11 follows
    Description of "Figure 32-11 F_PAGE_TOTAL and F_ORDER_TOTAL fields in the Paper Layout view"

  11. Save your report.