Prerequisites for This Example Use the Report Wizard to Create a Mailing Label Report

Building a Mailing Label Report 6-3

10. Click the LOCATIONS table, then click Include.

11. Click Close.

The three tables display in the Query Builder.

12. In the EMPLOYEES table, select the check boxes next to the following column

names: ■ FIRST NAME ■ LAST NAME ■ EMPLOYEE ID 13. In the LOCATIONS table, select the check boxes next to the following column names: ■ STREET ADDRESS ■ POSTAL CODE ■ CITY ■ STATE PROVINCE ■ LOCATION ID 14. Click OK. 15. In the Data Source definition field, your query should look something like this: SELECT ALL EMPLOYEES.EMPLOYEE_ID, EMPLOYEES.FIRST_NAME, EMPLOYEES.LAST_NAME, LOCATIONS.STREET_ADDRESS, LOCATIONS.POSTAL_CODE, LOCATIONS.CITY, LOCATIONS.STATE_PROVINCE, LOCATIONS.LOCATION_ID FROM EMPLOYEES, DEPARTMENTS, LOCATIONS WHERE EMPLOYEES.DEPARTMENT_ID = DEPARTMENTS.DEPARTMENT_ID AND DEPARTMENTS.MANAGER_ID = EMPLOYEES.EMPLOYEE_ID AND DEPARTMENTS.LOCATION_ID = LOCATIONS.LOCATION_ID

16. Click Next.

17. On the Text page, format the way you want the mailing labels to display. Steps 21 through 30 will show you how to display your labels in the following format: Note: You can enter this query in any of the following ways: ■ Copy and paste the code from the provided text file called mailinglabel_code.txt into the Data Source definition field. ■ Click Query Builder to build the query without entering any code manually, as described in the steps above. ■ Type the code in the Data Source definition field. Note: If you are not already connected to a database, you will be prompted to connect to the database when you click Query Builder or Next. Ensure that you connect to a database that has the appropriate schema for this example. Section 6.1, Prerequisites for This Example describes the sample schema requirements for this example. 6-4 Oracle Reports Users Guide to Building Reports John Smith 55 Main Street Springfield, ME 00000

18. In the Available Fields list, click FIRST_NAME, then click the right arrow to

move this field to the Mailing Label list. 19. In the Available Fields list, click LAST_NAME, then click the right arrow . 20. Click New Line. 21. In the Available Fields list, click STREET_ADDRESS, then click the right arrow .

22. Click New Line.

23. In the Available Fields list, click CITY, then click the right arrow .

24. Press Backspace on your keyboard to remove the extra space.

25. Click Comma.

26. In the Available Fields list, click STATE_PROVINCE, then click the right arrow

. 27. In the Available Fields list, click POSTAL_CODE, then click the right arrow . The code in the Mailing Label Text box should look like this if necessary, add spaces as shown: FIRST_NAME LAST_NAME STREET_ADDRESS CITY, STATE_PROVINCE POSTAL_CODE

28. Click Next.

29. On the Template page, select No Template and click Finish to display your report

output in the Paper Design view. It should look something like this: Figure 6–2 Paper Design view for the mailing label report 30. Save your report as mailinglabel_your_initials.rdf.

6.3 Add Vertical Spacing

In this section, you will use the Vertical Spacing property to add space between each record in your mailing label report. You can adjust this spacing according to the size of the mailing labels where the records will be printed. Tip: For more information on formatting your mailing labels, click Help on this page of the Report Wizard. Building a Mailing Label Report 6-5 To add vertical spacing:

1. In the Object Navigator, under your report name, expand the Paper Layout node.

2. Under Paper Layout, expand the Main Section node.

3. Under Body, find the repeating frame called R_G_FIRST_NAME.

4. Double-click the repeating frame icon next to the R_G_FIRST_NAME node to

display the Property Inspector. 5. Under Repeating Frame, next to Vert. Spacing Between Frames, type 0.25. 6. Press Enter to add your changes. 7. In the toolbar, click Run Paper Layout to display your report in the Paper Design view. Your report should look something like this: Figure 6–3 Final mailing label report with vertical spacing

6.4 Summary

Congratulations You have successfully created a mailing label paper report. You now know how to: ■ define a mailing label report using the Report Wizard. ■ adjust the vertical spacing between labels. For more information on any of the wizards, views, or properties used in this example, refer to the Oracle Reports online Help, which is available in Oracle Reports Builder or hosted on the Oracle Technology Network OTN, as described in Section 4.1.1, Using the Oracle Reports online Help .