Oracle® Fusion Middleware Oracle Reports User's Guide to Building Reports 11g Release 1 (11.1.1) B32122-01 |
|
![]() Previous |
![]() Next |
When you create a report, you can either use the Report Wizard to assist you or create the report yourself. To build the form letter report in this example, you can use the Report Wizard. Using the wizard enables you to define the layout for the report, as well as set the data definition.
In the Report Wizard, on the Text page, you will be able to set up your form letter report exactly the way you want it to appear. On this page of the wizard, you can set up your boilerplate text (for example, the body of the letter), and use the fields from your data tables to fill in the variable data (for example, the addressee's name).
To create a form letter report:
Launch Reports Builder (or, if already open, choose File > New > Report)
In the Welcome or New Report dialog box, select Use the Report Wizard, then click OK.
If the Welcome page displays, click Next.
On the Report Type page, select Create Paper Layout Only, then click Next.
On the Style page, type a Title for your report, select Form Letter, then click Next.
On the Data Source page, click SQL Query, then click Next.
On the Data page, enter the following SELECT
statement in the Data Source definition field:
SELECT ALL EMPLOYEES.LAST_NAME, EMPLOYEES.FIRST_NAME, JOBS.JOB_ID, EMPLOYEES.EMPLOYEE_ID, JOBS.JOB_TITLE FROM EMPLOYEES, JOBS WHERE (EMPLOYEES.JOB_ID = JOBS.JOB_ID) ORDER BY EMPLOYEES.EMPLOYEE_ID
Note: You can enter this query in any of the following ways:
|
Click Next.
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 7.1, "Prerequisites for This Example" describes the sample schema requirements for this example. |
On the Text page, format the letter the way you want it to appear. The steps that follow will show you how to make your form letter report look like this:
Employee: &<FIRST_NAME> &<LAST_NAME>
Emp. #: &<EMPLOYEE_ID>
Dear &<FIRST_NAME> &<LAST_NAME>:
The Human Resources department is updating its records of the company's employees. Currently, our records show your employee number as &<EMPLOYEE_ID>, and that you hold the position of &<JOB_TITLE>. If any of this information is incorrect, please contact the Human Resources department.
Thank you,
Human Resources
In the Form Letter Text box, type Employee:
.
Click Space four times to enter four spaces.
In the Available Fields list, click FIRST_NAME, then click the right arrow (>) to move this field to the Form Letter Text field.
In the Available Fields list, click LAST_NAME, then click the right arrow (>).
Click New Line.
In the Form Letter Text field, type Emp. #:
.
Click Space four times to enter four spaces.
In the Available Fields list, click EMPLOYEE_ID, then click the right arrow (>).
Click New Line twice.
In the Form Letter Text field, type Dear
.
Click Space.
In the Available Fields list, click FIRST_NAME, then click the right arrow (>).
In the Available Fields list, click LAST_NAME, then click the right arrow (>).
In the Form Letter Text field, type a colon (:
) next to LAST_NAME, then click New Line twice.
Type the body of the letter. For the field names, use the Available Fields list to select the appropriate name, then click the right arrow (>) to insert it into the Form Letter Text field. The result should look like this:
The Human Resources department is updating its records of the company's employees. Currently, our records show your employee number as &<EMPLOYEE_ID>, and that you hold the position of &<JOB_TITLE>. If any of this information is incorrect, please contact the Human Resources department.
Thank you,
Human Resources
Click Next.
On the Template page, select Predefined Template and click Beige, then click Finish to display your report output in the Paper Design view. It should look something like this:
Figure 7-2 Paper Design view for the form letter report
Save the report as formletterreport_
your_initials
.rdf
.