Create Summary and Formula Columns

Building an Invoice Report 33-7

33.5 Prepare the Layout

The layout for an invoice report is created by importing an image of the invoice form, then creating desired fields and frames on top of the image. First, you need to set up your layout with the invoice form. To prepare the invoice report layout: 1. Click the Paper Layout button in the toolbar to display the Paper Layout view.

2. In the Paper Layout view, choose Insert Image, and browse to select the

provided file invdemo.tif. Position the image at the top left corner of the Paper Layout view. 3. Double-click the new image object to display the Property Inspector.

4. In the Property Inspector, under Advanced Layout, set the Print Object On

property to All Pages.

5. In the Object Navigator, expand the Paper Layout node, double-click the

properties icon next to Main Section to display the Property Inspector, and set the following properties: ■ Under Section, set the Width property to 11 and the Height property to 8.5 for landscape paper orientation to fit the invoice image. 6. In the Paper Layout view, click the Repeating Frame tool in the tool palette, then drag a repeating frame around the invoice image so that the image falls just inside the repeating frame. The repeating frame that you create should cover the image. 7. Double-click the repeating frame to display the Property Inspector, and set the following properties: ■ Under General Information, set the Name property to R_ORDER. ■ Under Repeating Frame, set the Source property to G_ORDER, the Print Direction property to Down, and the Maximum Records per Page property to 1. 8. Click the Frame tool in the tool palette, then create a frame just inside the borders of the R_ORDER repeating frame. 9. Double-click the frame object to display the Property Inspector, and set the following properties: ■ Under General Information, set the Name property to M_INVOICE. ■ Under Advanced Layout, set the Print Object On property to All Pages. 10. Click the repeating frame, then click the Fill Color tool in the tool palette and choose No Fill. Do the same for the frame. You should now see the invoice image, even though it is still layered behind the frame and repeating frame.

33.6 Insert Invoice Information

You are now ready to create fields on the invoice image to retrieve desired information for the invoice report. When you print the report, the field values will be correctly positioned on the invoice form. As you complete the steps below, use the figure below as a guide you can also open the provided example report invoice.rdf in Reports Builder. 33-8 Oracle Reports Users Guide to Building Reports Figure 33–4 Invoice report layout To insert the information for the invoice report:

1. In the Paper Layout view, click the Text tool in the tool palette, then create a

boilerplate text object on top of the invoice image, in the area labeled Terms. In the boilerplate text object, type 30 days.

2. Click the Field tool in the tool palette, and create fields on top of the invoice image,

in the following areas: ■ Bill To one field for each element of the name and address: Set Name property to F_FIRST_NAME, Source property to CUST_FIRST_ NAME. Set Name property to F_LAST_NAME, Source property to CUST_LAST_ NAME. Set Name property to F_STREET, Source property to C_STREET_ADDRESS. Set Name property to F_CITY, Source property to C_CITY. Set Name property to F_STATE, Source property to C_STATE_PROVINCE. Set Name property to F_POSTAL, Source property to C_POSTAL_CODE. ■ Ship To one field for each element of the name and address: Set Name property to F_FIRST_NAME1, Source property to CUST_FIRST_ NAME. Set Name property to F_LAST_NAME1, Source property to CUST_LAST_ NAME. Set Name property to F_STREET1, Source property to C_STREET_ADDRESS. Set Name property to F_CITY1, Source property to C_CITY. Set Name property to F_STATE1, Source property to C_STATE_PROVINCE. Building an Invoice Report 33-9 Set Name property to F_POSTAL1, Source property to C_POSTAL_CODE. ■ Date : Set Name property to F_TODAY, Source property to Current Date, and Format Mask property to MMDDRR. ■ Page : Set Name property to F_PAGE, Source property to Page Number, and Page Numbering property in the Page Numbering dialog box to Reset at: R_ ORDER. ■ Purchase Order Number : Set Name property to F_ORDER_NO, Source property to ORDER_ID. ■ Sales Order Number : Set Name property to F_ORDER_NO1, Source property to ORDER_ID. ■ Customer Number : Set Name property to F_CUST_NO, Source property to CUSTOMER_ID. ■ Due Date : Set Name property to F_DUE_DAY, Source property to CF_DUE_ DATE. ■ Salesperson 2 fields, one for first name, one for last name: Set Name property to F_SALES_REP_FNAME, Source property to CUST_ FIRST_NAME. Set Name property to F_SALES_REP_LNAME, Source property to CUST_ LAST_NAME. ■ Customer Contact : 2 fields, one for first name, one for last name: Set Name property to F_SALES_REP_FNAME1, Source property to CUST_ FIRST_NAME. Set Name property to F_SALES_REP_LNAME1, Source property to CUST_ LAST_NAME. ■ Ship Date : Set Name property to F_TODAY1, Source property to Current Date, and Format Mask property to MMDDRR. ■ Item No. : Set Name property to F_ITEM_NO, Source property to LINE_ ITEM_ID. With the field selected, click the Align Right button in the toolbar. ■ Description column has no heading: Set Name property to F_ITEM_DESC, Source property to TRANSLATED_DESCRIPTION. ■ Quantity Ordered : Set Name property to F_QUANTITY, Source property to QUANTITY. With the field selected, click the Align Right button in the toolbar. ■ Unit Price : Set Name property to F_UNIT_PRICE, Source property to UNIT_ PRICE, and Format Mask property to NNN,NN0.00. With the field selected, click the Align Right button in the toolbar. ■ Extended Amount : Set Name property to F_ITEM_PRICE, Source property to O_QUANTITY_O_UNIT_PRICE, and Format Mask property to NNN,NN0.00. With the field selected, click the Align Right button in the toolbar. Note: This example assumes that the customer contact is same person as the sales representative.