31.6 Create a Check Stub With Payment Information and Order Details

When you create a check printing report, you will sometimes want to create a check "stub" that contains the payment information on the check, as well as the details of the order. The steps in this section will show you how to create a check stub that contains the payee, amount, date, check number, and other payment information.

You will then use the information retrieved by the second query in your data model to print a simple tabular report on the check stub that displays the order information associated with the check.

31.6.1 Create a check stub in the Paper Design view

The steps in this section will show you how to use the tools in the Paper Design view to create a check stub for your check report. You will rearrange the fields you created in the previous section so that every time you run the report, a corresponding check stub will display for every check.

You will also create guidelines in the Paper Design view to help you align the check stub information with the data in the check report.

To create a check stub:

  1. Click the Flex Off button in the toolbar.

  2. Click in the left, vertical ruler and drag your mouse to the right, so that the line is flush with the text "Pay Exactly."

  3. When you release your mouse button, you will notice that a guideline displays, like the one in the following image:

    Figure 31-21 Partial Paper Design view of the check report with horizontal guideline

    Description of Figure 31-21 follows
    Description of ''Figure 31-21 Partial Paper Design view of the check report with horizontal guideline''

    Note:

    The guideline is a broken black line spanning across this image, to the right of "Pay Exactly."
  4. Click the Order No. boilerplate object (located in the upper left-hand corner of the check) and position it along the new guideline, and below the check image at 3.25 inches (8.5 centimeters), like this:

    Figure 31-22 Partial Paper Design view of the check with Order No. boilerplate text

    Description of Figure 31-22 follows
    Description of ''Figure 31-22 Partial Paper Design view of the check with Order No. boilerplate text''

  5. Create another vertical guideline that is aligned next to the first one.

  6. Click the F_ORDER_ID field (in the above image, it is the field with "2354") and position it next to the Order No. field, like this:

    Figure 31-23 Order No. and F_ORDER_ID fields in the Paper Design view

    Description of Figure 31-23 follows
    Description of ''Figure 31-23 Order No. and F_ORDER_ID fields in the Paper Design view''

    Note:

    You can always select your fields in the Object Navigator, under Paper Layout > Main Section > Body, and these fields will appear selected in the Paper Design view.
  7. Now, click the Order Date boilerplate text and position it directly below "Order No.", like this:

    Figure 31-24 Order Date field in the Paper Design view

    Description of Figure 31-24 follows
    Description of ''Figure 31-24 Order Date field in the Paper Design view''

  8. Click F_ORDER_DATE1 (the copy you made of the F_ORDER_DATE field), which you can locate using the Object Navigator, and position the field next to the Order Date boilerplate text, like this:

    Figure 31-25 F_ORDER_DATE1 field next to Order Date text

    Description of Figure 31-25 follows
    Description of ''Figure 31-25 F_ORDER_DATE1 field next to Order Date text''

  9. Position the Order Total boilerplate text directly below the Order Date boilerplate text.

  10. Position the F_ORDER_TOTAL1 field next to the Order Total boilerplate text.

  11. Position the Check No. boilerplate text directly below the Order Total boilerplate text.

  12. Position F_CHECK_NO1 next to the Check No. boilerplate text.

    The check stub should now look like this:

    Figure 31-26 Partial check stub in Paper Design view

    Description of Figure 31-26 follows
    Description of ''Figure 31-26 Partial check stub in Paper Design view''

  13. Create another pair of vertical guidelines that are aligned with the box containing the date, amount, and check number. The guidelines should appear here:

    Figure 31-27 Second vertical guideline in the Paper Design view

    Description of Figure 31-27 follows
    Description of ''Figure 31-27 Second vertical guideline in the Paper Design view''

    Note:

    To create this guideline, click in the left-hand ruler, then drag your mouse until the line is aligned to the left of box containing Date, Check No., and Amount.
  14. Click the Customer boilerplate text, and position it so that it is vertically aligned with the second guideline, and horizontally aligned with the Order No. text (at 3.25 inches (8.5 centimeters)), like this:

    Figure 31-28 Customer field in the Paper Design view

    Description of Figure 31-28 follows
    Description of ''Figure 31-28 Customer field in the Paper Design view''

  15. Position the F_CUSTOMER_NAME1 field next to the Customer boilerplate text so that these layout objects look like this:

    Figure 31-29 Customer and F_CUSTOMER_NAME1 fields

    Description of Figure 31-29 follows
    Description of ''Figure 31-29 Customer and F_CUSTOMER_NAME1 fields''

    Tip:

    If you have difficulty fitting the F_CUSTOMER_NAME1 field into the provided space, you may need to resize the field. To do so, select the field, then drag the right middle resize handle to the left, making sure that there is still enough space for the customer name (Harrison Sutherland).
  16. Position the F_C_STREET_ADDRESS field directly below F_CUSTOMER_NAME1.

  17. Position F_C_CITY directly below F_C_STREET_ADDRESS.

  18. Position the F_C_STATE_PROVINCE field next to F_C_CITY.

  19. Position the F_C_POSTAL_CODE field next to F_C_STATE_PROVINCE.

  20. Position the F_C_COUNTRY_ID field next to F_C_POSTAL_CODE.

  21. Position the F_CUSTOMER_ID field directly below the F_C_CITY field.

  22. Position the Customer No. boilerplate text (B_CUSTOMER_ID) directly to the left of the F_CUSTOMER_ID field, so that this portion of the check stub should now look like this:

    Figure 31-30 Partial check stub in the Paper Design view

    Description of Figure 31-30 follows
    Description of ''Figure 31-30 Partial check stub in the Paper Design view''

  23. Now, let us format the information you have just added. Select the following boilerplate text objects in the check stub:

    • Order No.

    • Order Date

    • Order Total

    • Check No.

    • Customer

    • Customer No.

  24. Change the font to Bold, then right-align the text.

  25. Click F_ORDER_TOTAL1, then click the Currency button and the Commas button in the toolbar.

  26. Click the Add Decimals button in the toolbar twice.

    Your check stub should now look like this:

    Figure 31-31 Formatted check stub

    Description of Figure 31-31 follows
    Description of ''Figure 31-31 Formatted check stub''

  27. Save your report.

31.6.2 Add order details to the check stub

In the previous section, you created a check stub that displays the payment information, that is a copy of the information on the check itself. The steps in this section will show you how to add the details of the order to the check stub by creating a simple tabular report. You will use the Report Block Wizard to create the simple tabular report, then format the data in the Paper Design view.

To add order details:

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

  2. Drag a rectangular area for the new layout to display the Report Block Wizard.

  3. In the Report Block Wizard, on the Style page, select Tabular, then click Next.

  4. On the Groups page, click G_LINE_ITEM_ID 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. On the Fields page, click each of the following fields in the Available Fields list, then click the right arrow (>) to move them to the Displayed Fields list, then click Next:

    • LINE_ITEM_ID

    • PRODUCT_ID

    • PRODUCT_NAME

    • UNIT_PRICE

    • QUANTITY

  6. On the Labels page, change the labels and field widths as follows, then click Next:

    Fields Labels Width
    LINE_ITEM_ID Line 2
    PRODUCT_ID Product ID 4
    PRODUCT_NAME Product Name 40
    UNIT_PRICE Unit Price 4
    QUANTITY Quantity 4

  7. On the Template page, select No template, then click Finish to display your report layout in the Paper Layout view, with the new fields and layout objects displaying below the original layout objects.

  8. In the Paper Layout view, make sure the new fields and layout objects are located within the R_G_ORDER_ID repeating frame, and that all the layout objects fit on a single page (within 8.75 inches (22 centimeters)).

  9. Click the Paper Design button in the toolbar to run and display your report in the Paper Design view. It should look something like this:

    Figure 31-32 Check printing report with non-formatted order details

    Description of Figure 31-32 follows
    Description of ''Figure 31-32 Check printing report with non-formatted order details''

    Since the new report block is not formatted, let us format the data to look like the rest of the report.

  10. Shift-click the following new labels, then click the Bold button in the toolbar and change the font to Arial, 10 point:

    • Line

    • Product ID

    • Product Name

    • Unit Price

    • Quantity

  11. Click the data under Line (F_LINE_ITEM_ID), then click the Align Center button in the toolbar.

  12. Click the data under Unit Price (F_UNIT_PRICE), then click the Align Right button in the toolbar.

  13. While the data is still selected, click the Currency button, Commas button, then click the Add Decimal button twice in the toolbar.

  14. Click the right resize handle and align the right edge of the data field with the Unit Price label.

  15. Click the data under Quantity (F_QUANTITY), then click the Align Right button in the toolbar, then resize the field so that the right edge of the data field is aligned with the Quantity label.

  16. Save your report.

    Your report should now look like this:

    Figure 31-33 Final check report with spelled-out cash amounts and stub

    Description of Figure 31-33 follows
    Description of ''Figure 31-33 Final check report with spelled-out cash amounts and stub''

    Note:

    You can also compare your results with the example report we have provided, called spellcash.rdf.