PK a3wEoa,mimetypeapplication/epub+zipPKa3wEiTunesMetadata.plistn artistName Oracle Corporation book-info cover-image-hash 43663930 cover-image-path OEBPS/dcommon/oracle-logo.jpg package-file-hash 374517295 publisher-unique-id B32122-03 unique-id 826449864 genre Oracle Documentation itemName Oracle® Fusion Middleware Oracle Reports User's Guide to Building Reports, 11g Release 1 (11.1.1) releaseDate 2013-07-12T03:33:54Z year 2013 PK; snPKa3wEMETA-INF/container.xml PKYuPKa3wEOEBPS/orbr_grpl_multi003.htm Create a Data Model with a Data Link

11.3 Create a Data Model with a Data Link

When you create a report with multiple queries, it is typically easier to create all of the queries with the Data Wizard first and then create the layouts with the Report Wizard.

To create the queries:

  1. In the Data Model view, choose Insert > Query to display the Data Wizard.

  2. If the Welcome page displays, click Next.

  3. On the Query page, type Q_Salesrep for the Query name and click Next.

  4. On the Data Source page, click SQL Query, then click Next.

  5. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT ENAME, EMPNO
    FROM EMP
    WHERE JOB = 'SALESMAN'
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called grp_above_code.txt into the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field.


  6. 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 11.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  7. On the Groups page, click Next.

  8. Click Finish to display the data model for your report in the Data Model view.

  9. Repeat the steps above for a second query, but this time name your query

    Q_Product and use the following SELECT statement:

    SELECT REPID, PRODNAME, AMOUNT, CUSTNAME
    FROM SALES
    ORDER BY REPID, CUSTNAME
    

Figure 11-2 Two-query data model without a link

Description of Figure 11-2 follows

To add the data link

  1. In the Data Model view, click the Data Link tool in the tool palette.

  2. Click and drag from the EMPNO column in the G_ENAME group to the REPID column in the G_REPID group. Notice that a line is drawn from the bottom of the G_ENAME group to the Q_Product query. Labels for EMPNO and REPID are created at each end of the line to indicate they are the columns linking G_ENAME to Q_Product.

    Figure 11-3 Two-query data model with a data link

    Description of Figure 11-3 follows

  3. Double-click the new data link line to display the Property Inspector and examine the property settings:

    • G_ENAME is identified as the parent, while Q_Product is listed as the child. In terms of the data, the sales rep's name and employee number make up the master record and should print once for the associated product information retrieved by the Q_Product query.

    • Notice that WHERE already appears in the SQL Clause property. WHERE is the default clause used in master/detail relationships. You can replace WHERE with other SQL clauses such as HAVING and START WITH, but for this report the default is correct.

    • The other point to notice is that an equal sign (=) appears in the Condition property. An equality (that is, table1.columnname = table2.columnname) is the default condition for master/detail relationships defined through a data link. You can replace the equal sign with any other supported conditional operator (to see what is supported, click the field), but for this report the default is the proper condition.

    Linking the group G_ENAME and the query Q_Product through the EMPNO and REPID columns is analogous to writing both queries as the single-query shown below:

    SELECT ENAME, EMPNO, REPID,
    PRODNAME, AMOUNT, CUSTNAME
    FROM EMP, SALES
    WHERE JOB = 'SALESMAN'
    AND EMPNO = REPID (+)
    ORDER BY REPID, CUSTNAME
    
PKp&"PKa3wEOEBPS/orbr_rank005.htmR Create a Parameter Form

34.5 Create a Parameter Form

By default, both of your user parameters appear in the Runtime Parameter Form. In reality, you only want users to set CUTOFF_CNT. You do not want them to be able to set INCR_CNT (the amount by which your counter is increased for each record). To prevent users from seeing INCR_CNT on the Runtime Parameter Form, you will build your own Parameter Form.

To create a Parameter Form:

  1. Choose Tools > Parameter Form Builder.

  2. In the Parameter Form Builder dialog box, scroll down the list of parameters until you find INCR_CNT.

  3. Click INCR_CNT to deselect it.

  4. Change the label for CUTOFF_CNT to:

    # of Top Customers:

  5. Click OK.

  6. Click the Run Paper Layout button in the toolbar.

  7. In the Runtime Parameter Form, type a value for # of Top Customers, then click the Run Report button in the toolbar. You should now see as many records as you asked for in the Runtime Parameter Form and they should be in order from largest total purchases to smallest total purchases.


    Tip:

    As an additional exercise, you could now change the Initial Value property of CUTOFF_CNT to see its effect on the Runtime Parameter Form.


  8. Save your report.

PK|}W R PKa3wEOEBPS/orbr_spellcash007.htm\ Summary

31.7 Summary

Congratulations! You have successfully built a report with spelled-out cash amounts on the check, as well as the payment and order details on the check stub. You now know how to:

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".

PKs]Ka \ PKa3wEOEBPS/orbr_dist002.htm Set Up an Existing Report for Bursting

37.2 Set Up an Existing Report for Bursting

For the purposes of this chapter, we have provided an RDF file you can use for bursting. In this section, you will set up the report for bursting by deleting the repeating frame and setting the Repeat On property of the Main section, so that the data bursts on each warehouse ID. This way, you can distribute the data for each warehouse as a report to the corresponding warehouse e-mail ID.


Note:

For more information on the Repeat On property, refer the Oracle Reports online Help.


To set up the report for bursting:

  1. In Reports Builder, choose File > Open.

  2. Navigate to the directory where your examples source files are located, and open the file inventory_report_dist.rdf.

    The report displays in the Object Navigator.

  3. In the Object Navigator, under the report name, double-click the view icon next to the Paper Layout node to display the Paper Layout view.

  4. In the Paper Layout view, select the outermost repeating frame (R_G_WAREHOUSE_ID), then delete it.

    Figure 37-1 Deleting the repeating frame

    Description of Figure 37-1 follows


    See Also:

    For more information on frames and repeating frames, refer the Oracle Reports online Help.


  5. In the Object Navigator, right-click the Main Section node, then choose Property Inspector to display the Property Inspector for the Main Section:

    • Under Section, set the Repeat On property to G_WAREHOUSE_ID.

  6. Save the report as inventoryreport_dist_your_initials.rdf.

    You have set up your report to burst based on the warehouse ID.

PKPHePKa3wEOEBPS/orbr_wrapped007.htm Summary

15.7 Summary

Congratulations! You have successfully created a wrapped field paper report. You now know how to:

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".

PKqaPKa3wEOEBPS/orbr_plsql007.htmM Summary

40.7 Summary

Congratulations! You have successfully built a report that uses an external PL/SQL library to calculate employee bonuses, which you can now use in other reports by simply referring to it. You now know how to:

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".

PKORMPKa3wEOEBPS/orbr_concepts1.htmp Basic Concepts

1 Basic Concepts

This chapter introduces the fundamental concepts of the 11g Release 1 (11.1.1) component of Oracle Reports. Each topic in this chapter is also included in the Basic Concepts section of the Oracle Reports online Help (see Section 4.1.1, "Using the Oracle Reports online Help").

Topics are grouped into the following sections:

PK@#%u p PKa3wEOEBPS/orbr_maillab003.htm Add Vertical Spacing

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.

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

Description of Figure 6-3 follows

PK$'#  PKa3wEOEBPS/orbr_barcode004.htmP Summary

43.4 Summary

Congratulations! You have created a paper report and a JSP-based Web report that use the barcode JavaBean to generate barcode images.

You now know how to:

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".

PKY{U P PKa3wEOEBPS/orbr_utf8.htmq Building a Report with Multibyte Characters for PDF Output

38 Building a Report with Multibyte Characters for PDF Output

In this chapter, you will learn about reports that include multibyte characters. By following the steps in this chapter, you can generate the PDF report output shown in Figure 38-1 and Figure 38-2.

Figure 38-1 Output of the multibyte character set UTF8 report in Japanese

Description of Figure 38-1 follows

Figure 38-2 Output of the same multibyte character set UTF8 report in Polish

Description of Figure 38-2 follows

Concepts


Note:

For more information, see the chapter "Using PDF in Oracle Reports" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.


Example Scenario

In this example, you have an international business with offices in the United States, Japan, and Poland. In the organization, local managers have control of the inventory of the warehouses. Offices in different locations want to print the list of products in their preferred language. You will create a report in PDF format that contains multibyte characters for the Web and paper output.

As you build this example report, you will:

To see a sample multibyte character set report, open the examples folder named multibyte, then open the Oracle Reports example named multibyte_utf8.rdf. For details on how to open it, see "Accessing the Example Reports" in the Preface.

PKTSvqPKa3wEOEBPS/orbr_cndfrm001.htm7 Prerequisites for This Example

23.1 Prerequisites for This Example

To build the example in this chapter, you must have access to the SCOTT sample schema provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

PK0<7PKa3wEOEBPS/orbr_concepts1012.htm3 Oracle Reports Components

1.12 Oracle Reports Components

The Oracle Reports components are:

Table 1-4 Oracle reports Component Descriptions

ComponentDescription

rwbuilder

Starts Oracle Reports Builder.

rwrun

Runs a report using the Oracle Reports Services in-process server.

rwclient

Parses and transfers a command line to the specified Reports Server.

rwserver

Invokes the Reports Server (through Oracle Enterprise Manager).

rwservlet

Translates and delivers information between either a Web server or a Java EE Container (for example, Oracle WebLogic Server) and the Reports Server, enabling you to run a report dynamically from your Web browser.

rwconverter

Converts one or more report definitions or PL/SQL libraries from one storage format to another.


All components listed in Table 1-4, except rwclient and rwserver, can be run from the command line. See the Reference > Command Line section of the Oracle Reports online Help for detailed information about the components and command line keywords. Refer to Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services for information about managing and monitoring Reports Server, Reports Tools and Oracle Reports Bridge through Oracle Enterprise Manager or OPMN commands.

See also

Section 4.7.2, "Running a report from the command line"

Section 4.7.3, "Running a report using a command file"

PKe83PKa3wEOEBPS/orbr_timeseries001.htmU Prerequisites for This Example

28.1 Prerequisites for This Example

To build the example in this chapter, you must have access to the Summit Sporting Goods (SUMMIT) schema. To download the SQL scripts that install the schema, see "Accessing the Data Sources" in the Preface.

PK*cZUPKa3wEOEBPS/orbr_across001.htmG Prerequisites for This Example

12.1 Prerequisites for This Example

To build the example in this chapter, you must have access to the Human Resources sample schema (HR) provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

PK;HULGPKa3wEOEBPS/orbr_fotoc004.htmO Summary

35.4 Summary

Congratulations! You have successfully created a report with a table of contents and an index. You now know how to:

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".

PKJT O PKa3wEOEBPS/orbr_dist005.htmI Summary

37.5 Summary

Congratulations! You have distributed a report. You now know how to:

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".

PKPKa3wEOEBPS/orbr_timeseries004.htmQ Summary

28.4 Summary

Congratulations! You have successfully created a time series calculations report for both paper and Web. You now know how to:

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".

PK³PKa3wEOEBPS/orbr_preprint004.htm6 Format Your Report in the Paper Design View

32.4 Format Your Report in the Paper Design View

The steps in this section will show you how to preview your report in the Paper Design view, and make a few last-minute tweaks using the tools in the Paper Design view. It is sometimes easier to use the Paper Design view to finish your report, since you can see actual data displayed.

To format your report in the Paper Design view:

  1. Click the Paper Design button in the toolbar to display the Paper Design view.

  2. In the Paper Design view, click the field F_PRODUCT_DESCRIPTION.


    Tip:

    If you cannot find this field, you can use the Object Navigator to find the field name and click it. When you select an item in the Object Navigator, the corresponding object is selected in the Paper Design view.


  3. Increase the size of this field as much as possible, given the size of the area on your form.

  4. Shift-click to select the four numbered fields, then click the Align Right button in the toolbar.

  5. At the bottom of the page, Shift-click the two fields (F_PAGE_TOTAL and F_ORDER_TOTAL), then click the Line Color tool in the tool palette and choose No Line.

  6. Shift-click the three currency number fields on the right.

  7. Click the Currency button in the toolbar to add a dollar sign to the amounts.

  8. Click the Commas button to add a comma to values over 999.

  9. Click the Add Decimal Place button twice to add two decimal places to the values.

  10. In the Object Navigator, Shift-click the following three objects:

    • B_TBP

    • F_ORDER_TOTAL

    • F_PAGE_TOTAL

  11. Choose Tools > Property Inspector to display the Property Inspector, and set the following properties:

    • Under Advanced Layout, set the Print Object On property to All Pages, and set the Base Printing On property to Enclosing Object.

  12. In the Paper Design view, adjust the sizes of the fields according to the measurements on your preprinted form.

    Your report should now look like this:

    Figure 32-12 Final preview of your preprinted form report

    Description of Figure 32-12 follows


    Note:

    To see a more complete view of the report, you can open the sample report we have provided, called preprint.rdf. To view the report, open the report and click the Run Paper Layout button in the toolbar.


  13. When you print your report on to the form, it might look something like this:

    Figure 32-13 Final report printed on a sample preprinted form

    Description of Figure 32-13 follows


    Note:

    The Paper Design view of your report will not look like the image above. We printed our report on a sample preprinted form. The above image is a snapshot of that form.


  14. Save your report.

PKqr;6PKa3wEOEBPS/orbr_multoc.htmq$ Building a Paper Report with a Multilevel Table of Contents

36 Building a Paper Report with a Multilevel Table of Contents

In this chapter, you will learn about reports that include a multilevel table of contents.


Note:

Generating a table of contents is not supported for matrix reports.


By following the steps in this chapter, you can generate the report output shown in Figure 36-1 and Figure 36-2.

Figure 36-1 Multilevel table of contents

Description of Figure 36-1 follows

Figure 36-2 Main category with sub-category sample page in the report

Description of Figure 36-2 follows

Concepts

For more information on the SRW built-in package in Oracle Reports, refer to the Oracle Reports online Help.

Example Scenario

In this example, you have a large paper catalog that lists all the clothing products a company sells. This catalog simply lists all the items in a simple report. Since the product line has become much larger, the catalog report now exceeds 700 pages. You will create a multilevel table of contents that sorts the clothing by department (for example, Boys, Girls), then lists each item under each category.

As you build this example report, you will:

To see a sample report with a multilevel table of contents, open the examples folder named multileveltoc, then open multilevel_toc.rdf. For details on how to open it, see "Accessing the Example Reports" in the Preface. The example files used in this chapter are listed and described in Table 36-1.

Table 36-1 Example report files

FileDescription

multileveltoc\multilevel_source.rdf

The source file that contains a basic paper layout and data model for your report.

multileveltoc\multilevel_toc.rdf

The final RDF version of the report with a multilevel table of contents.

multileveltoc\multilevel_code.txt

The various SQL statements you will use in this report.


PK䨵v$q$PKa3wEOEBPS/orbr_refcur008.htme Move the SELECT Statements Into Packages

41.8 Move the SELECT Statements Into Packages

In your current report configuration, the SELECT statements used by the REF CURSOR queries reside within the report itself. In many cases, it is advantageous to have SELECT statements reside in the packages that define the REF CURSOR types. Then, you can simply reference the packages, rather than typing the same SELECT statement directly into every report that uses it. If you need to change the SELECT statement (for example, to modify or add clauses), you simply update it once in the package, rather than in every report that uses it.

The steps in this section will help you to move the SELECT statements to the packages that define the REF CURSOR types.

To move SELECT statements into a package:

  1. In the Object Navigator, click the Program Units node for your report.

  2. Click the Create button in the toolbar to display the New Program Unit dialog box.

  3. In the New Program Unit dialog box, type cont_cv in the Name field.

  4. Select Package Body, and click OK to display the PL/SQL Editor for the new program unit.

  5. In the PL/SQL Editor, use the template to enter the following PL/SQL code:

    PACKAGE BODY cont_cv IS
         function query_container (p_department_id number) 
         return container_refcur is tempcv_container cont_cv.container_
         refcur;
    begin
      open tempcv_container for
      select employee_id,
      start_date,
      end_date,
      job_id,
      department_id
      from job_history
      where  :department_id=department_id;
      return tempcv_container;
    end;                                  
    END;
    

    Note:

    You can open the provided file refcursor_code.txt to copy and paste the code into Reports Builder.


  6. Click Compile.

  7. If any compilation errors occur, check the code for syntax errors and recompile as needed.

  8. Click Close.

  9. Now that the function is defined, you must add it to the package spec so that it can be referenced. Other program units will know about the function in the package body only if it is described in the package spec.

  10. In the Object Navigator, double-click the CONT_CV (Package Spec) object to display the PL/SQL Editor.

  11. In the PL/SQL Editor, type the following line above the END; statement:

    function query_container (p_department_id number) return container_refcur;
    
  12. Click Close.

  13. Choose Program > Compile > All.

  14. Click OK when done.

  15. In the Object Navigator, under the Program Units node, double-click Q_CONTAINERREFCURDS to display the PL/SQL Editor.

  16. In the PL/SQL Editor, edit the code to look as follows:

    function Q_containerRefCurDS return cont_cv.container_refcur is
        temp_container cont_cv.container_refcur;
    begin
         temp_container:=cont_cv.query_container (:department_id);
           return temp_container;
    end;
    

    When you are done, all of the query's logic will reside in the function named query_container. From now on, when you change query_container, you will change this and any other queries that reference it.


    Note:

    You can open the provided file refcursor_code.txt to copy and paste the code into Reports Builder.


  17. Click Compile.

  18. If any compilation errors occur, check the code for syntax errors and recompile as needed.

  19. Click Close.

  20. Click the Paper Design button in the toolbar to view the report in the Paper Design view.

  21. Save the report as ref_67_your_initials.rdf.

Optional Exercise:

Repeat the above steps for the other two queries in the report.

PKPKa3wEOEBPS/orbr_wrapped005.htm ] Modify the Layout of the Report

15.5 Modify the Layout of the Report

In this section, you will change the field to expand vertically if the contents of the break field are longer than the specified width. As you can see in Figure 15-6, the width of the fields are fixed, but the names are incomplete. You will also add space to display between each record in the report.

To modify the layout:

  1. In the Object Navigator, double-click the repeating frame icon next to the R_G_NAME node under Paper Layout > Main Section > Body > M_G_Name_GRPFR, to display the Property Inspector.

  2. Under Repeating Frame, change the Vert. Space Between Frames to 0.25, then press Enter.

  3. Close the Property Inspector.

  4. In the Object Navigator, under the Paper Layout node, navigate to Main Section > Body > M_G_NAME_GRPFR > R_G_NAME.

  5. Double-click the icon next to the F_CUST_LAST_NAME field to display the Property Inspector.

  6. Under General Layout, make sure the Vertical Elasticity property is set to Expand, then close the Property Inspector to accept your changes.

  7. Follow steps 5 and 6 for the F_CUST_FIRST_NAME field.

You have now modified the layout of your report to display all the text in the wrapped fields, and added space between the records.

PK PKa3wEOEBPS/orbr_barcode.htm-? Building a Report with a Barcode

43 Building a Report with a Barcode

In this chapter, you will learn about reports that include a barcode. By following the steps in this chapter, you can generate the report output shown in Figure 43-1.

Figure 43-1 Barcode JavaBean Web report output

Description of Figure 43-1 follows

Concepts

Example Scenario

In this example, you will build two reports, one for paper and one for the Web. The paper report shows an invoice for a single customer who has ordered multiple items from a company. The barcode indicates the tracking information for the order.

As you build these example reports, you will:

To see a sample paper report with a barcode, open the examples folder named barcodebeanpaper, then open result\shipping_manifest.pdf. To see a sample Web-based JSP report with a barcode, open the examples folder named barcodebeanweb, then open result\shipping_manifest_web.jsp. For details on how to open these reports, see "Accessing the Example Reports" in the Preface. The example files used in this chapter are listed and described in Table 43-1.

Table 43-1 Example report files

FileDescription

barcodebeanpaper\result\
shipping_manifest.pdf

The final PDF version of the paper report, containing the barcode.

barcodebeanpaper\result\
shipping_manifest.rdf

The final RDF version of the paper report, containing the barcode.

barcodebeanpaper\scripts\
oraclebarcode.jar

The barcode JavaBean.

barcodebeanpaper\scripts\
barcode_code.txt

All the code used in this chapter, so you can copy and paste the code from this file instead of typing it manually.

barcodebeanpaper\source\
shipping_manifest.rdf

The source file for the sample paper report. Running this RDF in Reports Builder will display the final result of your paper report in the Paper Design view.

barcodebeanweb\result\
shipping_manifest_web.jsp

The final JSP version of the Web report, containing the barcode.

barcodebeanweb\result\
shipping_manifest_web.rdf

The final RDF version of the Web report, containing the barcode.

barcodebeanweb\result\
assets

The images that Oracle Reports generated when the JSP was run.

barcodebeanweb\scripts\
sql.txt

The SQL for the query you need to enter.

barcodebeanweb\scripts\
barcode_code.txt

All the code used in this chapter, so you can copy and paste the code from this file instsead of typing it manually.

barcodebeanweb\source\
shipping_label.html

The HTML page that you will use as a basis for the Web report.

barcodebeanweb\source\
shipping_manifest_web.rdf

The source file for the sample Web report. Running this RDF in Reports Builder to the Web will display the final result of your Web report in your browser.

barcodebeanweb\source\
assets\*

The images and other files that your JSP-based Web report will require to display properly on the Web.

barcodebeanweb\source\
assets\blaf_beige_logo.gif

The image you will use in your JSP-based Web report.


PK 2--PKa3wEOEBPS/orbr_rank006.htm1 Add a Percentage Ranking

34.6 Add a Percentage Ranking

Another way to rank customers is by percentage of total sales. The idea is the same as ranking by count, but with an important difference. Since you need to fetch all of the data in order to compute a running percent of total summary, you don't want to use a group filter to weed out data. You need to use a format trigger on the repeating frame to compare the running total to your cutoff parameter.

To fetch the data for the percentage calculation:

  1. In the Object Navigator, double-click the view icon next to the Data Model node.

  2. In the Data Model view that displays, click the SQL Query tool in the tool palette then click in an open area of the Data Model view, somewhere to the right of query Q_1, to display the SQL Query Statement dialog box.

  3. In the SQL Query Statement field, enter the following SELECT statement:

    SELECT CUSTNAME CNAME2, SUM(AMOUNT) SUM_AMT2 
    FROM SALES
    GROUP BY CUSTNAME
    ORDER BY SUM(AMOUNT) DESC
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called rank_code.txt (SELECT statement for Percentage Calculation) into the SQL Query Statement field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the SQL Query Statement field.


  4. Click OK. Your data model should now look like the following image.

    Figure 34-5 Data Model view of the Ranking Report

    Description of Figure 34-5 follows

  5. Save your report.

To create a parameter for the percentage cutoff:

  1. In the Object Navigator, under the Data Model node, click the User Parameters node.

  2. Choose Edit > Create to create a new user parameter under the User Parameters node.

  3. If the Property Inspector is not already displayed, right-click the new user parameter (P_1), then choose Property Inspector to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to CUTOFF_PCT.

    • Under Parameter, set the Datatype property to Number, set the Width property to 2, and set the Initial Value property to 75.

  4. In the Data Model view, click the group object G_CNAME2, then click and drag the bottom handle down about 0.25 inches (0.5 centimeters) to make the group bigger.

  5. Click the Summary Column tool in the tool palette.

  6. Click in the empty space beneath SUM_AMT2 to create a summary column.

  7. Double-click the new summary column object (CS_1) to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to R_PCT.

    • Under Column, set the Datatype property to Number, and set the Width property to 10.

    • Under Summary, set the Function property to % of Total, set the Source property to SUM_AMT2, set the Reset At property to Report, and set the Compute At property to Report.

To create a second layout for the list of customers by percentage:

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

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

  3. Starting about 1 inch (2.5 centimeters) below the existing layout, click and drag a box about the same size as the existing layout to define the size of the second layout and display the Report Block Wizard.

  4. On the Style page of the Report Block Wizard, select Tabular, then click Next.

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

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

    • CNAME2

    • SUM_AMT2

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

    FieldsLabelsWidth

    CNAME2

    Customer Name

    35

    SUM_AMT2

    Total Purchases

    15


  8. On the Template page, select No template. (If you were to select a template, it would override the template of the previous layout), then click Finish to display your report layout in the Paper Layout view.

  9. From the font lists in the toolbar, choose Arial (Western), point size 10.

  10. In the Paper Layout view, click the Text tool in the tool palette.

  11. Click directly above the label Customer Name in the new layout and type the following text in the new boilerplate text object:

    Top &CUTOFF_PCT Percent of Sales:
  12. Move to an open area of the Paper Layout view and click the mouse button to exit text mode. Notice that the text object you just created is still selected, you can now adjust its positioning with the arrow keys.

  13. If the text is not already bold, click the Bold button in the toolbar to make it bold.

  14. Shift-click the labels Customer Name and Total Purchases so that they are selected simultaneously with the object you just created.

  15. Click the Underline button in the toolbar.

  16. Click in an open area of the Paper Layout view to deselect everything.

  17. Double-click field F_SUM_AMT2 to display the Property Inspector, and set the following properties:

    • Under Field, set the Format Mask property by typing:

      -$NNN,NN0.00
      

To add the logic for the percentage cutoff:

  1. In the Object Navigator, type R_G_CNAME2 in the Find field to locate that repeating frame.

  2. Double-click the properties icon next to R_G_CNAME2 to display the Property Inspector, and set the following properties:

    • Under Advanced Layout, double-click the Format Trigger property field to display the PL/SQL Editor.

  3. In the PL/SQL Editor, use the template to enter the following PL/SQL code:

    function R_G_CNAME2FormatTrigger return boolean is
    begin
    if :r_pct <= :cutoff_pct then 
       return(TRUE);
    else
       return(FALSE);
    end if;
    end;
    

    Note:

    You can enter this code by copying and pasting it from the provided text file called rank_code.txt. This code is for the Percentage Cutoff.


To update the Parameter Form for the new percentage parameter:

  1. Choose Tools > Parameter Form Builder.

  2. In the Parameter Form Builder dialog box, scroll down the list of parameters until you find CUTOFF_PCT, and change its label to:

    Top Percentage (%):

  3. Click OK.

  4. Click the Run Paper Layout button in the toolbar.

  5. In the Runtime Parameter Form:

    • For # of Top Customers, type 5.

    • For Top Percentage (%), type 80.

  6. Click the Run Report button in the toolbar.

Figure 34-6 Tabular report output restricted by number and percentage of customers

Description of Figure 34-6 follows

PK(11PKa3wEOEBPS/orbr_rank.htmh Building a Ranking Report

34 Building a Ranking Report

In this chapter, you will learn about reports that rank data in different way. By following the steps in this chapter, you can generate the report output shown in Figure 34-1.

Figure 34-1 Tabular report output, ranked by number and percentage of customers

Description of Figure 34-1 follows

Concepts

You can create a report that ranks data by comparing it to a user-specified bind parameter. This enables you to rank data in different ways in the same report; for example, by count and by percentage. You can set the ranking criteria at runtime, or let them default to previously specified values.

Data Relationships

This report requires one query to fetch the data. To rank the data, you'll create the following objects:

Layout

This report uses a tabular layout style, with some modifications.

Example Scenario

In this example, you will create a report that displays the names and total purchases of your top three customers and the top 75% of all customers. Furthermore, you will allow end users of your report to set the ranking criteria (that is, the top x customers and the top y% of all customers) at runtime.

As you build this example report, you will:

To see a sample ranking report, open the examples folder named ranking, then open the Oracle Reports example named rank.rdf. For details on how to access it, see "Accessing the Example Reports" in the Preface.

PKլcmhPKa3wEOEBPS/orbr_across002.htmb Create Two Queries

12.2 Create Two Queries

When you create a report, you can either use the Report Wizard to assist you or create the report yourself. In this example, you will use the Data Model view to create your two queries, then use the tool palette to create a data link between the two queries to relate the data tables.

To create two queries:

  1. Launch Reports Builder (or, if already open, choose File > New > Report)

  2. In the Welcome or New Report dialog box, select Build a new report manually, then click OK.

  3. In the Data Model view that displays, click the SQL Query tool in the tool palette then click in an open area of the Data Model view to display the SQL Query Statement dialog box.

  4. In the SQL Query Statement field, enter the following SELECT statement:

    SELECT ALL DEPARTMENTS.DEPARTMENT_ID, DEPARTMENTS.DEPARTMENT_NAME, 
    DEPARTMENTS.MANAGER_ID, DEPARTMENTS.LOCATION_ID
    FROM DEPARTMENTS 
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called acrossbreak_code.txt into the SQL Query Statement field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the SQL Query Statement field.


  5. Click OK.

    The data model for your new query displays:

    Figure 12-2 Data Model for Query 1

    Description of Figure 12-2 follows

  6. Create another query, this time using the following code:

    SELECT ALL EMPLOYEES.LAST_NAME, EMPLOYEES.FIRST_NAME, EMPLOYEES.DEPARTMENT_ID
    FROM EMPLOYEES 
    ORDER BY EMPLOYEES.LAST_NAME
    

    Note:

    You can also copy and paste the code from the text file provided in the acrossbreak folder, called acrossbreak_code.txt.


  7. Click OK.

  8. In the Data Model view, click the Data Link tool in the tool palette.

  9. Click and drag your mouse from DEPARTMENT_ID column in Q_1, to DEPARTMENT_ID1 in Q_2 to create a data link between the two queries.

    Your data model should now look like this:

    Figure 12-3 Data Model of the two linked queries

    Description of Figure 12-3 follows


    Note:

    You can right-click the data link, then choose Property Inspector from the pop-up menu to ensure that the data link was created properly.


PKF2TPKa3wEOEBPS/orbr_icons001.htmf Main Toolbar

A.1 Main Toolbar

The main toolbar is located at the top of the Oracle Reports Builder window, directly beneath the menu bar, as shown in Figure A-1:

Figure A-1 Main toolbar

Description of Figure A-1 follows

The name and purpose of each button is as follows:

IconDescription
New button

New button. Displays the New Report dialog box.

Open button

Open button. Displays the Open dialog box.

Save button

Save button. Saves the report. If you have not saved the report before, the Save As dialog box displays.

Print button

Print button. Prints the paper report.

Mail button

Mail button. Displays the Mail dialog box.

Connect button

Connect button. Displays the Connect dialog box.

Cut button

Cut button. Deletes the currently selected item and temporarily places it in the clipboard. Use Paste to paste the selected item.

Copy button

Copy button. Temporarily places a copy of the selected item in the clipboard. Click the Paste button to paste the selected item.

Paste button

Paste button. Pastes the item in the clipboard in current location of the cursor.

Undo button

Undo button. Undoes the last action performed.

Redo button

Redo button. Performs the last action again.

Run Web Layout button

Run Web Layout button. Runs the current report to your Web browser.

Run Paper Layout button

Run Paper Layout button. Runs the current report to the Paper Design view in Reports Builder.

Help button

Help button. Displays the Oracle Reports online Help.


PKG8PKa3wEOEBPS/orbr_md_sum.htm' Building a Group Left Summary Report

13 Building a Group Left Summary Report

In this chapter, you will learn about group left summary reports. By following the steps in this chapter, you can generate the report output shown in Figure 13-1.

Figure 13-1 Group left summary report output

Description of Figure 13-1 follows

Concepts

Data Relationships

Layout

Example Scenario

In this example, you will create a report that displays and summarizes sales data by customer. This report would include the following for each customer:

As you build this example report, you will:

To see a sample master/detail summary report, open the examples folder named masterdetailsummary, then open the Oracle Reports example called grp_above_summ.rdf. For details on how to access it, see "Accessing the Example Reports" in the Preface.

PK+ ,'PKa3wEOEBPS/orbr_nestedmatrix005.htm O Format Monetary Values

26.5 Format Monetary Values

To make your matrix report more readable, you should format the monetary values.

To format monetary values:

  1. On the first page of the report, click one of the cell values. Notice that all of the values are immediately selected, indicating that you can change their properties simultaneously.

  2. Click the Currency button in the toolbar. A currency symbol immediately appears next to all of the values.

  3. Click the Add Decimal Place button in the toolbar twice. Two decimal places are added to the right of the decimal point.

  4. Resize the fields. Click and drag the rightmost handle of the cell value under the SALESMAN label about 0.5 inches (1.5 centimeters) to the left. After you complete this operation, the department summaries from the second page should move onto the first page.

  5. Shift-click the SALESMAN label.

  6. Click the Align Right button in the toolbar.

  7. Click in an open area of the Paper Design view to deselect all of the objects.

    Figure 26-17 Nested matrix report output with formatted monetary values

    Description of Figure 26-17 follows

  8. Save your report as nested3_your_initials.rdf

PKoB PKa3wEOEBPS/orbr_refcur001.htm  Prerequisites for This Example

41.1 Prerequisites for This Example

To build the example in this chapter, you must have the example files provided, as well as access to the Human Resources sample schema (HR) provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.


Note:

The use of REF CURSOR queries in Oracle Reports 11g Release 1 (11.1.1) requires that your database version is 10.1.0.5 (for 10.1) or 10.2.0.2 (for 10.2) or higher.

Interoperability between a 11g Release 1 (11.1.1) database or Oracle Forms Services client and a 10.1/10.2 database requires a minimum patchset level of 10.1.0.5 (for 10.1) or 10.2.0.2 (for 10.2).

An attempt to reference a 10.1 or 10.2 PL/SQL unit or view under the following circumstances will fail with a PLS-801[55916] error unless the 10.1 or 10.2 environment has been patched to the right level:

  • A PL/SQL unit, anonymous block, trigger, call statement, or SQL statement on a 11g Release 1 (11.1.1) database invokes a PL/SQL unit on a 10.1 or 10.2 database across a database link.

  • A PL/SQL unit, anonymous block, trigger, or call statement on a 11g Release 1 (11.1.1) database references a view on a 10.1 or 10.2 database across a database link and the view directly or indirectly references a PL/SQL function or an object type.

  • An Oracle Forms Services 11g Release 1 (11.1.1) client invokes a PL/SQL unit in a 10.1 or 10.2 database using RPC.


PK: PKa3wEOEBPS/orbr_plsql004.htm $ Create the Report Layout Using the Report Block Wizard

40.4 Create the Report Layout Using the Report Block Wizard

Now that you have created the necessary formula columns and functions, you can create the layout for your report.

To create the 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 > Report Block.

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

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

  5. On the Fields page, click the double right arrows (>>) to move all of the fields to the Displayed Fields list. The Displayed Fields list should look like this:

    Figure 40-9 Displays Fields list

    Description of Figure 40-9 follows


    Note:

    If the fields do not display in the correct order, simply click the field name and drag the field to the correct position in the list.


  6. Click Next.

  7. On the Labels page, change the labels as follows, then click Next:

    FieldsLabels

    COMMISSION_PCT

    Commission

    TOTAL_COMP

    Total Compensation


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

    Figure 40-10 Paper Layout view of the PL/SQL example report

    Description of Figure 40-10 follows

  9. Click the Run Paper Layout button in the toolbar to run and display your report in the Paper Design view.

  10. In the Paper Design view, click the Flex Off button in the toolbar.

  11. Delete the Last Name label.

  12. Change the text for the First Name label to Name.

  13. Adjust the width of the new Name label to span over both the first name and last name columns.

  14. Adjust the sizes of the first name and last name columns so that one character displays between the columns.

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

    • Under General Layout, set the Vertical Elasticity property to Fixed, and set the Horizontal Elasticity property to Variable.

  16. Repeat the above step for the F_LAST_NAME field.

  17. Click the Paper Layout button in the toolbar to display the Paper Layout view.

  18. In the Paper Layout view, click the Frame tool in the tool palette.

  19. Draw a frame around the two fields: F_FIRST_NAME and F_LAST_NAME.

  20. With the frame selected, choose Tools > Property Inspector to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to M_NAME.

  21. In the Paper Layout view, make sure Flex Off is selected in the toolbar.

  22. With the frame selected, choose Layout > Move Backward until the frame encloses both the F_FIRST_NAME and F_LAST_NAME fields.


    Tip:

    You can watch the fields in the Object Navigator as you choose Layout > Move Backward. When you see the two fields are sub-nodes of M_NAME, stop.


    When you are done, the Object Navigator should look like this:

    Figure 40-11 Object Navigator with M_NAME repeating frame

    Description of Figure 40-11 follows

  23. Click the Paper Design button in the toolbar to display the report in the Paper Design view.

  24. In the Paper Design view, Shift-click the values under the following columns:

    • Salary

    • Commission

    • Bonus

    • Total Compensation

  25. Click the Currency button in the toolbar to add "$" to the numbers.

  26. Click the Add Decimal Place button twice to add two decimal points to the numbers.

  27. Shift-click the Salary, Commission, Bonus, and Total Compensation column headings to select them too.

  28. Click the Align Right button to right justify the columns.

    Your report should now look something like this:

    Figure 40-12 Paper Design view of modified report

    Description of Figure 40-12 follows

  29. Save your report.

PKW$ $PKa3wEOEBPS/orbr_paptoexcel003.htm  Modify the Web source of Your JSP Report

29.3 Modify the Web source of Your JSP Report

Now that you have created your paper report layout, you will learn how to take the same report and generate a JSP-based Web report that looks the same as your paper report.

To modify your JSP-based Web report:

  1. In the Report Editor, click the Web Source button in the toolbar to display the Web Source view.

    In the Web Source view, you need to change the dummy JSP code created by Oracle Reports Builder.

  2. In the Web Source view, find the text:

    <rw:dataArea id="yourDataArea">
       <!-- Report Wizard inserts the default jsp here -->
    </rw:dataArea>
    

    Tip:

    Choose Edit > Find and Replace, then type dataArea in the Find what text box.


  3. Ensure that you place the cursor in between the opening and closing <rw:dataArea> tags, and choose Insert > Frame. This inserts the following code in your Web Source view:

    <rw:include id="include" src="..."> </rw:include>
    

    Note:

    The rw:include tag enables you to include the outer frame of your paper layout in the Web Source view as JSP code. Adding a rw:include tag to the rw:dataArea tag enables you to include and reuse the existing paper layout in a Web layout.


  4. In the Object Navigator, locate the top level layout object frame of your paper layout. Specify its name in the src attribute of rw:include tag. The line should look like this:

    <rw:dataArea id="yourDataArea">
       <!-- Report Wizard inserts the default jsp here -->
    <rw:include id="mypaperreport_id" src="M_G_EMPLOYEE_ID_GRPFR">
    </rw:include>
    </rw:dataArea>
    
  5. Click the Run Web Layout button in the toolbar to display your new JSP-based Web report in your browser. The report should look something like this:

    Figure 29-3 Web Design Output

    Description of Figure 29-3 follows

    The report displays, in Web format, the employee data you specified. Here, you can see employee details, such as their name, email, hire date, salary, department to which they belong and their location.

  6. Save your report as myexcelreport_your_initials.jsp.

PK=pS% PKa3wEOEBPS/orbr_grpl_multi006.htm! Summary

11.6 Summary

Congratulations! You have successfully created the two-query, group report. You now know how to:

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".

PKPKa3wEOEBPS/orbr_utf8005.htmw Summary

38.5 Summary

Congratulations! You have successfully created a report to support any character set in your enterprise. You have used Oracle Reports Builder to generate a portable PDF file using font subsetting.

You now know how to:

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".

PK}|wPKa3wEOEBPS/orbr_md_sum003.htm( Create a Data Model with a Data Link

13.3 Create a Data Model with a Data Link

When you create a report with multiple queries, it is typically easier to create all of the queries with the Data Wizard first and then create the layouts with the Report Wizard.

To create the queries:

  1. In the Data Model view, choose Insert > Query to display the Data Wizard.

  2. If the Welcome page displays, click Next.

  3. On the Query page, type Q_Customer for the Query name, then click Next.

  4. On the Data Source page, select SQL Query, then click Next.

  5. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT CUSTID, NAME
    FROM CUSTOMER
    ORDER BY NAME
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called grp_above_summ_code.txt into the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field.


  6. 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 13.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  7. On the Groups page, click Next.

  8. Click Finish to display your first query in the Data Model view.

  9. Repeat the steps above for a second query, but this time name your query Q_Item and use the following SELECT statement:

    SELECT CUSTID, DESCRIP, ITEMTOT, ORDERDATE,
    ITEM.ORDID
    FROM ORD, PRODUCT, ITEM
    WHERE ITEM.ORDID = ORD.ORDID
    AND ITEM.PRODID = PRODUCT.PRODID
    ORDER BY CUSTID, DESCRIP, ORDERDATE
  10. On the Groups page of the Data Wizard:

    • Click CUSTID1 and click the right arrow (>) to move this field to the Group Fields list.

    • Do the same for DESCRIP.

    Figure 13-2 Groups page of the Data Wizard

    Description of Figure 13-2 follows

  11. Click Next.

  12. On the Totals page, click ITEMTOT and click Sum.

  13. Click Finish to display the data model for your report in the Data Model view. It should look something like this:

    Figure 13-3 Two-query data model with summaries

    Description of Figure 13-3 follows

To add the data link:

  1. In the Data Model view, click the Data Link tool in the tool palette.

  2. Click and drag from the CUSTID column in the G_CUSTID group to the CUSTID1 column in the G_CUSTID1 group. Notice that a line is drawn from the bottom of the G_CUSTID group to the Q_Item query. Labels for CUSTID and CUSTID1 are created at each end of the line to indicate they are the columns linking G_CUSTID to Q_Item.

    Figure 13-4 Two-query data model with a data link

    Description of Figure 13-4 follows

  3. Double-click the new data link line to display the Property Inspector and examine the property settings:

    • G_CUSTID is identified as the parent, while Q_Item is listed as the child. In terms of the data, the customer's identifier and name make up the master record and should print once for the associated item order information retrieved by the Q_Item query.

    • Notice that WHERE already appears in the SQL Clause property. WHERE is the default clause used in master/detail relationships. You can replace WHERE with other SQL clauses such as HAVING and START WITH, but for this report the default is correct.

    • The other point to notice is that an equal sign (=) appears in the Condition property. An equality (that is, table1.columnname = table2.columnname) is the default condition for master/detail relationships defined through a data link. You can replace the equal sign with any other supported conditional operator (to see what is supported, click the field), but for this report the default is the proper condition.

PK_^Z-(PKa3wEOEBPS/orbr_matrixgroup006.htm# Summary

27.6 Summary

Congratulations! You have successfully created a matrix group above report. You now know how to:

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".

PK?"hv(#PKa3wEOEBPS/dcommon/oracle.gifJGIF87aiyDT2F'G;Q_oKTC[ 3-Bq{ttsoGc4I)GvmLZ).1)!ꑈ53=Z]'yuLG*)g^!8C?-6(29K"Ĩ0Яl;U+K9^u2,@@ (\Ȱ Ë $P`lj 8x I$4H *(@͉0dа8tA  DсSP v"TUH PhP"Y1bxDǕ̧_=$I /& .)+ 60D)bB~=0#'& *D+l1MG CL1&+D`.1qVG ( "D2QL,p.;u. |r$p+5qBNl<TzB"\9e0u )@D,¹ 2@C~KU 'L6a9 /;<`P!D#Tal6XTYhn[p]݅ 7}B a&AƮe{EɲƮiEp#G}D#xTIzGFǂEc^q}) Y# (tۮNeGL*@/%UB:&k0{ &SdDnBQ^("@q #` @1B4i@ aNȅ@[\B >e007V[N(vpyFe Gb/&|aHZj@""~ӎ)t ? $ EQ.սJ$C,l]A `8A o B C?8cyA @Nz|`:`~7-G|yQ AqA6OzPbZ`>~#8=./edGA2nrBYR@ W h'j4p'!k 00 MT RNF6̙ m` (7%ꑀ;PKl-OJPKa3wEOEBPS/dcommon/oracle-logo.jpg^EJFIFC    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222'7" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( (QEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQE!KEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEzE7V%ȣOΏ9??:a"\fSrğjAsKJ:nOzO=}E1-I)3(QEQEQEQEQEQEQE֝Hza<["2"pO#f8M[RL(,?g93QSZ uy"lx4h`O!LŏʨXZvq& c՚]+: ǵ@+J]tQ]~[[eϸ (]6A&>ܫ~+כzmZ^(<57KsHf妬Ϧmnẁ&F!:-`b\/(tF*Bֳ ~V{WxxfCnMvF=;5_,6%S>}cQQjsOO5=)Ot [W9 /{^tyNg#ЄGsֿ1-4ooTZ?K Gc+oyڙoNuh^iSo5{\ܹ3Yos}$.nQ-~n,-zr~-|K4R"8a{]^;I<ȤL5"EԤP7_j>OoK;*U.at*K[fym3ii^#wcC'IIkIp$󿉵|CtĈpW¹l{9>⪦׺*ͯj.LfGߍԁw] |WW18>w.ӯ! VӃ :#1~ +މ=;5c__b@W@ +^]ևՃ7 n&g2I8Lw7uҭ$"&"b eZ":8)D'%{}5{; w]iu;_dLʳ4R-,2H6>½HLKܹR ~foZKZ࿷1[oZ7׫Z7R¢?«'y?A}C_iG5s_~^ J5?œ tp]X/c'r%eܺA|4ծ-Ե+ْe1M38Ǯ `|Kյ OVڅu;"d56, X5kYR<̭CiطXԮ];Oy)OcWj֩}=܅s۸QZ*<~%뺃ȶp f~Bðzb\ݳzW*y{=[ C/Ak oXCkt_s}{'y?AmCjޓ{ WRV7r. g~Q"7&͹+c<=,dJ1V߁=T)TR՜*N4 ^Bڥ%B+=@fE5ka}ędܤFH^i1k\Sgdk> ֤aOM\_\T)8靠㡮3ģR: jj,pk/K!t,=ϯZ6(((((((49 xn_kLk&f9sK`zx{{y8H 8b4>ÇНE|7v(z/]k7IxM}8!ycZRQ pKVr(RPEr?^}'ðh{x+ՀLW154cK@Ng C)rr9+c:׹b Жf*s^ fKS7^} *{zq_@8# pF~ [VPe(nw0MW=3#kȵz晨cy PpG#W:%drMh]3HH<\]ԁ|_W HHҡb}P>k {ZErxMX@8C&qskLۙOnO^sCk7ql2XCw5VG.S~H8=(s1~cV5z %v|U2QF=NoW]ո?<`~׮}=ӬfԵ,=;"~Iy7K#g{ñJ?5$y` zz@-~m7mG宝Gٱ>G&K#]؃y1$$t>wqjstX.b̐{Wej)Dxfc:8)=$y|L`xV8ߙ~E)HkwW$J0uʟk>6Sgp~;4֌W+חc"=|ř9bc5> *rg {~cj1rnI#G|8v4wĿhFb><^ pJLm[Dl1;Vx5IZ:1*p)إ1ZbAK(1ׅ|S&5{^ KG^5r>;X׻K^? s fk^8O/"J)3K]N)iL?5!ƾq:G_=X- i,vi2N3 |03Qas ! 7}kZU781M,->e;@Qz T(GK(ah(((((((Y[×j2F}o־oYYq $+]%$ v^rϭ`nax,ZEuWSܽ,g%~"MrsrY~Ҿ"Fت;8{ѰxYEfP^;WPwqbB:c?zp<7;SBfZ)dϛ; 7s^>}⍱x?Bix^#hf,*P9S{w[]GF?1Z_nG~]kk)9Sc5Ո<<6J-ϛ}xUi>ux#ţc'{ᛲq?Oo?x&mѱ'#^t)ϲbb0 F«kIVmVsv@}kҡ!ˍUTtxO̧]ORb|2yԵk܊{sPIc_?ħ:Ig)=Z~' "\M2VSSMyLsl⺿U~"C7\hz_ Rs$~? TAi<lO*>U}+'f>7_K N s8g1^CeКÿE ;{+Y\ O5|Y{/o+ LVcO;7Zx-Ek&dpzbӱ+TaB0gNy׭ 3^c T\$⫫?F33?t._Q~Nln:U/Ceb1-im WʸQM+VpafR3d׫é|Aү-q*I P7:y&]hX^Fbtpܩ?|Wu󭏤ʫxJ3ߴm"(uqA}j.+?S wV ~ [B&<^U?rϜ_OH\'.;|.%pw/ZZG'1j(#0UT` Wzw}>_*9m>󑓀F?EL3"zpubzΕ$+0܉&3zڶ+jyr1QE ( ( ( ( ( ( ( (UIdC0EZm+]Y6^![ ԯsmܶ捆?+me+ZE29)B[;я*wGxsK7;5w)}gH~.Ɣx?X\ߚ}A@tQ(:ͧ|Iq(CT?v[sKG+*רqҍck <#Ljα5݈`8cXP6T5i.K!xX*p&ќZǓϘ7 *oƽ:wlຈ:Q5yIEA/2*2jAҐe}k%K$N9R2?7ýKMV!{W9\PA+c4w` Wx=Ze\X{}yXI Ү!aOÎ{]Qx)#D@9E:*NJ}b|Z>_k7:d$z >&Vv󃏽WlR:RqJfGإd9Tm(ҝEtO}1O[xxEYt8,3v bFF )ǙrPNE8=O#V*Cc𹾾&l&cmCh<.P{ʦ&ۣY+Gxs~k5$> ӥPquŽўZt~Tl>Q.g> %k#ú:Kn'&{[yWQGqF}AЅ׮/}<;VYZa$wQg!$;_ $NKS}“_{MY|w7G!"\JtRy+贾d|o/;5jz_6fHwk<ѰJ#]kAȎ J =YNu%dxRwwbEQEQEQEQEQEQEQEQEQE'fLQZ(1F)hQ@X1KEQE-Q@ 1KE3h=iPb(((1GjZ(-ʹRPbR@ 1KE7`bڒyS0(-&)P+ ڎԴP11F)h&:LRmQ@Q@Š(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((_ğ<+F; sU%ԑ >,BH(uSU xþ1Wϲs${wgoQn_swB/'L\ܓFgԏZ ^dj^L^NmH Ҁ6(?nƓjh%ةlΣ /F6}pj2E3HgHЌ(UQR8oX,G8OB]>o9@$xWy'ڹOM=ҼWb"٠9-*r⬻zWokeh͝(F@n~X=q+⟇1b>ƑeIX.~C,o5የ-m;D Nʬ` `+CcE??Ki!R!cxw[ jvc}&Eٱ7T)8&þ/?os$wSn^bo:-4^js4JKm!#rv89>' O59t , \8r,Vk|IgxEv((RmĜ+bkz6,u/}-|.'<VÚ~tk,^cH61¢ !;M;Ėz[#CuAƶ+j_&*/;Q8d ǹHyAsM↷7l-6rò,%Fs;A*',}'f[]tݷs~UWhk?:4JE]WpcY=" ƚw/|_xSw(kycH#r28,X7D5Kh76 mɍ~0H;6194WpGӧգ%8Z&GdPƧo6kcO5Kv`{}fyq \`@?Kv=26OޝyAe Qɼ芍H8͟2敮j#;iѻm؏6+wTx;KYY\-%'Aӣ?|=\-ٴk+٬$ɷQr#RV?IgZk:kHꧽgoHv5"8`C #n݄R <¾1o~Ϛ^]\KghHIJ1 I< (ƺDŽ /~%xĨ v@$΢Fe.71@+()x7ÚN d_ePÕB nh#II }*eS᳐{Eeqmj m2|ɴ88@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@& ,^~]vw8ǽvQ@W;3K>}il -jk&- !;; o7<# 4k+m ZY~էvFJF(F獡\WQ@W yfnvyYu?g(a6<`˱YTo^qM↉76qlRܬq!F\q;,ީUoqJMˑ~6:0<B|E NΏ~Ͽo篷Z߁n_LuK[sms#Eu,F̧dJ(-_K'pýIBF"PC$m :YkjX/NO*# ߂+('|oX}Vlw7ŽrnF3W5#B mIܥ;` Hѻ(;yxLgO-O=E=WTp(*0u: tMGß4'V=w}v AaEx5/ew IDĜ9* Ѧ7~|:egO(jddYRr?h t^e|>t<ɠ&m6}O -!p>(^[˥SM CY}MdVpv ]k}wwg۞35b<Ŀ jѼOTtYdI.3H n$@u>/F[Go=!I+\@%qq%j]H)X\9䃌wO ռW4x䍃+si|]1M7Ef&7aH)P3g@'mxYc 7zd̨V~98z~7TdqnK&nIeC\]=OR)rǧZuBUd2~zOQ@?Ǘ) }Wmmģl_:̌+9*NGAdn;[W$Gj(>(kz2JM`(-ET) ;OqsYvGCӮ>-"}:~h$8_(;t_x)Mz4JI2NŤMI$pA/ Q?(ѷ~ [|/kpN3Š;oxg5zZ2QLQ*I'89@l$[MFf[cv`ITᗍ\yEq =xsGuww-ح!|H N~( ( ( ( ( ( ( ( ( ( ( ( (<nO_5Ox7]om$I,lf$tJǿ}_|O/4 $Vj.P,e N8:@:Moǚ(K-Jo Ӧpt/-wt?h}/Dz?vAy{jVt徛/ٮ-N35>md^*[+W|85i[u,I2۽v1Lgpr$,.ݧ[^}{>$ɸMG׳ Ƹk5a5ZգSl"|3|sZf =N>Hs13R3FNF8,2/|7µi}yMgvDr@o.Y0pT0p;x@;5N9#U%`gg=k_~/ѵ}6=wSIobiIqm( )%9/ӵᏂ.&畼9w^jP8ጉ q8^'g?zoݞWs8z^ _3CFSԮGH};ISt7 jVzZcRBEU Pn=r~QG2K9/uId;fICA8:tsXyº?4/ NĶZw%wj7GpRG,y}@,,xͦxxG_ם ZEp@gtB> O_5}/ß$A[u(HKE| 1gmĆn|/>w^YY*E( 2adn w~"vk1f/# Hc8<@^S{ķ6E9q2Θw V ܰP )1&Z^8Un+ 1 *^6?xBcJtId+瘤WIsQAC6OЇ↸Yԓ;azq4O;d9p'S?#y|yRX8lפ0^aɧ}=_K*ghUrC)#HokE͆iiqXy"CXI+ʑ9f|Koòxr3ݥW-ޠ~#*~"]n4 xvOئuKٳ#`!>'Ú_KM+SV5G(2GPY'vF⦕{O%ԒUմEu1TuAQ|FkZo+S`5bclJ^>g ]6Y>6 @U.{%@v+}_g'^ vE $`8 FO<5`_ /?hSyD! u힕k3Y*6z>C.RN(=_/6kQxXd=7lR8<Њܱ4GC[M13 P n0scb4(O@jhs2X".]q8xxdR@@'C@%k_t/ཱུl vêʜE<a|~ݻgwc@W P%-5s_+~LdlltrONٯ@gy} KN5I#;N4k#7\G9"原Xy?fA,֐MI]h(:;wgF|3ns89Xz>)ɠx\CyvlFU,rAf" +=omRKks<_'1sM^<9.^ф_bҤ.&%V2;7w$?]sHHlr3ބ6ߘNqI-Pt&8,dQ#JJ\l`x#?y|'Gj`󼈼?gg]fA5^LR\G9V` 1 `xvApXA6 I ZΞjlLm6szf+7]RRcKgdu^$W<[sM𶟤^-7HcZf|mPs!B|QŚ,ڴqkG p, `F+5^ֵM ٙw!_*ն&\ڂ*3cjn6PLj<xsKBxrM45+r4oWi1W?ЗO˸y~^x46;4C02I8>kz&=}'VE|ȷn*Ax4KJ_;WW’yBN h ifw^h-ȷ~b sҽxnV5"H"{6;lmܸX?|;ol.'Gv7}@/$:D|mCۿGZ'sXVtoA˗S>TAȣ[[ڶdݵB8U{[;?wp\yy2_22"1;_ճn۝}1zՈ|-[ڽV{muyf<>k1!r;b9_?=2K--cFIvWQ{mPj(k$eJ jy/$:Dx>}#ۻ jo|9Ai:7n*xg HPx"/]7mgXS1zPA'5C-/]EKYXc)⺊(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((PKb^^PKa3wEOEBPS/dcommon/cpyr.htmD Oracle Legal Notices

Oracle Legal Notices

Copyright Notice

Copyright © 1994-2014, Oracle and/or its affiliates. All rights reserved.

Trademark Notice

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

License Restrictions Warranty/Consequential Damages Disclaimer

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

Warranty Disclaimer

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

Restricted Rights Notice

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.

Hazardous Applications Notice

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Third-Party Content, Products, and Services Disclaimer

This software or hardware and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.

Alpha and Beta Draft Documentation Notice

If this document is in preproduction status:

This documentation is in preproduction status and is intended for demonstration and preliminary use only. It may not be specific to the hardware on which you are using the software. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to this documentation and will not be responsible for any loss, costs, or damages incurred due to the use of this documentation.

Oracle Logo

PK0hPKa3wEOEBPS/dcommon/blafdoc.cssc@charset "utf-8"; /* Copyright 2002, 2011, Oracle and/or its affiliates. All rights reserved. Author: Robert Crews Version: 2011.8.12 */ body { font-family: Tahoma, sans-serif; /* line-height: 125%; */ color: black; background-color: white; font-size: small; } * html body { /* http://www.info.com.ph/~etan/w3pantheon/style/modifiedsbmh.html */ font-size: x-small; /* for IE5.x/win */ f\ont-size: small; /* for other IE versions */ } h1 { font-size: 165%; font-weight: bold; border-bottom: 1px solid #ddd; width: 100%; text-align: left; } h2 { font-size: 152%; font-weight: bold; text-align: left; } h3 { font-size: 139%; font-weight: bold; text-align: left; } h4 { font-size: 126%; font-weight: bold; text-align: left; } h5 { font-size: 113%; font-weight: bold; display: inline; text-align: left; } h6 { font-size: 100%; font-weight: bold; font-style: italic; display: inline; text-align: left; } a:link { color: #039; background: inherit; } a:visited { color: #72007C; background: inherit; } a:hover { text-decoration: underline; } a img, img[usemap] { border-style: none; } code, pre, samp, tt { font-family: monospace; font-size: 110%; } caption { text-align: center; font-weight: bold; width: auto; } dt { font-weight: bold; } table { font-size: small; /* for ICEBrowser */ } td { vertical-align: top; } th { font-weight: bold; text-align: left; vertical-align: bottom; } li { text-align: left; } dd { text-align: left; } ol ol { list-style-type: lower-alpha; } ol ol ol { list-style-type: lower-roman; } td p:first-child, td pre:first-child { margin-top: 0px; margin-bottom: 0px; } table.table-border { border-collapse: collapse; border-top: 1px solid #ccc; border-left: 1px solid #ccc; } table.table-border th { padding: 0.5ex 0.25em; color: black; background-color: #f7f7ea; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; } table.table-border td { padding: 0.5ex 0.25em; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; } span.gui-object, span.gui-object-action { font-weight: bold; } span.gui-object-title { } p.horizontal-rule { width: 100%; border: solid #cc9; border-width: 0px 0px 1px 0px; margin-bottom: 4ex; } div.zz-skip-header { display: none; } td.zz-nav-header-cell { text-align: left; font-size: 95%; width: 99%; color: black; background: inherit; font-weight: normal; vertical-align: top; margin-top: 0ex; padding-top: 0ex; } a.zz-nav-header-link { font-size: 95%; } td.zz-nav-button-cell { white-space: nowrap; text-align: center; width: 1%; vertical-align: top; padding-left: 4px; padding-right: 4px; margin-top: 0ex; padding-top: 0ex; } a.zz-nav-button-link { font-size: 90%; } div.zz-nav-footer-menu { width: 100%; text-align: center; margin-top: 2ex; margin-bottom: 4ex; } p.zz-legal-notice, a.zz-legal-notice-link { font-size: 85%; /* display: none; */ /* Uncomment to hide legal notice */ } /*************************************/ /* Begin DARB Formats */ /*************************************/ .bold, .codeinlinebold, .syntaxinlinebold, .term, .glossterm, .seghead, .glossaryterm, .keyword, .msg, .msgexplankw, .msgactionkw, .notep1, .xreftitlebold { font-weight: bold; } .italic, .codeinlineitalic, .syntaxinlineitalic, .variable, .xreftitleitalic { font-style: italic; } .bolditalic, .codeinlineboldital, .syntaxinlineboldital, .titleinfigure, .titleinexample, .titleintable, .titleinequation, .xreftitleboldital { font-weight: bold; font-style: italic; } .itemizedlisttitle, .orderedlisttitle, .segmentedlisttitle, .variablelisttitle { font-weight: bold; } .bridgehead, .titleinrefsubsect3 { font-weight: bold; } .titleinrefsubsect { font-size: 126%; font-weight: bold; } .titleinrefsubsect2 { font-size: 113%; font-weight: bold; } .subhead1 { display: block; font-size: 139%; font-weight: bold; } .subhead2 { display: block; font-weight: bold; } .subhead3 { font-weight: bold; } .underline { text-decoration: underline; } .superscript { vertical-align: super; } .subscript { vertical-align: sub; } .listofeft { border: none; } .betadraft, .alphabetanotice, .revenuerecognitionnotice { color: #f00; background: inherit; } .betadraftsubtitle { text-align: center; font-weight: bold; color: #f00; background: inherit; } .comment { color: #080; background: inherit; font-weight: bold; } .copyrightlogo { text-align: center; font-size: 85%; } .tocsubheader { list-style-type: none; } table.icons td { padding-left: 6px; padding-right: 6px; } .l1ix dd, dd dl.l2ix, dd dl.l3ix { margin-top: 0ex; margin-bottom: 0ex; } div.infoboxnote, div.infoboxnotewarn, div.infoboxnotealso { margin-top: 4ex; margin-right: 10%; margin-left: 10%; margin-bottom: 4ex; padding: 0.25em; border-top: 1pt solid gray; border-bottom: 1pt solid gray; } p.notep1 { margin-top: 0px; margin-bottom: 0px; } .tahiti-highlight-example { background: #ff9; text-decoration: inherit; } .tahiti-highlight-search { background: #9cf; text-decoration: inherit; } .tahiti-sidebar-heading { font-size: 110%; margin-bottom: 0px; padding-bottom: 0px; } /*************************************/ /* End DARB Formats */ /*************************************/ @media all { /* * * { line-height: 120%; } */ dd { margin-bottom: 2ex; } dl:first-child { margin-top: 2ex; } } @media print { body { font-size: 11pt; padding: 0px !important; } a:link, a:visited { color: black; background: inherit; } code, pre, samp, tt { font-size: 10pt; } #nav, #search_this_book, #comment_form, #comment_announcement, #flipNav, .noprint { display: none !important; } body#left-nav-present { overflow: visible !important; } } PKr.hcPKa3wEOEBPS/dcommon/doccd_epub.jsM /* Copyright 2006, 2012, Oracle and/or its affiliates. All rights reserved. Author: Robert Crews Version: 2012.3.17 */ function addLoadEvent(func) { var oldOnload = window.onload; if (typeof(window.onload) != "function") window.onload = func; else window.onload = function() { oldOnload(); func(); } } function compactLists() { var lists = []; var ul = document.getElementsByTagName("ul"); for (var i = 0; i < ul.length; i++) lists.push(ul[i]); var ol = document.getElementsByTagName("ol"); for (var i = 0; i < ol.length; i++) lists.push(ol[i]); for (var i = 0; i < lists.length; i++) { var collapsible = true, c = []; var li = lists[i].getElementsByTagName("li"); for (var j = 0; j < li.length; j++) { var p = li[j].getElementsByTagName("p"); if (p.length > 1) collapsible = false; for (var k = 0; k < p.length; k++) { if ( getTextContent(p[k]).split(" ").length > 12 ) collapsible = false; c.push(p[k]); } } if (collapsible) { for (var j = 0; j < c.length; j++) { c[j].style.margin = "0"; } } } function getTextContent(e) { if (e.textContent) return e.textContent; if (e.innerText) return e.innerText; } } addLoadEvent(compactLists); function processIndex() { try { if (!/\/index.htm(?:|#.*)$/.test(window.location.href)) return false; } catch(e) {} var shortcut = []; lastPrefix = ""; var dd = document.getElementsByTagName("dd"); for (var i = 0; i < dd.length; i++) { if (dd[i].className != 'l1ix') continue; var prefix = getTextContent(dd[i]).substring(0, 2).toUpperCase(); if (!prefix.match(/^([A-Z0-9]{2})/)) continue; if (prefix == lastPrefix) continue; dd[i].id = prefix; var s = document.createElement("a"); s.href = "#" + prefix; s.appendChild(document.createTextNode(prefix)); shortcut.push(s); lastPrefix = prefix; } var h2 = document.getElementsByTagName("h2"); for (var i = 0; i < h2.length; i++) { var nav = document.createElement("div"); nav.style.position = "relative"; nav.style.top = "-1.5ex"; nav.style.left = "1.5em"; nav.style.width = "90%"; while (shortcut[0] && shortcut[0].toString().charAt(shortcut[0].toString().length - 2) == getTextContent(h2[i])) { nav.appendChild(shortcut.shift()); nav.appendChild(document.createTextNode("\u00A0 ")); } h2[i].parentNode.insertBefore(nav, h2[i].nextSibling); } function getTextContent(e) { if (e.textContent) return e.textContent; if (e.innerText) return e.innerText; } } addLoadEvent(processIndex); PKo"nR M PKa3wEOEBPS/orbr_jsp003.htm^+ Modify the HTML Parameter Form in Reports Builder

42.3 Modify the HTML Parameter Form in Reports Builder

In this section, you will learn how to modify an HTML Parameter Form in Reports Builder to populate the list of values (LOV) you created with values from a data source. You will use JSP tags for Oracle Reports to enable the Parameter Form to access elements from a data model.

42.3.1 Create a data model manually for the Parameter Form

The steps in this section will show you how to create a simple data model for the Parameter Form.

To create a data model:

  1. In Reports Builder, open the HTML file you created, paramform_your_initials.html.

  2. In the Object Navigator, double-click the icon next to the Data Model node to display the Data Model view.

  3. In the Data Model view that displays, click the SQL Query tool in the tool palette, then click in an open area of the Data Model view to display the SQL Query Statement dialog box.

  4. In the SQL Query Statement field, enter the following SELECT statement:

    select department_name, department_id
    from departments
    order by department_name
    

    Note:

    You you can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called simplejsppf_code.txt into the SQL Query Statement field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the SQL Query Statement field.


  5. Click Connect, then type the connection information for the Human Resources sample schema (HR).

  6. Click OK. Your data model should look like this:

    Figure 42-4 Data Model view of the Parameter Form

    Description of Figure 42-4 follows

  7. Save the report as paramform_your_initials.jsp.

42.3.2 Create a dynamic LOV in the Parameter Form

In this section, you will learn how to modify the Web source to pull data into the existing list of values (LOV) in your Parameter Form. This data will rely on the data model you created in the previous section. We will also examine the code to explain how each element operates.

To modify the LOV in the Parameter Form in Reports Builder:

  1. Click the Web Source button in the toolbar to display the Web Source view.

  2. In the Web Source view, look for the following code:

    <select name="p_department" size="1">
    <option value="1">a</option>
    </select>
    

    Note:

    In the above code, the LOV returns a static value. The display name is "a" and the value is "1".


    Since the LOV is currently static, we need to change this HTML element to dynamically retrieve data based on our data model.

  3. In the Web Source view, modify the above code so that it looks like the following:

    <select name=" p_department">
    <rw:foreach id="fn" src="G_department_name"> 
    <option value="<rw:field id="f_deptId" src="department_id"/>"><rw:field
    id="deptname1" src="department_name"/></option>
    </rw:foreach> 
    </select>
    

    Note:

    You can either type the code manually or copy and paste it from the provided file called simplejsppf_code.txt.


  4. Save your report.

Examine the JSP elements in the code:

By using JSP tags for Oracle Reports in the above code, we retrieve data into the Parameter Form's LOV by basing the parameters on fields in the data model. Let us examine each element:

  • <option>: The display name of the LOV is replaced by the field department_name from the data model. When the user displays the Parameter Form, the department name will display in the list.

  • <rw:field>: This element accesses each element of the g_department_name group.

  • <rw:foreach>: This element iterates through the results based on the g_department_name group in the data model.

  • src: This parameter is used in both <rw:foreach> and <rw:field> elements. For the <rw:foreach> element, src must match the group name of the data model (G_department_name). For the <rw: field> element, it must match the field that is referred (department_name).

  • id: This parameter can be any value, but it must be unique. This parameter also applies to both <rw:foreach> and <rw:field> elements.


Note:

For more infomation on these JSP elements and their parameters, refer to the Oracle Reports online Help.


By making these modifications to the code, we have replaced the return value attribute of the LOV with the field department_id, based on the data model we created in the previous section. If we now choose a department name from the list of values, its related department ID is returned. Note that the return value is not displayed.

42.3.3 Run the Parameter Form report to the Web

Now that we have modified and examined our Web source, let us view the Parameter Form in a Web browser.

  1. Click the Run Web Layout button in the toolbar.


    Note:

    If Netscape 7.0 is your default browser, and the browser does not display, set the registry key HKEY_CURRENT_USERS\Software\Oracle\Toolkit\Tkbrowser to the default browser location. Ensure that the BrowserName and the BrowserPath keys reflect the correct values. For example: BrowserName=Netscape 7; BrowserPath=C:\Program Files\Netscape\Netscape\Netscp.exe.


  2. The Parameter Form displays in your Web browser, and should look like the following:

    Figure 42-5 Parameter form with values

    Description of Figure 42-5 follows


    Note:

    In the modified Parameter Form, notice how the list of values for the Department has changed from "a" to "Accounting."


  3. Click the Department list and notice how the list is now populated with department names. Although you can click Run Report, nothing will happen because we have not yet defined an action for it.

PKQc+^+PKa3wEOEBPS/orbr_concepts1011.htm` Runtime Views

1.11 Runtime Views

The topic in this section discuss the views of a report shown at runtime.

1.11.1 About the Runtime Parameter Form

The Runtime Parameter Form is a dialog box that optionally displays at runtime in which you can override default parameter values (for example, values that modify SELECT statements, route the report output to a specified device, and so on). You define the format of the Runtime Parameter Form in the Paper Parameter Form view. If you do not define a Runtime Parameter Form in the Paper Parameter Form view, Oracle Reports Builder displays a default Runtime Parameter Form for you at runtime.

Change the parameters as desired and then click the Run Paper Layout button in the toolbar to run the report.

Alternatively, you can click the Cancel Run button in the toolbar to cancel.

See also

Section 1.6.5, "About the Paper Parameter Form view"

Section 1.9.4, "About Parameter Forms for Web reports"

Section 4.11.7, "Displaying the Parameter Form at runtime"

1.11.2 About the Previewer

The Previewer displays on your screen how the printed version of your report will look. In the Previewer, you can scroll though a single page of report output, page through the entire report, and split the screen to view different sections of the same report concurrently. You can also perform the following actions:

Table 1-3 Print previewer actions

To...Click in the toolbar...

Print the report

the Print button

Specify page setup settings

the Page Setup button

Open a new Previewer

the New Previewer button

Close the Previewer

the Close Previewer button

Zoom in

the Zoom In button

Zoom out

the Zoom Out button


A physical page (or panel) is the size of a page that will be output by your printer. A logical page is the size of one page of your actual report (it can be any number of physical pages wide or long). The Previewer displays the logical pages of your report output, one at a time.

Access

To display the Previewer:

  • choose File > Print Preview.

Usage notes

To speed the execution of your report, avoid "fetching ahead" when sending report output to the Previewer or Paper Design view. The following items can result in fetching ahead when referenced before the data on which they rely:

  • total number of pages/panels

  • grand totals

  • break columns that are formulas

  • break columns that have Value if Null specified

Matrix (cross-product) groups also cause fetching ahead. To cross-tabulate the data, Oracle Reports must first fetch all of the data.

It should be noted that while these items slow down the Previewer or Paper Design view, they do not affect performance when writing to a file or some other destination.


Note:

A column can cause fetching ahead even if it is not displayed. For example, a grand total may not appear in the report output, but since it is in the report, fetching ahead may still occur when Oracle Reports calculates it.


See also

Section 4.7.16.3, "Displaying report output in the Previewer"

Section 4.7.17.2, "Printing a report from the Previewer"

PKcäPKa3wEOEBPS/orbr_icons002.htm Data Model View Tool Palette

A.2 Data Model View Tool Palette

The Data Model view tool palette is a vertical group of tools located on the left-hand side of the Data Model view, as shown in Figure A-2.

Figure A-2 Data Model view tool palette

Description of Figure A-2 follows

The name and purpose of each tool is as follows:

IconDescription
Select tool

Select tool. Deselects any selected tool to "turn off" the current tool, and allow you to select any object in the Data Model view.

Magnify tool

Magnify tool. Zooms in the view on the clicked object. Hold down the SHIFT key when you click the Magnify tool to zoom out.

Summary Column tool

Summary Column tool. Creates a summary column in the query.

Data Link tool

Data Link tool. Creates a master-detail relationship between queries when you drag a line to define the relationship between the key columns in the two queries.

Formula Column tool

Formula Column tool. Creates a formula column in the query.

Cross Product tool

Cross Product tool. Creates a matrix (cross-product) group.

Placeholder Column tool

Placeholder Column tool. Creates a placeholder column which you can modify later.

SQL Query tool

SQL Query tool. Displays the SQL Query Statement dialog box where you can enter a SQL query SELECT statement or use Query Builder to create a query.

Ref Cursor Query tool

Ref Cursor Query tool. Displays the PL/SQL Editor where you can type a REF CURSOR query.

XML Query tool

XML Query tool. Displays the Define XML Query dialog box, where you can specify the XML data definition and data source.

JDBC Query tool

JDBC Query tool. Displays the JDBC Query dialog box, where you can define the SQL or stored procedure to define the data for the query.

Text Query tool

Text Query tool. Displays the Text Query dialog box, where you can specify a text data definition and data source.


PK/XPKa3wEOEBPS/orbr_maillab.htmT Building a Mailing Label Report

6 Building a Mailing Label Report

In this chapter, you will learn about mailing label reports, one of the standard report styles. By following the steps in this chapter, you can generate the report output shown in Figure 6-1.

Figure 6-1 Mailing label report output

Description of Figure 6-1 follows

Concepts

  • A mailing label report consists of data displayed in a format suitable for use as address labels on envelopes. The labels can be printed in one or many columns, and can begin at any position.

  • In a mailing label report, you can combine data from the database with static text to create addresses, and print them out as mailing labels for envelopes.

  • Mailing labels can be created using simple, one-query reports with a mailing label layout style.

Data Relationships

To fetch the data for a mailing label report, all you need to do is create a query to select it.

Layout

  • Oracle Reports provides a default mailing label layout in which the fields are positioned so that each field is directly below the preceding field. Field labels are not printed.

  • You will use the Report Wizard to create a simple mailing label report. The Report Wizard provides you with a formatting page, where you can choose the layout of each mailing label.

  • You will use the Vertical Spacing field, located in the Property Inspector for the repeating frame, to control the amount of blank space between each mailing label. The default spacing between repeating frames may not be sufficient, and you may want to specify that space be inserted between mailing labels in the layout so that they are correctly positioned when printing them onto labels.

Example Scenario

As you build this example report, you will:

  • Use the Report Wizard to Create a Mailing Label Report and use Query Builder to write a single query that selects all of the columns for this report. You do not need to create any other data objects; Oracle Reports will create all other necessary data objects by default.

  • Add Vertical Spacing using the Vertical Spacing property to add space between each record in your mailing label report

To see a sample mailing label report, open the examples folder named mailinglabel, then open the Oracle Reports example report named mailinglabel.rdf. For details on how to open it, see "Accessing the Example Reports" in the Preface.

PK*YTPKa3wEOEBPS/orbr_intermix003.htm / Add a Formula Column

20.3 Add a Formula Column

To have the department names appear in the center of this group report, it is simplest to have a column in the detail group for the department names. To achieve this result, you must create a formula column in the detail group that will display the department names.

To add a formula column:

  1. Click the Data Model tool in the toolbar to display the Data Model view.

  2. In the Data Model view, resize the G_ENAME group to be large enough to contain a third column.

  3. Click the Formula Column tool in the tool palette.

  4. Click in the G_ENAME group to create a formula column.

  5. Double-click the new formula column object (CF_1) to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to DEPARTMENT.

    • Under Column, set the Datatype property to Character, and set the Width property to 14.

    • Under Placeholder/Formula, double-click the PL/SQL Formula property field to display the PL/SQL Editor.

  6. In the PL/SQL Editor, at the flashing cursor (after the word begin), type the following:

    return(:dname);
    
  7. Click Compile.

  8. Click Close.

  9. Click the title bar of the Report Editor to make it the active window again.

PK$\^ PKa3wEOEBPS/orbr_wrapped002.htmO Create a Query in the Data Model View

15.2 Create a Query in the Data Model View

When you create a report, you can either use the Report Wizard to assist you or create the report yourself. In this example, you will use the Data Model view to create your two queries, then use the tool palette to create a data link between the two queries to relate the data tables.

To create the query:

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Build a new report manually, then click OK.

  3. In the Data Model view that displays, click the SQL Query tool in the tool palette then click in an open area of the Data Model view to display the SQL Query Statement dialog box.

  4. In the SQL Query Statement field, enter the following SELECT statement:

    SELECT ALL CUSTOMERS_A1.CUST_FIRST_NAME, 
      CUSTOMERS_A1.CUST_LAST_NAME, ORDERS.ORDER_ID, ORDERS.ORDER_TOTAL
    FROM CUSTOMERS CUSTOMERS_A1, ORDERS
    WHERE (ORDERS.CUSTOMER_ID = CUSTOMERS_A1.CUSTOMER_ID) 
    ORDER BY CUSTOMERS_A1.CUST_LAST_NAME
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called wrappedbreak_code.txt into the SQL Query Statement field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the SQL Query Statement field.


  5. Click OK to display the data model for your new query in the Data Model view. It should look like this:

    Figure 15-2 Data Model for the query

    Description of Figure 15-2 follows

  6. In the G_CUST_FIRST_NAME group, click CUST_FIRST_NAME and drag it above the group to create another group.

  7. Click CUST_LAST_NAME, then drag it into the new group, so that the data model now looks like this:

    Figure 15-3 Data model with groups

    Description of Figure 15-3 follows

  8. Double-click the new group (G_1) to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to G_Name.

    Your data model should now look like this:

    Figure 15-4 Data model with new G_Name group

    Description of Figure 15-4 follows

  9. Save your report as wrappedbreak_your_initials.rdf.

PK{XTOPKa3wEOEBPS/part5.htm' Building Reports for Business Cases

Part V

Building Reports for Business Cases

The chapters in this Part provide steps to build reports that are intended for specific business purposes. The examples provided include computing values over specified periods of time, collecting data over a specified range, and grading data. Following the steps, you will learn how to print reports on preprinted forms (for checks or invoices), split a report into sections and distribute each section to a different destination, and include a simple table or contents and index, or a multilevel table of contents.

A time series calculations report computes values over a specified period of time. You can use the techniques used for this report to produce other formats of time series calculations. For example, you can build a report that calculates and displays the quarterly average of purchases for each customer.

A paper report generated to spreadsheet output can be displayed in your browser. You can integrate the paper layout into a Web layout by modifying the Web source of your report, and then generate the output. You can then deploy this report with the Reports Server under Oracle WebLogic Server and display it in a spreadsheet utility (such as Microsoft Excel) inside your browser.

A report with aggregate data collects data within a range, retrieves values from the database, and formats them based on an aggregate range defined. You can use parameters to specify the range over which the data should be collected.

A check printing report contains a stub and spelled-out cash amounts. You can create a PL/SQL function that returns spelled-out numerical values, imports an image of a preprinted form (such as a blank check image), and prints your report on the form.

A report using a preprinted form enables you to use formatting techniques to print reports on preprinted forms when you do not have access to a computer readable version of the forms. Such reports must be designed so that the data prints in the exact positions on the form.

An invoice report displays several distinguishing characteristics of a typical invoice, such as customer name and address, sales order number, billing information, and billing totals. You can import an image and print your report on a preprinted form.

A ranking report grades data in two different ways: by count and by percentage. You can set the ranking criteria at runtime or let the criteria default to previously specified values.

Navigational tools, such as a simple table of contents and an index, can be added to a paper report. First, the page numbering must be determined for the entire report, then Oracle Reports Builder can generate the table of contents and index based on the established page numbering.

A multilevel table of contents can be added to a paper report to facilitate navigation. This table of contents is created similarly to that in Chapter 35, "Building a Paper Report with a Simple Table of Contents and Index", however with a hierarchy that categorizes the information in the table of contents.

A report built for bursting and distributing a report enables you to simultaneously deliver a single report to multiple destinations. You can create a single report, burst each section to a separate report, and then send each section in any format (such as, PDF or HTML) to multiple destinations.

A multibyte character report can display text in virtually any language. You can produce reports that display text in multibyte character sets, such as Simplified Chinese, Traditional Chinese, Japanese, Korean, and Unicode.

PKYuPPKa3wEOEBPS/orbr_howto007.htm Run and Dispatch a Report

4.7 Run and Dispatch a Report

This section provides procedures for the following tasks that you may perform as you run and dispatch a report:

4.7.1 Running and dispatching a report from the user interface

To run and dispatch a report from the Oracle Reports Builder user interface:

  1. In the Object Navigator, click the report name, or choose File > Open to open it.

  2. If you are not already connected, connect to a database.

  3. Click the Run Paper Layout button in the toolbar.

  4. If the Runtime Parameter Form displays, specify settings for the desired output:


    Note:

    When you create the report, you must use the Parameter Form Builder (choose Tools > Parameter Form Builder) to select the system and user parameters you want to appear in the Runtime Parameter Form.


    • To preview output in the Paper Design view using screen fonts: set Destination Type to Screen.

    • To preview output in the Paper Design view using screen fonts and size the fonts using the printer font metrics: set Destination Type to Preview.

    • To send output to a file: set Destination Type to File, Destination Name to the path and filename, Destination Format to the output format for the report (for example, PDF, HTML, HTMLCSS, RTF, XML, or DELIMITED for bitmapped reports, or the character-mode printer definition file (.prt file) for character-mode reports).


      Note:

      • It is not possible to generate spreadsheet output directly from Oracle Reports Builder. Instead, on the command line, you can run the report using rwrun and Reports Server clients (rwclient, rwservlet), with DESFORMAT=SPREADSHEET or DESFORMAT=ENHANCEDSPREADSHEET.


    • To send output to a printer: set Destination Type to Printer and Destination Name to the printer driver name.

    • To send output through e-mail using your Internet standard protocol SMTP e-mail application: set Destination Type to Mail and leave Destination Name blank. In the Mail dialog box, specify the recipients and subject line for your e-mail report.


      Note:

      The configuration file ORACLE_HOME\reports\conf\rwbuilder.conf must include the plug-in parameter mailServer (for example, <pluginParam name="mailServer">smtp01.mycorp.com</pluginParam>) with the outgoing mail server name. This applies in both the Windows and Solaris environments.


  5. In the Runtime Parameter Form, click the Run Report button in the toolbar.

  6. If a dialog box appears, enter required information.

Usage notes

  • If you want the orientation of the report to be landscape, you must change the orientation for the report (see Section 4.7.14, "Changing orientation"). However, if your printer does not support the specified page size, you may get truncated results. To enable character-mode printers to support landscape (or other page sizes), you can set printer escape sequences in the printer definition files. Refer to your printer documentation for the escape sequences to use.

  • When you view the report output in Microsoft Word, you must choose View > Page Layout to see all the graphics and objects in your report.

See also

Section 4.11.6, "Selecting parameters to include in the Runtime Parameter Form"

4.7.2 Running a report from the command line

To run a runfile (.rep) or a report definition file (.rdf) from the command line on Windows:

  1. Type %ORACLE_HOME%\BIN\rwrun, followed by the report name and desired arguments.

  2. If you sent the output to a file (DESTYPE=FILE DESNAME=filename DESFORMAT=fileformat), open or print the file to verify the output.

See also

Section 1.12, "Oracle Reports Components"

Topic "rwrun" in the Reference section of the Oracle Reports online Help

Section 2.8.2, "About batch reporting"

4.7.3 Running a report using a command file

To run a report using a command file on Windows:

  1. Create a text file using a word processor of your choice.

  2. In the file, type %ORACLE_HOME%\BIN\rwrun, followed by the report name and desired arguments.

  3. Name the file filename.bat.

  4. To run the report, type filename.bat on the command line.

  5. If you sent the output to a file (DESTYPE=FILE DESNAME=filename DESFORMAT=HTML), open or print the file to verify the output.

See also

Section 2.8.2, "About batch reporting"

Section 1.12, "Oracle Reports Components"

Topic "rwrun" in the Reference section of the Oracle Reports online Help.

4.7.4 Running a report to a remote Reports Server

To run a report to a remote Reports Server:

  • Type %ORACLE_HOME%\bin\rwclient, followed by the report name, server name, and desired arguments.

For additional information, see the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.

4.7.5 Generating HTML or HTMLCSS output

To apply external style sheets and user-defined styles to your report or report objects for HTMLCSS output, you can set the following properties (for information about these properties, see the Reference > Properties section of the Oracle Reports online Help) :

  • Style Sheets property CSS Class Name property CSS ID property

To generate HTML or HTMLCSS output:

  1. In the Object Navigator, select or open the report, then click the Run Paper Layout button in the toolbar to run the report.

  2. In the Paper Design view, specify the scope of output you want to display:

    • To display only the current page of the report, choose File > Preview Format > Current Page.

    • To display all pages, choose File > Preview Format > All Pages.


      Note:

      If you choose to show all pages of your report output, and you have HTML page streaming enabled, the first page will display in your Web browser, and you will be able to quickly navigate to any other page in the rest of the report.


  3. To preview your HTML or HTMLCSS report output in a Web browser, choose File > Preview Format > Paginated HTML or Paginated HTMLCSS (to format with style sheet extensions).

  4. To save your report output as an HTML or HTMLCSS, choose File > Generate to File.

See also

Section 2.8.8, "About HTML and HTMLCSS output"

Section 2.8.8.1, "About HTML page streaming"

Section 2.2.11, "About style sheets"

4.7.6 Generating PDF output

To generate PDF output:

  1. In the Object Navigator, select or open the report, then click the Run Paper Layout button in the toolbar to run the report.

  2. In the Paper Design view, specify the scope of output you want to display:

    • To display only the current page of the report, choose File > Preview Format > Current Page.

    • To display all pages, choose File > Preview Format > All Pages.

  3. To preview your PDF report output in your Web browser, choose File > Preview Format > PDF.

  4. To save your report output as a PDF file, choose File > Generate to File > PDF.

See also

Section 2.8.10, "About PDF output"

4.7.7 Generating XML output

In any Oracle Reports-generated XML file, your output mimics the data model; that is, it is structured by groups and columns. Follow the steps below to do any of the following:

  • Generate an XML output file from your current report.

  • Preview the contents of an XML file in a Web browser in conjunction with command line invocation.

  • Change the XML properties that control XML output for the entire report.

  • Change the XML properties that control XML output for a column or group.

To generate an XML output file from your current report in Oracle Reports Builder:

  1. Optionally, in the Object Navigator, select or open the report, then click the Run Paper Layout button in the toolbar to run the report. Currently, any report style can be generated to XML output, but with limited support for matrix-style reports.

  2. Optionally, in the Paper Design view, choose File > Preview Format > XML to preview XML data in your default XML viewer (for example, your Web browser).


    Tip:

    An .XML extension is required by XML-supporting browsers to recognize the format as XML and display it accordingly.


  3. Click the report in the Object Navigator, and choose File > Generate to File > XML to save the XML output file to the directory of your choice.

To generate an XML output file from the command line, then preview the contents of the XML file in a Web browser:

  1. On the command line, run your report with the arguments DESFORMAT=XML, DESTYPE=FILE, and DESNAME=filename.XML.

  2. Open an XML-supporting Web browser.

  3. Choose File > Open to navigate to the XML file that you just generated, and display it in the browser window.

  4. If you make changes to the XML output or regenerate the XML file with the same name, click the Reload button in your browser to view the updated XML output.

To change the XML properties of the entire report:

  1. In the Object Navigator double-click the properties icon next to the report name to display the Property Inspector.

  2. Under XML Settings, set the XML properties as required for this report.

To change the XML properties of a column or group:

  1. In the Data Model view, double-click the column or the title bar of the group to display the Property Inspector.

  2. Under XML Settings, set the XML properties as required.

Usage notes

  • Oracle Reports Builder creates "well-formed" XML output. This means that there is an XML Declaration present in the prolog of the XML document, but not necessarily a DTD (document type definition). If you wish to create "valid" XML, you must add the DTD in the XML Prolog Value property field at the report level.

  • For a report developed in a release prior to Oracle Reports 10g Release 2 (10.1.2) patch 2, you may encounter the following issue when saving the report in XML format: if the report defines a PL/SQL package, the package specification, and sometimes the body, is not saved in the XML report. To resolve this issue, perform either of the following steps:

    • If the RDF exists, regenerate the XML output file using Oracle Reports 10g Release 2 (10.1.2) patch 2 or later.

    • If the RDF does not exist, edit the XML to manually to add type="packageSpec" and/or type="packageBody" to the function element, as shown in the following example:

      <programUnits>
        <function name="a" type="packageSpec">
          <textSource>
            <![CDATA[
              PACKAGE a IS
                function lire return date ;
              END a;
            ]]>
          </textSource>
        </function>
        <function name="a" type="packageBody">
          <textSource>
            <![CDATA[
              PACKAGE BODY a IS
                function lire return date is
                  c2 date;
                  begin
                    c2 :=sysdate;
                    return c2;
                  end;
              END;
            ]]>
          </textSource>
        </function>
        <function name="cf_1formula" returnType="date">
          <textSource>
            <![CDATA[
              function CF_1Formula return Date is
                aa date;
                begin
                  --aa :=a.lire;
                end;
            ]]>
          </textSource>
        </function>
      </programUnits>
      
  • If your report includes a graph, the graph information will not be saved in the XML file (XML is text-based output, which means images are not included).

See also

Section 2.8.7, "About XML in reports"

Topic "Oracle Reports XML tags" in the Reference section of the Oracle Reports online Help.

Chapters "Creating Advanced Distributions" and "Customizing Reports with XML" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.

4.7.8 Generating RTF output

To generate RTF output:

  1. In the Object Navigator, select or open the report, then click the Run Paper Layout button in the toolbar to run the report.

  2. To preview your report output in a Microsoft Word document, choose File > Preview Format > RTF.

  3. To save your report output as an RTF file, choose File > Generate to File > RTF.

  4. In the Save dialog box, specify a location and file name. Click Save.

See also

Section 2.8.11, "About RTF output"

4.7.9 Generating text output

To generate text output:

  1. To generate pure text output, which can be read by many different applications, set the Initial Value property of the MODE system parameter to Character (see Section 4.11.1, "Using a pre-defined system parameter").


    Note:

    If MODE is set to Bitmap (the default), the result is PostScript output, which can be read and rendered only by PostScript-compatible applications (such as a PostScript printer).


  2. In the Object Navigator, select or open the report, then click the Run Paper Layout button in the toolbar to run the report.

  3. To preview your report output in a text viewer, choose File > Preview Format > Text.

  4. To save your report output as a text file, choose File > Generate to File > Text.

  5. In the Save dialog box, specify a location and file name. Click Save.

See also

Section 2.8.14, "About text output"

4.7.10 Generating delimited output

You can generate a report to delimited output using either of the following methods:

  • From Oracle Reports Builder

  • From the command line

To generate delimited output from Oracle Reports Builder:

  1. In the Object Navigator, select or open the report, then click the Run Paper Layout button in the toolbar to run the report.

  2. To preview your delimited report output in a spreadsheet, choose File > Preview Format > Delimited or File > Preview Format > DelimitedData (for large volume reports).

  3. To save your delimited report output to a file, choose File > Generate to File > Delimited or File > Generate to File > DelimitedData (for large volume reports).

  4. In the Delimited Output dialog box or DelimitedData Output dialog box, choose from the list or type the delimiter that will separate the cells in your report output.

  5. If you want to use formatting options, choose from the list or type a Date Format Mask or a Number Format Mask.

  6. If you want to use a cell wrapper, choose from the list or type the cell wrapper that will be placed around the cell data in your report output.

  7. Click OK.

  8. In the Save dialog box, specify a location and file name. Click Save.

To generate delimited output from the command line:

  • Run a report using Reports Server clients (rwclient, rwservlet) or rwrun, with DESFORMAT=DELIMITED or DELIMITEDDATA.


Note:

  • To run a report through a URL, specify the Excel mimetype so that your browser opens the report output directly in Excel. For example:

    http://hostname:port/reports/rwservlet?report=report_name
      +server=server_name+userid=db_connect_string+destype=cache
      +desformat=delimited+mimetype=application/vnd.ms-excel
    

You can open your delimited output file (.csv) to display it automatically in Microsoft Excel. Or, you can import the output file into an existing Excel worksheet.

Usage notes

  • You can distribute a report in DelimitedData output format, specified either in a distribution XML file or in the Distribution dialog box.

Limitations

  • When generating a report to delimited output, only data (as defined by the report Data Model), no layout information, displays in Microsoft Excel. To generate report output that preserves the layout information in Excel, see Section 2.8.13, "About Enhanced Spreadsheet output".

  • Report distribution does not support Delimited output format. You cannot specify DELIMITED as an output format in a distribution XML file or in the Distribution dialog box.

  • Report bursting does not support Delimited or DelimitedData output format.

See also

Section 2.8.12, "About delimited output"

Section 4.9.7.1, "Specifying date and time format masks"

Section 4.9.7.2, "Specifying number format masks"

4.7.11 Generating Enhanced spreadsheet output

To generate Enhanced spreadsheet output:

  • On the command line, run the report using rwrun or Reports Server clients (rwclient, rwservlet), with DESFORMAT=ENHANCEDSPREADSHEET.

    For example, to use rwservlet to generate Microsoft Excel output from the paper layout of your report, enter a command that includes the following:

    http://hostname:port/reports/rwservlet?report=report_name
      +server=server_name+userid=db_connect_string+destype=file
      +desformat=enhancedspreadsheet+desname=C:\temp\myexcel_output.htm
    

Notes:

  • Microsoft Office 2000/2002/2003 supports Hypertext Markup Language (HTML) as a native file format. Enhanced Spreadsheet output relies on producing HTML output, which can be understood by Excel as a file with valid Excel format.

  • For reliable formatting, enclose the whole layout area in a frame. This prevents the possibility of parallel objects displaying in different vertical positions, one below the other.


See also

Section 2.8.13, "About Enhanced Spreadsheet output"

Chapter 29, "Building a Report for Enhanced Spreadsheet Output"

4.7.12 Distributing a report to multiple destinations

To distribute a report, you first define the distribution, then enable the distribution.

You can define the distribution for a report in any of the following ways:

  • Use XML, as described in the chapter "Creating Advanced Distributions" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.

  • In the Distribution dialog box, define a distribution list for the entire report or any report section.


    Note:

    To display the Distribution dialog box: In the report or section Property Inspector, under the Report node, click the Distribution property value field.


    For an example of using section-level distribution, see Chapter 37, "Bursting and Distributing a Report". This chapter covers defining distribution of a single section to multiple destinations, using the Repeat On property and distribution XML file.

  • On the command line, include the DESTINATION keyword to specify a DST file or XML file.


    Note:

    The DST file method is supported for backward compatibility; the preferred and recommended method of distributing reports is with XML or the Distribution dialog box.


  • To enable the distribution of a report, you can do either of the following:

    • Choose File > Distribute in Oracle Reports Builder.

    • Specify DISTRIBUTE=YES on the command line.

  • You can also trace the report distribution to verify a successful distribution, as described in Section 4.14.19, "Tracing report distribution".

    Usage notes

    • In order to use the same report definition file to burst and distribute to data-driven formats such as XML and DELIMITEDDATA, as well as to layout-driven formats such as PDF and ENHANCEDSPREADSHEET, you must ensure the following requirements are met:

      • The distribution XML file must specify the include element. For example:

        &lt;include src="mainSection"/&gt;
        
      • The Repeat On property must be set appropriately for the section(s) specified in the distribution XML file.

      • The section(s) specified in the distribution XML file in the report paper layout must not be empty.

    • In some cases, Microsoft Internet Explorer ignores the mimetype of a URL's return stream and instead sets the type by looking at the URL. This can be a problem when you are defining the distribution for a report because your URL might end with the DESTINATION keyword. For example:

      ...DISTRIBUTE=yes 
      DESTINATION=c:\oracle\reports\distribution\mydist.xml
      

      In this scenario, the URL ends with the extension xml and Internet Explorer treats the return stream as XML, when in fact it is HTML. As a result, you will receive a browser error. To work around this issue, you should never use recognized file extensions at the end of a URL. In the preceding example, you could switch the positions of the DISTRIBUTE and DESTINATION keywords in your URL.

    See also

    Section 2.8.3, "About report distribution"

    Section 2.1.2, "About report sectioning and sections"

    Chapter "Creating Advanced Distributions" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.

4.7.13 Deploying a report

To deploy a report so that end users can view it, refer to the section "Deploying Your Reports" in the chapter "Running Report Requests" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual. This section describes how to deploy a report with a paper layout (that is, a REP, RDF, XML, spreadsheet, or JSP report) and how to deploy a report with a Web layout (that is, a JSP report).

4.7.14 Changing orientation

To change the orientation (portrait or landscape) of a report section, follow the steps for the desired output format:

Printer output (DESTYPE=PRINTER) or RTF output (DESFORMAT=RTF)

The orientation of report output is based on the following order of precedence:

  1. ORIENTATION command line keyword.

  2. ORIENTATION system parameter.

  3. Orientation property for the pertinent report section (Header, Main, or Trailer): Portrait or Landscape.

  4. (If the Orientation property is set to Default) Width and Height properties for the pertinent report section:

    • If Width is greater than Height (for example, 11 x 8.5), then orientation is landscape.

    • If Height is greater than Width (for example, 8.5 x 11), then orientation is portrait.

To set the report output orientation, do one of the following:

  • On the command line, specify the ORIENTATION command line keyword. This takes precedence over the ORIENTATION system parameter, the Orientation property, and the Width and Height properties. For information about the ORIENTATION command line keyword, see the appendix "Command Line Keywords" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.

  • Specify the ORIENTATION system parameter. This takes precedence over the Orientation property, and the Width and Height properties. To specify the ORIENTATION system parameter, which allows end users to modify the orientation at runtime:

    • Choose Tools > Parameter Form Builder to display the Parameter Form Builder.

    • Click the ORIENTATION system parameter.

    • Click OK to display the Paper Parameter Form view.

    • Double-click the Orientation value field (PF_ORIENTATION) to display the Property Inspector.

    • Under the Parameter node, set the Initial Value property to Portrait or Landscape.

    • Click the Run Paper Layout button in the toolbar.

    • From the Orientation list, change the orientation if desired.

  • Set the Orientation property and/or the Width and Height properties:

    • In the Object Navigator, under the Paper Layout node, double-click the properties icon for the pertinent report section (Header, Main, or Trailer) to display the Property Inspector (by default, a report is defined in the Main Section).

    • In the Property Inspector, under the Section node, set the Orientation property to the desired value. If set to Portrait or Landscape, this value takes precedence over the Width and Height properties. If set to Default, orientation is based on the values of the Width and Height properties (landscape orientation if Width is greater than Height, and portrait orientation if Height is greater than Width).

PDF output

For PDF output, any values specified for the ORIENTATION command line keyword, ORIENTATION system parameter, and Orientation property are ignored. Orientation of the PDF output is based solely on the values of the Width and Height properties:

  1. In the Object Navigator, under the Paper Layout node, double-click the properties icon for the pertinent report section (Header, Main, or Trailer) to display the Property Inspector (by default, a report is defined in the Main Section).

  2. In the Property Inspector, under the Section node, set the Width and Height properties as desired (for example, 11 (or 15) width x 8.5 height for landscape, or 8.5 width x 11 (or 15) height for portrait). Make sure that you subtract the margin depths (for example, for an 8.5 x 11 page with top, bottom, left, and right margins of .25, set Width to 8 and Height to 10.5).

See also

Section 2.1.2, "About report sectioning and sections"

4.7.15 Suppressing the Parameter Form

If the report is run from another product, you may not want the Parameter Form to appear.

To suppress the Parameter Form and have the report assign a default value to DESTYPE, do either of the following:

  • Create a list parameter to explicitly pass the values of DESTYPE and PARAMFORM.

  • In the Preferences dialog box (Edit > Preferences), on the Runtime Settings page, clear the Parameter Form check box to specify PARAMFORM=NO.

See also

Section 1.6.5, "About the Paper Parameter Form view"

Section 1.11.1, "About the Runtime Parameter Form"

Section 1.9.4, "About Parameter Forms for Web reports"

4.7.16 Viewing report output

This section provides procedures for various ways to view report output:

4.7.16.1 Viewing the printable area

The printable area is the physical region in which your printer can print on a physical page. Most printers usually cannot print up to the edge of a page, leaving a blank "unprintable" area.

To view the printable area of your report:

  1. Choose File > Page Setup to specify your page settings.

  2. In the Paper Layout view, click the Edit Margin button in the toolbar.

    The printable area is displayed as the area within the dotted lines in the margin area.

  3. Choose View > Zoom > Zoom Out to see more.

4.7.16.2 Displaying report output in the Paper Design view

The Paper Design view is displayed whenever you run a report.

To run a report from the Object Navigator or any editor:

  • Click the Run Paper Layout button or choose Program > Run Paper Layout.

To run a report from the Report Wizard:

  • Click Finish.

You can also display the Paper Design view in these ways:

  • Click the Paper Design View button in the toolbar.

  • Choose View > Change View > Paper Design.

  • In the Object Navigator, double-click the view icon next to the Paper Design node.

In the Paper Design view, manipulate the output as desired, and use any of the following features:

See also

Section 4.7.17.1, "Printing a report from the Paper Design or Paper Layout view"

4.7.16.3 Displaying report output in the Previewer

To display your report output in the Previewer:

  1. In the Paper Design view, choose File > Print Preview.

  2. In the Previewer, use any of the following features:

See also

Section 1.11.2, "About the Previewer"

Section 4.7.17.2, "Printing a report from the Previewer"

4.7.16.4 Displaying report output in your Web browser

To display report output in your Web browser:

  1. In the Object Navigator, select or open the report, then click the Run Paper Layout button in the toolbar to run the report.

  2. In the Paper Design view, specify the scope of output you want to display:

    • To display only the current page of the report, choose File > Preview Format > Current Page.

    • To display all pages, choose File > Preview Format > All Pages.


      Note:

      If you choose to show all pages of your report output, and you have HTML page streaming enabled, the first page will display in your Web browser, and you will be able to quickly navigate to any other page in the rest of the report.


  3. To preview your report output in a Web browser, choose File > Preview Format > Paginated HTML, File > Preview Format > Paginated HTMLCSS (to format with style sheet extensions), File > Preview Format > PDF, or File > Preview Format > XML (if you have an XML-supporting browser set as your default XML viewer).

  4. To preview your report output with Web layout in a Web browser, choose Program > Run Web Layout to run the Web Source. If you have made changes to the Web Source view (for JSP-based Web reports), this enables you to immediately see the effect of your changes on the output.


    Note:

    If Netscape 7.0 is your default browser, and the browser does not display, set the registry key HKEY_CURRENT_USERS\Software\Oracle\Toolkit\Tkbrowser to the default browser location. Ensure that the BrowserName and the BrowserPath keys reflect the correct values. For example: BrowserName=Netscape 7; BrowserPath=C:\Program Files\Netscape\Netscape\Netscp.exe.


  5. To save your report output as an HTML, HTMLCSS, PDF, or XML file, choose File > Generate to File.

See also

Section 1.2.2, "About Web Reports"

Section 2.2.2, "About previewing JSP-based Web reports"

Section 2.2.11, "About style sheets"

Section 4.7.17.3, "Printing a report from your Web browser"

4.7.16.5 Displaying individual pages of HTML report output

To paginate the HTML output for a report:

  1. Specify navigation controls for HTML page-streamed output using either of the following methods:

  2. Enable HTML page streaming by running your report from the command line, specifying PAGESTREAM=YES.

See also

Section 1.2.2, "About Web Reports"

Section 2.8.8.1, "About HTML page streaming"

4.7.16.6 Scrolling and paging

To move around pages of the report using the scroll bars and paging buttons:

  • Use the mouse cursor to drag the horizontal and vertical scroll bars to move around the current page.

  • Click the First Page, Previous Page, Next Page, and Last Page buttons in the toolbar to display the indicated pages of the report.

  • To display a specific page, type the page number in the Page field.

4.7.16.7 Splitting the viewing region

To create two views of the report output by splitting the display horizontally or vertically:

  • In the Data Model view, Paper Layout view, Paper Design view, or Paper Parameter Form view, drag the black bar below the vertical scroll bar (to split horizontally), or to the right of the horizontal scroll bar (to split vertically).

  • In the Previewer, drag the grey bar above the vertical scroll bar (to split horizontally), or to the left of the horizontal scroll bar (to split vertically)

You can scroll and page within each view to move the contents of that view while the other view remains unchanged.

4.7.16.8 Magnifying or reducing the output

To magnify a hard-to-see portion of your report:

  • In the Data Model view, Paper Layout view, Paper Design view, or Paper Parameter Form view, click the Magnify tool in the tool palette (or, choose View > Zoom > Zoom In).

  • In the Previewer, click the Zoom In button in the toolbar.

To reduce the image to get a sense of your report's overall layout:

  • In the Data Model view, Paper Layout view, Paper Design view, or Paper Parameter Form view, choose View > Zoom > Zoom Out or Normal Size.

  • In the Previewer, click the Zoom Out button in the toolbar.

4.7.17 Printing a Report

This section provides procedures for the following tasks that you may perform to print a report:

Before printing your report from the Reports Builder,do the following:

  • Configure a valid printer, and enter the value of the printer in the uiprint.txt file which is located at:

    INSTANCE_HOME/config/FRComponent/frcommon/guicommon/tk/admin/uiprint.txt

    OR

  • From the Reports Builder menu, go to Edit > Preferences. Select the Runtime Values tab.

    From the Destination Type drop-down list, select Printer and provide a valid value for printer name, and click OK.

For more information, see "Configuring the Printing Environment" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.

4.7.17.1 Printing a report from the Paper Design or Paper Layout view

To print a report from the Paper Design or Paper Layout view:

  1. In the Paper Design view or Paper Layout view choose File > Print.

  2. In the Print dialog box, type the number of pages and copies you want to print.

  3. Click OK.

See also

Section 4.7.16.2, "Displaying report output in the Paper Design view"

4.7.17.2 Printing a report from the Previewer

To print a report from the Previewer:

  1. In the Previewer, click the Page Setup button in the toolbar to verify your printer setup.

  2. Click the Print button in the toolbar.

  3. In the Print dialog box, specify the pages and copies you want to print.

    If the report has a Destination Type of Screen (set by system parameter DESTYPE), a warning displays to run the report with a Destination Type of Preview before printing. Preview creates PostScript output, which is typically more desirable for printing bit-mapped reports.

  4. Click OK.

See also

Section 4.7.16.3, "Displaying report output in the Previewer"

4.7.17.3 Printing a report from your Web browser


Note:

Formatting with style sheet extensions paginates the HTML document in the same way the report is paginated; formatting without style sheet extensions generates HTML output that does not break between the pages of the report.


To print a report from your Web browser:

  1. If your report is formatted with HTML style sheet extensions (HTMLCSS), set up your browser to print the HTML document in the same way the report is paginated:

    • In your browser, choose File > Page Setup and modify the margin settings as desired.

    • In the Object Navigator, under the Paper Layout node, double-click the Header Section, Main Section, or Trailer Section properties icon for the pertinent report section (Header, Main, or Trailer) to display the Property Inspector (by default, a report is defined in the Main Section).

    • In the Property Inspector, under the Section node, set the Width and Height properties as desired (for example, 11 (or 15) width x 8.5 height for landscape or 8.5 width x 11 (or 15) height for portrait). Make sure that you subtract the margin depths (for example, for an 8.5 x 11 page with top, bottom, left, and right margins of .25, set Width to 8 and Height to 10.5).

  2. Display your report output in your Web browser (see Section 4.7.16.4, "Displaying report output in your Web browser").

  3. Choose File > Print.

See also

Section 1.2.2, "About Web Reports"

Section 2.2.2, "About previewing JSP-based Web reports"

Section 2.2.11, "About style sheets"

4.7.17.4 Printing a report on a preprinted form

See the example report in Chapter 32, "Building a Report Using a Preprinted Form".

4.7.17.5 Switching the printer tray

To switch the printer tray:

  1. Choose File > Page Setup and in the Source list, note the names of the printer trays defined for your printer.

  2. Use SRW.SET_PRINTER_TRAY to define the desired trigger:

See also

Section 2.8.6, "About switching the printer tray"

4.7.17.6 Printing a report on UNIX

Printing on UNIX requires some setup and configuration to create the proper printing environment. For detailed information about printing your reports on UNIX, refer to the chapter "Printing on UNIX with Oracle Reports" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.

Oracle Reports 10g (9.0.4) introduced the following enhancements for printing reports on UNIX:

  • The REPORTS_DEFAULT_DISPLAY environment variable, which provides for the removal of dependency on the DISPLAY environment variable. Prior releases of Oracle Reports required the DISPLAY environment variable to be set to run and print reports on UNIX.

  • The PostScript printer driver screenprinter.ppd, which eliminates the dependency on having a valid printer defined (PRINTER and TK_PRINTER environment variables set to a valid printer, or a valid entry in uiprint.txt) for Reports Runtime on UNIX. This driver provides surface resolution for images and specifies font information. Prior releases of Oracle Reports required a printer to resolve fonts to run and print reports on UNIX.

    This driver is the first entry in uiscreenprint.txt. The file locations (UNIX only) are:

    uiscreenprint.txt: $ORACLE_INSTANCE/config/FRCommon/frcommon/guicommon/tk/admin
    screenprinter.ppd: 
    $ORACLE_INSTANCE/config/FRCommon/frcommon/guicommon/tk/admin/PPD

Limitations

  • If your report includes an Oracle Graphics 6i graph, a printer is required to generate the graph. However, TK_PRINT_STATUS=echo is set in g90runm.sh. Thus, to run a report with an Oracle Graphics 6i graph without a valid printer, set the PRINTER environment variable to any value.


    Note:

    Oracle Graphics 6i, or Graphics Builder, is obsolete. Instead, use the Graph Wizard, which produces graphs that are automatically translated into JSP tags to enable you to add graphics to Web reports (for additional information, see the Oracle Reports online Help topic "Displaying Oracle Graphics 6i charts in Oracle Reports 11g").< /p>


4.7.18 E-mailing a report

To e-mail a report from Oracle Reports Builder:

  1. Log on to your Internet Standard Protocol SMTP mail application.

  2. Select or open the report.

  3. If you are not already connected, connect to a database.

  4. Choose File > Mail.

  5. In the Mail dialog box, specify the recipients and subject line for your e-mail report.

  6. Click OK.

To e-mail a report in batch mode:

  1. Log on to your Internet Standard Protocol SMTP mail application.

  2. Run the report from the command line, specifying DESTYPE=MAIL, and DESNAME=recipient1, recipient2, recipient3, ....

Usage notes

The configuration file $ORACLE_INSTANCE\config\ReportsToolsComponent\
ReportsTools\rwbuilder.conf
must include the plug-in parameter mailServer. For example:

<pluginParam name="mailServer" value="stbeehive.oracle.com">
<property name="enableSSL" value="yes"/>
</pluginParam>

With the outgoing mail server name. This applies in both the Windows and Solaris environments.

PKU  PKa3wEOEBPS/part2.htmF Building Group Reports

Part II

Building Group Reports

The chapters in this Part provide steps to build group reports. In these reports, the rows of output are displayed as groups based on a single query or on multiple queries. Group reports can contain formula columns and the values of the report can be printed from top to bottom or across a page.

A single-query group report contains a single query and divides the rows of a report into groups based on common values in one or more column(s). For example, employees can be grouped based on department numbers, which means each department number prints only once for every group. Otherwise, the department number would print once for every employee in the department. These reports include the group left and group above reports and were earlier known as break reports or master/detail reports.

A two-query group report appears much the same as a single-query group report except that the former report uses multiple queries. Multiple queries enable you to simplify maintenance or make the data model easier to understand.

An across group report prints the values of a database column across the page instead of down. In these reports, the values in the master group print from top to bottom, and the values in the detail group print across the page, from left to right.

A group left summary report consists of master record values, detail records, and summaries. Summaries are totals calculated for the details under each master record.

A group left formula report contains a formula column, for which values are calculated based on a PL/SQL formula. A formula column, like a summary column, is a computational column that you create. This column performs user-defined calculations on other column(s) data including placeholder columns.

PKF$zKFPKa3wEOEBPS/orbr_paptoexcel.htm# Building a Report for Enhanced Spreadsheet Output

29 Building a Report for Enhanced Spreadsheet Output

In this chapter, you will learn about Enhanced Spreadsheet reports. Oracle Reports generates spreadsheet output using the ENHANCEDSPREADSHEET format. The ENHANCEDSPREADSHEET output format is new in Oracle Reports 11g Release 1 (11.1.1) and provides the following benefits:

  • Large data sets (up to 75,000 rows) can be generated to the ENHANCEDSPREADSHEET output format.

  • ENHANCEDSPREADSHEET output format allows for bursting and distributing reports to spreadsheet output format.

  • In ENHANCEDSPREADSHEET output, the complete report data is shown as one unbroken chunk of information in Microsoft Excel, not broken up by page breaks, as happens in other output formats, such as PDF and RTF that are restricted by horizontal and vertical page sizes.

For more information about Enhanced spreadsheet output, refer to Section 2.8.13, "About Enhanced Spreadsheet output".

By completing the steps in this chapter, you can generate the Enhanced Spreadsheet report output, as shown in Figure 29-1.

Figure 29-1 Enhanced Spreadsheet report output

Description of Figure 29-1 follows

Concepts

  • This chapter provides steps for building a JSP-based Web report and deploying it with Reports Server under Oracle WebLogic Server to display it in Microsoft Excel inside your Web browser. You can use an existing paper layout report to create a new Web layout.

  • If you want to generate Microsoft Excel output from your Web report, but you do not have an existing paper layout, refer to the slideshow demonstration on the Oracle Technology Network (OTN): on the Oracle Reports page (http://www.oracle.com/technology/products/reports/index.html), click Getting Started to display the Getting Started with Oracle Reports home page. In the list of topic sections on the left, click Index. In the Collateral Type list, choose Demonstrations, and click Search. In the list of demos that displays, click Output to Excel with Oracle Reports.


    Note:

    The steps in both this chapter and the Getting Started demonstration allow you to use rich formatting, such as colors and fonts so that you generate report layout, not just data, in Microsoft Excel output inside a Web browser. However, you must add custom JSP code to get the output in Microsoft Excel. The Web report can only be run as JSP in Oracle WebLogic Server and not through rwservlet, thus this method can only display the Microsoft Excel output inside a Web browser.


  • The ENHANCEDSPREADSHEET output format enables you to burst and distribute reports to spreadsheet format, as well as generate large data sets (up to 75,000 rows) to spreadsheets.

    The ENHANCEDSPREADSHEET output formats generate output from paper layout reports to HTML files that can be directly opened with Microsoft Excel 2000. You can:

    • Generate report output to Enhanced spreadsheet format from existing paper layout reports saved in any format (.rdf, .xml, .jsp), using rwrun or Reports Server clients (rwclient, rwservlet). See the following example scenario.

    • Preserve the rich layout formatting, such as colors, fonts, conditional formatting, graphs, and images.

    For the steps to implement this functionality to directly generate spreadsheet output, see Section 2.8.13, "About Enhanced Spreadsheet output" and Section 4.7.11, "Generating Enhanced spreadsheet output".

Example Scenario

In this example, you will generate a report to Microsoft Excel output. The output is generated after integrating the paper layout into a Web layout by modifying the Web source of your report.

As you build this example report, you will:

To see a sample report, open the examples folder named papertoexcel, then open the Oracle Reports example named mypaperreport.rdf. For details on how to open it, see "Accessing the Example Reports" in the Preface. The example files used in this chapter are listed and described in Table 29-1.

Table 29-1 Example Report Files

FileDescription

papertoexcel\mypaperreport.rdf

The sample paper report. Running this RDF in Reports Builder will display the result of your paper report in the Paper Design view.

papertoexcel\myexcelreport.jsp

This JSP-based Web report contains the modifications to the paper report you will make in Reports Builder.

papertoexcel\papertoexceldata_code.txt

The SQL for the query you need to enter.


PK###PKa3wEOEBPS/orbr_grpl_single.htmW Building a Single-Query Group Report

10 Building a Single-Query Group Report

In this chapter, you will learn about single-query group reports. By following the steps in this chapter, you can generate the report output shown in Figure 10-1.

Figure 10-1 Group report output

Description of Figure 10-1 follows

Concepts

Group left and group above reports divide the rows of a report into "sets," based on common values in one or more of the columns, such as the department number in the preceding example. Notice that each department number prints only once. If the report above was not a group report, the department number would print once for each employee in the department rather than just once for the whole department.


Note:

This type of report may also be referred to as a break report or a master/detail report.


Example Scenario

In this example, you will create a group left report that lists employees with their jobs and salaries by department. As you build this example report, you will:

Then, you will add another column to the break group:

Then, you will add a second break group:

To see a sample across report with control breaks, open the examples folder called break, then open the Oracle Reports example report named grp_lft2.rdf. For details on how to open it, see "Accessing the Example Reports" in the Preface.

PKN\WPKa3wEOEBPS/orbr_rank002.htmn Create a Data Model and Tabular Layout

34.2 Create a Data Model and Tabular Layout

When you are creating a single-query report, such as this one, you can use the Report Wizard to create the data model and layout simultaneously.

To create a data model and layout:

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Use the Report Wizard, then click OK.

  3. If the Welcome page displays, click Next.

  4. On the Report Type page, select Create Paper Layout Only, then click Next.

  5. On the Style page, type a Title for your report, select Tabular, then click Next.

  6. On the Data Source page, click SQL Query, then click Next.

  7. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT CUSTNAME CNAME, SUM(AMOUNT) SUM_AMT FROM SALES
    GROUP BY CUSTNAME
    ORDER BY SUM(AMOUNT) DESC
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called rank_code.txt in the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field.


  8. 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 34.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  9. On the Fields page, click the double right arrows (>>) to move all of the fields to the Displayed Fields list, then click Next.

  10. On the Totals page, click Next.

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

    FieldsLabelsWidth

    CNAME

    Customer Name

    35

    SUM_AMT

    Total Purchases

    15


  12. On the Template page, click Finish to preview your report output in the Paper Design view. It should look something like this:

    Figure 34-2 Paper Design view for the ranking report

    Description of Figure 34-2 follows

PK1"\PKa3wEOEBPS/orbr_grpl_single004.htm Group Report with Two Break Groups

10.4 Group Report with Two Break Groups

Figure 10-10 Group left report output with two break groups

Description of Figure 10-10 follows

The figure above shows a further modification of your group left report. In this version, DEPARTMENT_ID prints only once for each department. JOB_ID also prints only once when more than one employee in a department has the same job. Both columns are now in separate break groups and DEPARTMENT_ID is in the higher group. Hence, it does not repeat for each unique value of JOB_ID within a department any more.

Concepts

  • You can also create reports that include multiple break groups and assign one or more columns to each break group.

  • You will further modify the data model to include two break groups: G_DEPARTMENT_ID and G_JOB_ID.

  • After changing the data model, redefault the layout to incorporate your changes, then specify the format mask again.

To see a sample group left report with two break groups, open the examples folder named break, then open the Oracle Reports example named grp_lft2.rdf. For details on how to access it, see "Accessing the Example Reports" in the Preface.

10.4.1 Modify the data model

The first task in changing your previous report is to modify the data model by creating another break group.

To add another break group:

  1. Open the report you created in the previous section.

  2. In the Object Navigator, double-click the view icon next to the Data Model node to display the Data Model view.

  3. In the Data Model view, click and drag the group, G_EMPLOYEE_ID, down about 0.25 inches (0.5 centimeters).

  4. Click the JOB_ID column in G_DEPARTMENT_ID and drag it to a spot somewhere in between G_DEPARTMENT_ID and G_EMPLOYEE_ID. Another break called G_JOB_ID is created.

10.4.2 Redefault the layout

In order for your data model change to be reflected in your output, you need to redefault the layout for your report using the Report Wizard.

To redefault the layout with the Report Wizard:

  1. Click the title bar of the Report Editor to make it the active window. The Report Editor must be the active window for you to access the Report Wizard.

  2. Choose Tools > Report Wizard.

  3. Select Create Paper Layout only.

  4. Click Finish. Notice the changes to the output in the Paper Design view.

  5. Save your report.

PKV!PKa3wEOEBPS/orbr_mstrmstr002.htmt Create a New Report Manually

8.2 Create a New Report Manually

In this case, it is easier to create the data model and layout separately. Hence, we will create an empty report first, then add the queries, and then create the layouts.

To create a blank report:

  1. Launch Reports Builder (or, if already open, choose File > New > Report)

  2. In the Welcome or New Report dialog box, select Build a new report manually, then click OK.

PK6:ytPKa3wEOEBPS/orbr_cndfrm.htm Building a Conditional Form Letter Report

23 Building a Conditional Form Letter Report

In this chapter, you will learn about reports that generate different versions of a form letter based on changing conditions. By following the steps in this chapter, you can generate the report output shown in Figure 23-1 and Figure 23-2.

Figure 23-1 Conditional form letter report output, base version

Description of Figure 23-1 follows

Figure 23-2 Conditional form letter report output, alternate version

Description of Figure 23-2 follows

Concepts

  • The two form letters above were generated from the same report. As you can see, the two letters share a number of features. Hence, it is more convenient to create a base form letter and then apply conditions to certain parts to determine whether they should be displayed for the current record, in this case, employees.

  • Conditional printing is useful when you want to display a section of a report only if certain conditions are met at run time. Conversely, you may wish to use conditional printing to suppress certain information for those who don't need it.

Data Relationships

This report uses one query to select all data.

Layout

This report uses the Form Letter layout style. You'll also create the various pieces of boilerplate that will comprise the letter. To govern the printing of these boilerplate objects, you'll use vertically collapsing anchors and PL/SQL format triggers to conditionally produce different form letters for employees who meet the specified criteria.

Example Scenario

In this example, you will create a form letter to invite all of your employees to the company picnic. For your top sales representatives, though, you also want to include a special invitation to a dinner party in the form letter. For all other employees, you want to include a thank you without the dinner invitation.

As you build this example report, you will:

To see a sample conditional form letter report, open the examples folder named condform, then open the Oracle Reports example named condform.rdf. For details on how to access it, see "Accessing the Example Reports" in the Preface.

PKڛPKa3wEOEBPS/orbr_concepts2007.htm8 Templates

2.7 Templates

The topics in this section discuss the use of templates in Oracle Reports Builder.

2.7.1 About templates

Templates define common characteristics and objects that you want to apply to multiple paper-based reports. For example, you can define a template that includes the company logo and sets fonts and colors for selected areas of a report.

When you use the Report Wizard to create a paper-based report, you use the Templates page of the wizard to apply a template (.tdf file) to the report. The Templates page lists the default templates, as well as any templates that you have created.


Note:

If the list of templates does not appear, make sure that the REPORTS_PATH environment variable includes the location of the templates (for example, ORACLE_HOME\reports\templates).


When you choose a template, objects in the margin area of a template are imported into the same locations in the current report section, overwriting any existing objects. The characteristics (formatting, fonts, colors, and so on) of objects in the body area of the template are applied to objects in the body area of the current report section. Any template properties, parameters, report triggers, program units, and attached libraries you have defined are also applied. You can apply different templates to each section of the report. However, if you are applying one of the default templates, you cannot combine two report blocks that use different default templates in a single report. All of your report blocks in any one report must use the same default template.

If you later apply another template to a report, the existing template objects will be deleted in the current report section.

See also

Section 4.12, "Define a Template"

2.7.2 About template attributes

In the Layout Body area of a template, you can define Default and Override attributes under the following Object Navigator nodes:

  • Frames, which contains the following:

    • a Section Frame node, which defines attributes for the parent frame surrounding the currently selected section.

    • a Headings Frame node, which defines attributes for the parent frame surrounding the column headings.

    • a Fields Frame node, which defines attributes for the parent frame surrounding the fields.

    • a Summaries Frame node, which defines attributes for the parent frame surrounding the summaries (totals).

  • Field Labels/Headings, which contains the following:

    • a Character node, which defines attributes for the labels or column headings of character fields.

    • a Number node, which defines attributes for the labels or column headings of number fields.

    • a Date node, which defines attributes for the labels or column headings of date fields.

  • Fields, which contains the following:

    • a Character node, which defines attributes for character fields.

    • a Number node, which defines attributes for number fields.

    • a Date node, which defines attributes for date fields.

  • Summary Labels, which contains the following:

    • a Character node, which defines attributes for the labels of summaries on character fields.

    • a Number node, which defines attributes for the labels of summaries on numeric fields.

    • a Date node, which defines attributes for the labels of summaries on date fields.

  • Summaries, which contains the following:

    • a Character node, which defines attributes for summaries on character fields.

    • a Number node, which defines attributes for summaries on number fields.

    • a Date node, which defines attributes for summaries on date fields.

Default attributes

The Default node in the Object Navigator defines the default visual attributes (formatting, fonts, colors, and so on) for all report styles. If you want to define attributes for individual report styles, you do so under the Override node. When you apply a template to a report, all Default attributes are applied to the report, except for attributes that are localized under the Override node.

Override attributes

Under the Override node in the Object Navigator, you can define attributes for individual report styles. Each report style contains one or more sections that map to groups in the report:

Single-section report styles: Tabular, Form, Mailing Label, Form Letter

Multiple section report styles: Group Left, Group Above, Matrix, Matrix with Group

For the report styles that support multiple groups, you can create additional sections as needed. Sections are mapped to groups as follows:

Same number of groups as sections: one-to-one mapping (the first section is mapped to the first group, the second section to the second group, and so on).

More groups than sections: one-to-one mapping until the next-to-last section. Then, all subsequent groups are mapped to the next-to-last section, and the last group is mapped to the last section. If only one section exists, all groups are mapped to it.

More sections than groups: one-to-one mapping until the next-to-last group. Then, the last group is mapped to the last section.

See also

Section 4.12.2, "Defining default template attributes"

Section 4.12.3, "Defining override template attributes"

2.7.3 About applying templates

When you apply a template to a report, all of the following objects, properties, and attributes from the template are applied to the current report section:

  • parameters and their validation triggers

  • physical page size

  • logical page size

  • character/bitmap mode

  • margin position

  • panel print order

In addition, all of the layout objects in the margin of the template are copied into the same location in the current report section.

Usage notes

  • The template will be applied to the current section of the report (the section displayed in the Paper Layout view) by default. If no section is displayed, the template will be applied to the Main Section of the report by default. If you select the node for the entire report in the Object Navigator, the template will be applied to the Main Section of the report by default. To apply the template to a specific section of your report, select the node for that section in the Object Navigator.

  • You can apply different templates to each section of the report. However, if you are applying one of the default templates, you cannot combine two report blocks that use different default templates in a single report. All of your report blocks in any one report must use the same default template.

See also

Section 4.12.4, "Applying a template to a report"

2.7.4 About inheritance in templates

In templates, Sections, Frames, Fields, Labels, Headings, and Summaries properties all may inherit their values.

Default properties

The Default properties inherit the values preset by Oracle Reports Builder. When a property is set to its default Oracle Reports Builder value, the icon next to it in the Property Inspector is a small circle. Default properties become localized when you change their values, or select them and click the Localize Property button in the toolbar. When a property is localized, the icon next to it changes to a square. To return the properties to their inherited values, select the properties and click the Inherit Property button in the toolbar.

Override properties

The properties of Override Sections inherit their values from the Default properties. When a property inherits from a Default property, the icon next to it in the Property Inspector is an arrow. Properties in the Override Sections become localized when you change their values, or select them and click the Localize Property button in the toolbar. When a property is localized, the icon next to it changes to an arrow with a red cross through it. To return the values of properties in the Override Sections to their inherited values, select the properties and click the Inherit Property button in the toolbar.

2.7.5 About the Template Editor

The Template Editor is a work area in which you can define objects and formatting properties for your templates. It is similar to the Paper Layout view of the Report Editor. You can create, delete, and modify objects (for example, page numbers, text, and graphics) in the margin area. You cannot create and delete objects in the body area, but you can modify the properties of body objects in the Property Inspector (Tools > Property Inspector).

The Report Style list enables you to view the layout for a selected report style. To define default settings for all report styles, you can choose Default from the Report Style list. To make changes for an individual report style, you can select that report style from the Report Style list to specify settings that override the default.

Access

You can access the Template Editor in the following ways:

When creating a new template:

  • Choose File > New > Template.

  • In the Object Navigator, click the Templates node, then click the Create button in the toolbar.

When displaying an existing template:

  • From the Window menu, choose a window displaying Template Editor Paper Layout view.

  • In the Object Navigator, double-click the view icon next to the Paper Layout node for a template.

PK;$88PKa3wEOEBPS/orbr_fotoc001.htmM Prerequisites for This Example

35.1 Prerequisites for This Example

To build the example in this chapter, you must have the example files we have provided (see "Example Scenario", above), as well as access to the Sales History sample schema provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

PKϵPKa3wEOEBPS/orbr_hdr_db002.htm: Create a Data Model and a Group Left Layout

17.2 Create a Data Model and a Group Left Layout

When you are creating a single-query report, such as this one, you can use the Report Wizard to create the data model and layout simultaneously.

To create a data model and layout:

  1. Launch Reports Builder (or, if already open, choose File > New > Report)

  2. In the Welcome or New Report dialog box, select Use the Report Wizard, then click OK.

  3. If the Welcome page displays, click Next.

  4. On the Report Type page, select Create Paper Layout Only, then click Next.

  5. On the Style page, type a Title for your report, select Group Left, then click Next.

  6. On the Data Source page, click SQL Query, then click Next.

  7. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT DEPARTMENT_ID, FIRST_NAME, LAST_NAME, JOB_ID, SALARY 
    FROM EMPLOYEES 
    ORDER BY DEPARTMENT_ID, EMPLOYEE_ID
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called heading_code.txt into the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field.


  8. 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 17.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  9. On the Groups page, click DEPARTMENT_ID and click the right arrow (>) to move this field to the Group Fields list, then click Next.

  10. On the Fields page, click the double right arrows (>>) to move all of the fields to the Displayed Fields list, then click Next.

  11. On the Totals page, click Next.

  12. On the Labels page, change the labels as follows, then click Next:

    FieldsLabels

    DEPARTMENT_ID

    Department

    JOB_ID

    Job


  13. On the Template page, click Finish to display your report output in the Paper Design view.

  14. In the Paper Design view, click the first number value underneath the Salary label.


    Tip:

    If you are familiar with format mask syntax, you could now right-click the field values, choose Property Inspector, and choose or manually enter a value for the Format Mask property.


  15. Click the Currency button in the toolbar. A currency symbol immediately appears next to all of the values.

  16. Click the Add Decimal Place button twice. Two decimal places are added to the right of the decimal point.

  17. Resize the field by clicking and dragging the rightmost handle of the field approximately 0.5 inches (1.5 centimeters) to the left.

  18. Shift-click the Salary label itself.

  19. Click the Align Right button in the toolbar. All of the values and the Salary label are immediately right aligned.

  20. Click the first department number value under the Department label to select it.

  21. Click the Align Center button in the toolbar.

    Your report should look something like this:

    Figure 17-2 Group left report output with values formatted

    Description of Figure 17-2 follows

  22. Save your report as headingdb_your_initials.rdf.

PK3PKa3wEOEBPS/orbr_pagenum002.htm$ Create a Data Model and a Group Above Layout

19.2 Create a Data Model and a Group Above Layout

When you are creating a single-query report, such as this one, you can use the Report Wizard to create the data model and layout simultaneously.

To create a data model and group above layout:

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Use the Report Wizard, then click OK.

  3. If the Welcome page displays, click Next.

  4. On the Report Type page, select Create both Web and Paper Layout, then click Next.

  5. On the Style page, type a Title for your report, select Group Above, then click Next.

  6. On the Data Source page, click SQL Query, then click Next.

  7. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT ENAME, REPID, CUSTID, NAME, ADDRESS, TRIM(CITY)||',
    '||STATE||'  '||ZIP LOCATION,  AREA||' '||PHONE, CREDITLIMIT 
    FROM EMP, CUSTOMER 
    WHERE EMPNO = REPID 
    ORDER BY REPID
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called pagenum_code.txt into the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field.


  8. 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 19.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  9. On the Groups page, click ENAME in the Available Fields list and click the right arrow (>) to move this field to the Group Fields list.

  10. Move REPID to the Group Fields list, too, then click Next.

    Figure 19-2 Selecting group fields in the Report Wizard

    Description of Figure 19-2 follows

  11. On the Fields page, click the double right arrows (>>) to move all of the fields to the Displayed Fields list, then click CUSTID and click the left arrow (<) to move it back to the Available Fields list, then click Next.

  12. On the Totals page, click Next.

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

    FieldsLabelsWidth

    ENAME

    Rep Name

    10

    REPID

    Rep ID

    6

    NAME

    Customer Name

    20

    ADDRESS

    Address

    20

    LOCATION

    Location

    20

    AREA_PHONE

    Area Phone

    12

    CREDITLIMIT

    Credit Limit

    8


    Figure 19-3 Specifying labels and widths in the Report Wizard

    Description of Figure 19-3 follows

  14. On the Template page, click Finish to display your report output in the Paper Design view.

  15. Save the report as pagenum_your_initials.rdf.

PKk4;[$$PKa3wE OEBPS/toc.ncx. Oracle® Fusion Middleware Oracle Reports User's Guide to Building Reports, 11g Release 1 (11.1.1) Cover Title and Copyright Information Contents List of Examples List of Figures List of Tables Preface 1 Basic Concepts 2 Advanced Concepts 3 Visual Index 4 How To... Part I Building Basic Reports 5 Building a Tabular Report 6 Building a Mailing Label Report 7 Building a Form Letter Report 8 Building a Master/Master Report 9 Building a Summary Report Part II Building Group Reports 10 Building a Single-Query Group Report 11 Building a Two-Query Group Report 12 Building an Across Group Report 13 Building a Group Left Summary Report 14 Building a Group Left Formula Report Part III Building Reports with Special Formatting 15 Building a Wrapped Field Report 16 Building a Header and Footer Report 17 Building a Header with Database Values Report 18 Building a Report with Graphics, Text, and Color 19 Building a Report that Renumbers Pages by Repeating Frame 20 Building an Intermixed Fields Report 21 Building a Report that Suppresses Labels 22 Building a Report with Conditional Highlighting 23 Building a Conditional Form Letter Report 24 Building a Report with Dynamic Graphics Part IV Building Matrix Reports 25 Building a Matrix Report 26 Building a Nested Matrix Report 27 Building a Matrix with Group Above Report Part V Building Reports for Business Cases 28 Building a Time Series Calculations Report 29 Building a Report for Enhanced Spreadsheet Output 30 Building a Report with Aggregate Data 31 Building a Check Printing Report with Spelled-Out Cash Amounts 32 Building a Report Using a Preprinted Form 33 Building an Invoice Report 34 Building a Ranking Report 35 Building a Paper Report with a Simple Table of Contents and Index 36 Building a Paper Report with a Multilevel Table of Contents 37 Bursting and Distributing a Report 38 Building a Report with Multibyte Characters for PDF Output Part VI Building Reports with PL/SQL and Java 39 Building a Report with Graphs 40 Building a Report that Includes PL/SQL 41 Building a Paper Report with REF CURSORs 42 Building a Simple Parameter Form for a JSP-based Web Report 43 Building a Report with a Barcode 44 Building an Accessible JSP-based Web Report Part VII Building Reports with Pluggable Data Sources 45 Building a Report with an XML Pluggable Data Source 46 Building a Report with a Text Pluggable Data Source A Tool Palette and Toolbar Reference Glossary Index Copyright PKoJ ..PKa3wEOEBPS/orbr_matrixgroup002.htm Create a Matrix Group Data Model and Layout

27.2 Create a Matrix Group Data Model and Layout

Since this report is a single-query report, it is easiest to build it with the Report Wizard.

To create the data model and layout with the Report Wizard:

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Use the Report Wizard, then click OK.

  3. If the Welcome page displays, click Next.

  4. On the Report Type page, select Create Paper Layout Only, then click Next.

  5. On the Style page, type a Title for your report, select Matrix with Group, then click Next.

  6. On the Data Source page, click SQL Query, then click Next.

  7. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT TO_CHAR(HIREDATE, 'YY') YEAR, DEPTNO, JOB, SUM(SAL) 
    FROM EMP
    GROUP BY TO_CHAR(HIREDATE, 'YY'), DEPTNO, JOB
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called matrixgroup_code.txt into the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field.


  8. 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 27.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  9. On the Groups page, click YEAR in the Available Fields list and click the right arrow (>) to move this field to the Matrix Group Fields list, then click Next.

  10. On the Rows page, click DEPTNO in the Available Fields list and click the right arrow (>) to move this field to the Matrix Row Fields list, then click Next.

  11. On the Columns page, click JOB in the Available Fields list and click the right arrow (>) to move this field to the Matrix Column Fields list, then click Next.

  12. On the Cell page, click SUM_SAL in the Available Fields list and click the right arrow (>) to move this field to the Matrix Cell Fields list, then click Next.


    Note:

    In this case, the query itself performs the summary through the SUM function. Hence, you should not use the Sum button in this instance.


  13. On the Totals page, click SUM_SAL in the Available Fields list and click Sum to move this field to the Matrix Totals list, then click Next.

  14. On the Labels page, remove the label for SUM_SAL, then click Next.

  15. On the Template page, select No Template, then click Finish to display your report output in the Paper Design view. It should look something like this:

    Figure 27-2 Paper Design view for matrix with group above report

    Description of Figure 27-2 follows

  16. Save the report as matrixgroup_your_initials.rdf.

PKݴUPKa3wEOEBPS/orbr_hdr_db003.htm  Add Summary Columns for the Header Data

17.3 Add Summary Columns for the Header Data

For the header that you want to create (that is, departments found on this page), you need to create two summary columns that compute the values you need in order to populate the header.

  1. In the Report Editor, click the Data Model button in the toolbar to display the Data Model view.

  2. Click the Summary Column tool in the tool palette, then click in an open area of the Data Model view to create a summary column.

  3. Double-click the new summary column object (CS_1) to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to FirstDeptRec.

    • Under Summary, set the Function property to First, set the Source property to DEPARTMENT_ID, set the Reset At property to Page.

  4. Create a second summary column, and set its properties as follows:

    • Under General Information, set the Name property to LastDeptRec.

    • Under Summary, set the Function property to Last, set the Source property to DEPARTMENT_ID, set the Reset At property to Page.

    Your data model should now look like this:

Figure 17-3 Data Model with Summary Columns for Header

Description of Figure 17-3 follows

PKd. PKa3wEOEBPS/orbr_mstrmstr004.htm: Use the Report Wizard to Layout the Data

8.4 Use the Report Wizard to Layout the Data

Once your data model is complete, you need to create a layout for the data objects to display in the report output. The Report Wizard enables you to create layouts for your data model.


Tip:

When you have multiple queries in your data model, make sure that you check the names of the groups associated with each query prior to entering the Report Wizard. The Report Wizard requires you to choose data for the layout by group name.


To create the layout:

  1. In the Data Model view, right-click on the canvas, then choose Report Wizard.

  2. In the Report Wizard, on the Report Type page, select Create Paper Layout only.

  3. On the Style page, select Tabular.

  4. On the Groups page, ensure that both groups from your data model appear in the Displayed Groups list.

  5. On the Fields page, click the double right arrows (>>) to move all of the fields to the Displayed Fields list.

  6. On the Template page, select Predefined Template and click Beige, then click Finish to display your report output in the Paper Design view. The output for the Department report should look something like this:

Figure 8-4 Paper Design view for the Master/Master report

Description of Figure 8-4 follows

PKԴb?:PKa3wEOEBPS/orbr_multoc007.htm Summary

36.7 Summary

Congratulations! You have successfully created a report with a multilevel table of contents. You now know how to:

  • create a multilevel table of contents for a large paper report.

  • Use the SRW.SET_FORMAT_ORDER built-in procedure to change the order in which the report sections are formatted.

  • create a format trigger that fetches the page numbers for categories and subcategories that you specify.

  • use the Report Block Wizard to create a simple group above report layout to display your table of contents.

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".

PKaVPKa3wEOEBPS/content.opf Oracle® Fusion Middleware Oracle Reports User's Guide to Building Reports, 11g Release 1 (11.1.1) en-US B32122-03 Oracle Corporation Oracle Corporation Oracle® Fusion Middleware Oracle Reports User's Guide to Building Reports, 11g Release 1 (11.1.1) 2013-07-12T03:33:54Z Helps you learn about the extensive capabilities of Reports Builder (the report-building component of Oracle Reports), how to build different types of reports, and how to customize your reports to meet a wide variety of requirements. PKjZ[ZPKa3wEOEBPS/orbr_dyngraph001.htm ] Prerequisites for This Example

24.1 Prerequisites for This Example

To build this example report, you will need access to the data source and the graphics we have provided. You will also need to install an extra table into the database, which contains the pictures for this report.

24.1.1 Access to the data source and installing the Pictures table

To build the example in this chapter, you must have access to the SCOTT sample schema provided with the Oracle Database. If you don't know if you have access to this sample schema, contact your database administrator.

You will also need to ask your database administrator to install the Pictures table by using the provided file called pictures.dmp.

24.1.2 Graphics for the report

Before you build this report, make sure the following images are in the dynamicgraphics directory where the sample report file is located:

  • NEW_YORK.TIF

  • BOSTON.TIF

  • DALLAS.TIF

  • CHICAGO.TIF

Although we have chosen to use TIF files in this example, you can use other graphic file formats, such as GIF, JPEG, and BMP.

Then, update your REPORTS_PATH in the Windows registry to include the directory where these images are located. The REPORTS_PATH is located under the Oracle Home entry in the Windows entry. When you edit the entry, add the full directory path of the location of your images.

On UNIX, you can set REPORTS_PATH in $ORACLE_HOME/bin/reports.sh.

PK. PKa3wEOEBPS/orbr_formula001.htm? Prerequisites for This Example

14.1 Prerequisites for This Example

To build the example in this chapter, you must have access to the Order Entry sample schema provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

PKD?PKa3wEOEBPS/orbr_visidx002.htmW Part 2: Building Group Reports

3.2 Part 2: Building Group Reports

This part of the manual explains the different kinds of report layouts.

3.2.1 Building a single-query group report

In this example, you will build a simple group left report using one query.

Group left and group above reports divide the rows of a report into "sets," based on common values in one or more of the columns, such as the department number in the preceding example. In the sample output below, notice that each department number prints only once. If the report above was not a group report, the department number would print once for each employee in the department rather than just once for the whole department.

Figure 3-7 Final output of the single-query group report example

Description of Figure 3-7 follows

For more information on building this example, refer to Chapter 10, "Building a Single-Query Group Report".

3.2.2 Building a two-query group report

In this example, you will build a group above report using two queries.

A two-query group report appears much the same as a single-query group report. Performance is the key issue when contrasting single-query and multiple-query group reports. In most cases, single-query reports will run faster than multiple-query reports. Multiple-query reports are, however, sometimes easier to understand conceptually and easier to maintain. For example, if you are in a situation where only a few users run the report and the report returns a relatively small number of records, you might want to use multiple queries to simplify maintenance and make the data model easier to understand. If you have many users and the report is quite large, then you should try to use a single-query report.

Figure 3-8 Final output of the two-query group report example

Description of Figure 3-8 follows

For more information on building this example, refer to Chapter 11, "Building a Two-Query Group Report".

3.2.3 Building an across group report

In this example, you will build an across group report that prints the values of a database column across the page instead of down.

Figure 3-9 Final output of the across group report example

Description of Figure 3-9 follows

For more information on building this example, refer to Chapter 12, "Building an Across Group Report".

3.2.4 Building a group left summary report

In this example, you will build a summary report that groups the summaries on the left in the report output.

This report consists of master records (Name, at the upper left of the figure below), detail records (Product, Itemtot, and Orderdate, to the upper right), and summary records (Product, and Sum Total). The summary calculates totals for the details under each master record. Notice that the column Product appears twice. With Reports Builder, you can display columns any number of times.

Figure 3-10 Final output of the group left summary report example

Description of Figure 3-10 follows

For more information on building this example, refer to Chapter 13, "Building a Group Left Summary Report".

3.2.5 Building a group left formula report

In this example, you will use the Report Wizard to set up your report and write the one query that selects all the necessary database columns. You will then manually create the two formula columns to calculate tax and order totals for each customer, then add the formula columns to your report. You will use a Group Left style report to make the data in the report easy to read.

Figure 3-11 Final output of the group left formula report example

Description of Figure 3-11 follows

For more information on building this example, refer to Chapter 14, "Building a Group Left Formula Report".

PKKiPKa3wEOEBPS/orbr_refcur006.htm  Add Summary Columns

41.6 Add Summary Columns

Now that your queries are complete and linked, the steps in this section will help you to create columns to summarize the data.

To add summary columns:

  1. In the Data Model view, click the Summary Column tool in the tool palette.

  2. Click inside the G_EMPLOYEE_ID group to create a summary column.

  3. Double-click the new summary column object (CS_1) to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to CS_classcount.

    • Under Summary, set the Function property to Count, set the Source property to employee_id, and set the Reset At property to G_department_id.

    You have now created a summary that counts up the number of employees. You will not use the summary in this report's layout, but you will use it as the source for other, more interesting summaries later.

  4. Repeat the steps above to create summaries with the following characteristics:

    Table 41-2 Summary Characteristics

    Create in GroupNameFunctionSourceReset At

    G_conlabel

    CS_conlabel_classcount

    Sum

    CS_classcount

    G_conlabel

    G_department_id

    CS_port_count

    Sum

    CS_conlabel_classcount

    G_DEPARTMENT_ID


    You may not understand these summaries now. Their purpose will become clearer when you create the report layout and preview the live data.

    Your data model should look similar to the following:

    Figure 41-7 Data model with summary columns

    Description of Figure 41-7 follows


    Note:

    You can also compare your results to the file we have provided, called ref_emp65.rdf.


  5. Save the report as ref_65_your_initials.rdf.

PKǢ PKa3wEOEBPS/orbr_grpl_multi004.htm' Use the Report Wizard to Layout the Data

11.4 Use the Report Wizard to Layout the Data

Once your data model is complete, you need to create a layout for the data objects to display in the report output. The Report Wizard enables you to create layouts for your data model.


Tip:

When you have multiple queries in your data model, make sure that you check the names of the groups associated with each query prior to entering the Report Wizard. The Report Wizard requires you to choose data for the layout by group name.


To create the layout:

  1. In the Data Model view, right-click on the canvas, then choose Report Wizard.

  2. In the Report Wizard, on the Report Type page, select Create Paper Layout only.

  3. On the Style page, select Group Above.

  4. On the Groups page, ensure that both groups from your data model appear in the Displayed Groups list.

  5. On the Fields page:

    • Click the double right arrows (>>) to move all of the fields to the Displayed Fields list.

    • Click REPID in the Displayed Fields list and click the left arrow (<) to move it back to the Available Fields list. Since REPID and EMPNO represent the same value, you only need to display one of them. EMPNO is part of the master group, which is the level where we want to see its values in the report. REPID is part of the detail group. Hence, you remove REPID from the Displayed Fields list to prevent it from appearing in the output.

    Figure 11-4 Fields page of the Report Wizard

    Description of Figure 11-4 follows

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

    Table 11-1 Field description of Labels page

    FieldsLabelsWidth

    PRODNAME

    Product

    22

    AMOUNT

    (no change)

    10

    CUSTNAME

    Customer

    15

    ENAME

    Name

    (no change)

    EMPNO

    Emp. No.

    (no change)


  7. On the Template page, make sure Beige is selected under Predefined Template, then click Finish to display your report output in the Paper Design view. It should look like this:

    Figure 11-5 Paper Design view for the two-query group report

    Description of Figure 11-5 follows

PK1m,'PKa3wEOEBPS/orbr_hdr_ftr004.htmW Add a Page Heading

16.4 Add a Page Heading

Now that you have added the repeating frame footer, it is time to add a page header. You perform this task from the Paper Layout view.

  1. In the Paper Layout view, click the Edit Margin button in the toolbar.

  2. From the font lists in the toolbar, choose Arial Black, point size 16.

  3. Click the Text tool in the tool palette.

  4. Click somewhere to the right of the logo image and type the following text:

    Employee Summary Report
  5. Move to an open area of the Paper Layout view and click the mouse button to exit text mode. Notice that the text object you just created is still selected, you can now adjust its positioning with the arrow keys. If you click in an open area a second time, the object is deselected.


    Note:

    Similarly, you can add a page footer, below the page margin.


  6. Click the Run Paper Layout button in the toolbar to display your report in the Paper Design view. It should look like the following:

    Figure 16-4 Group left report output with page heading

    Description of Figure 16-4 follows

  7. Save the report as headfoot_your_initials.rdf.

PK$sT\ W PKa3wEOEBPS/orbr_maillab004.htmf Summary

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".

PKbwPKa3wEOEBPS/orbr_xmlpds001.htmJ Prerequisites for This Example

45.1 Prerequisites for This Example

To build the example in this chapter, you must have the example files we have provided (see "Example Scenario", above), as well as access to the Order Entry sample schema provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

PKuPKa3wEOEBPS/orbr_preprint002.htmQ- Manually Create the Data Model for Your Report

32.2 Manually Create the Data Model for Your Report

The steps in this section will show you how to manually create the data model for your report. Your data model will consist of two linked queries. The first query will retrieve all the customers that have orders in the database. The second query will retrieve all of the order information for each of the customers, and will contain a break group based on the date of each order.

32.2.1 Create the queries

The steps in this section will show you how to manually create two queries in the Data Model view.

To create the queries:

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Build a new report manually, then click OK.

  3. In the Data Model view that displays, click the SQL Query tool in the tool palette then click in an open area of the Data Model view to display the SQL Query Statement dialog box.

  4. In the SQL Query Statement field, enter the following SELECT statement:

    SELECT FIRST_NAME||' '||LAST_NAME EMPLOYEE_NAME
      , CUST_FIRST_NAME||' '||CUST_LAST_NAME CUSTOMER_NAME
      , CUST_ADDRESS
      , CUSTOMER_ID 
    FROM EMPLOYEES, CUSTOMERS 
    WHERE EMPLOYEE_ID = ACCOUNT_MGR_ID 
    AND CUSTOMER_ID IN (SELECT UNIQUE(CUSTOMER_ID) FROM ORDERS)
    ORDER BY LAST_NAME, CUST_LAST_NAME
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called preprint_code.txt into the SQL Query Statement field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the SQL Query Statement field.


  5. Click OK.


    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 32.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  6. If the Connect dialog box displays, type the connection information for the database where the Order Entry sample schema resides, then click Connect.

    The query displays in the Data Model view, and should look something like this:

    Figure 32-2 Data Model view of the first query

    Description of Figure 32-2 follows

  7. Right-click the query (Q_1), then choose Property Inspector from the pop-up menu.

  8. In the Property Inspector, under General Information, set the Name property to Q_CUSTOMER.

  9. Double-click the group (G_EMPLOYEE_NAME) to display the Property Inspector, and set the Name property to G_CUSTOMER.

  10. In the Data Model view, click the SQL Query tool in the tool palette to create a second query with the following SELECT statement:

    SELECT to_char(ORDER_DATE, 'DD-Mon-YY') ORDER_DATE
      , I.PRODUCT_ID
      , PRODUCT_DESCRIPTION
      , QUANTITY
      , UNIT_PRICE
      , QUANTITY * UNIT_PRICE ITEM_TOTAL
      , CUSTOMER_ID
    FROM ORDERS O, ORDER_ITEMS I, PRODUCTS P 
    WHERE O.ORDER_ID = I.ORDER_ID 
    AND I.PRODUCT_ID = P.PRODUCT_ID 
    ORDER BY ORDER_DATE, I.PRODUCT_ID 
    
  11. Right-click the query object, then choose Property Inspector from the pop-up menu.

  12. In the Property Inspector, set the Name property to Q_ORDERS.

  13. Double-click the new group object to display the Property Inspector.

  14. In the Property Inspector, set the Name property to G_ORDER_ITEMS.

    Your data model should now look like this:

    Figure 32-3 Data Model view with two queries

    Description of Figure 32-3 follows


    Note:

    In Q_CUSTOMER, the second WHERE clause restricts the values returned to only those customers who have current orders. In Q_ORDERS, we have used "to_char" to account for a new datatype, "Datetime." Since this new datatype is not recognized by Oracle Reports, you cannot use format masks on this particular column yet.


  15. Save your report as preprint_your_initials.rdf.

32.2.2 Modify your data model

The steps in this section will show you how to modify your data model to link the two queries and to cause the data retrieved to break on a particular column.You will also create several summary columns to calculate information for each order.

To modify your data model:

  1. In the Data Model view, click the Data Link tool in the tool palette.

  2. Click the CUSTOMER_ID column in the G_Customer group.

  3. While holding down your mouse button, drag your cursor to the CUSTOMER_ID1 column in the G_ORDER_ITEMS group and release your mouse button to create a link between the two queries.

  4. Now, create a break group by clicking the ORDER_DATE column in the G_ORDER_ITEMS group and dragging it above the group.


    Tip:

    You can select the group or the query title and use the resize handles to modify the look of your data model.


    Your data model should now look like this:

    Figure 32-4 Data Model view of the linked queries and break group

    Description of Figure 32-4 follows

  5. Click the Summary Column tool in the tool palette, then click in the G_CUSTOMER group to create a summary column. You may want to resize the group so that you can see your summary columns.

  6. Double-click the new summary column object (CS_1) to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to CS_PAGE_TOTAL.

    • Under Summary, set the Function property to Sum, set the Source property to ITEM_TOTAL, and set the Reset At property to Page.

  7. Create another summary column in the G_CUSTOMER group, and set its properties as follows:

    • Under General Information, set the Name property to CS_ORDER_TOTAL.

    • Under Summary, set the Function property to Sum, set the Source property to ITEM_TOTAL, and set the Reset At property to G_CUSTOMER.


      Note:

      These two summary columns calculate the total items per page and the total items in the order for the report.


    Your data model is now complete, and should look like this:

    Figure 32-5 Complete Data Model view of the preprinted forms example

    Description of Figure 32-5 follows

  8. Save your report.

PK0V-Q-PKa3wEOEBPS/orbr_nestedmatrix001.htmC Prerequisites for This Example

26.1 Prerequisites for This Example

To build the example in this chapter, you must have access to the SCOTT sample schema provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

PK,-T(HCPKa3wEOEBPS/orbr_cndfrm005.htm. Summary

23.5 Summary

Congratulations! You have successfully created a conditional form letter report. You now know how to:

  • create a data model and a layout.

  • add text.

  • anchor objects together and create format triggers to control whether the text displays.

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".

PK%PKa3wEOEBPS/orbr_timeseries.htm Building a Time Series Calculations Report

28 Building a Time Series Calculations Report

In this chapter, you will learn about reports that show data based on calculations over a period of time. By following the steps in this chapter, you can generate the report output shown in Figure 28-1.

Figure 28-1 Time series calculations report output

Description of Figure 28-1 follows

Concepts

Reports with time series calculations calculate values over a specified period of time. The techniques described for this report can be used to produce other formats of time series calculations, as well.

Data Relationships

This time series calculations report uses a query that will compute four-month moving averages of customer purchases. The SELECT statement will sum the current purchase (TOTAL) with purchases made by that customer in the previous four months, then average that sum through use of a self-join. For example, if the data queried is 30-JUL-00, Oracle Reports will average all purchases the customer made between 30 MAR-00 and 30-JUL-00.

Example Scenario

In this example, you will use the Report Wizard to create a simple time series calculations report for both paper and the Web that calculates and displays the four-month average of purchases for each customer. For the JSP-based Web report, you will modify the Web source to change labels and add format masks.

As you build this example report, you will:

To see a sample time series calculations report, open the examples folder named timeseries, then open the Oracle Reports example called timeseries.rdf. For details on how to open it, see "Accessing the Example Reports" in the Preface.

PK0PKa3wEOEBPS/orbr_dist003.htmv Edit the Distribution XML Definition

37.3 Edit the Distribution XML Definition

The Oracle Reports distribution XML file enables you to specify the details of your distribution. For example, if you are distributing through e-mail, you can specify such details as the addressee, the reply to address, and the subject.

In this section, you will learn how to modify a distribution XML file. We have indicated locations where you need to enter your own information to make the distribution work.

When you want to distribute a report, you need to either:

  • Make sure your source report (for example, inventory_report_dist.rdf) and your distribution XML file (for example, distribution.xml) are in the same directory.

    OR

  • When you run the report from the Reports Server, set the destination to the path of the XML file. (This is explained in Section 37.4, "Run the Report".)


Note:

For more information on distribution, see the chapter "Creating Advanced Distributions" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.


To edit the distribution XML file:

  1. In a text editor, such as Notepad, open the sample distribution.xml file we have provided.

  2. Find the placeholder text: <YourFilePath>, and replace it with the location of where your resulting PDFs will be stored.

    Example: Replacing the placeholder text with:

    d:\temp\
    

    changes the path to:

    d:\temp\Rep_%amp;&lt;city&gt;.pdf
    

    Using this complete path places the resulting PDF files in d:\temp.

  3. Find the placeholder text: <OriginEmailAddress>, and replace it with the sender's e-mail address.

  4. Perform step 3 for all instances of the placeholder text: <OriginEmailAddress>.

  5. Find the placeholder text: <DestinationEmailAddress>, and replace it with the recipient's e-mail address.

  6. Perform step 5 for all instances of the placeholder text: <DestinationEmailAddress>.


    Note:

    For this example, we show you how to send e-mails to static e-mail addresses. However, if you want to send the report to various e-mail destinations, you must create a recipient field in your data model. Then, in the ex2 section of distribution.xml, replace the placeholder text <DestinationEmailAddress> with &amp;&lt;recipient&gt;. You can then delete the first section of the distribution.xml file (marked ex1).


  7. Save the XML file to the same directory where you have saved inventoryreport_dist_your_initials.rdf.


    Note:

    It is not required that you save the XML file to the same directory where your RDF is located, as you can specify the location of the XML file at runtime. Either distribution.xml and RDF must be in Reports Path, or provide the complete path in the command line URL.


    You have finished customizing the distribution XML file to send a single e-mail to corporate headquarters with all of the individual warehouse reports, and multiple e-mails with a single attachment each to the individual warehouses.

PKTA{vPKa3wEOEBPS/orbr_concepts2001.htmF~ Reports

2.1 Reports

The topics in this section build on the basic concepts discussed in Section 1.2, "Reports".

2.1.1 About report titles

You can add a title to a report in either of the following ways:

  • Manually, by creating a boilerplate text object in the margin of the Paper Layout view.

  • Typing in the Title field on the Style page of the Report Wizard.

When you use the Report Wizard to add a title and do not select a template for your report output, the title is inserted into the margin of the report with default attributes defined by Oracle Reports Builder. You can modify the attributes in the Paper Layout view.

When you use the Report Wizard to add a title, and do select a predefined template or a user-defined template file for your report output, Reports Builder looks for a boilerplate text object named B_OR$REPORT_TITLE defined for the selected template:

  • If B_OR$REPORT_TITLE exists, the title is displayed using the attributes of this object, with the text you typed in the Report Wizard.

  • If B_OR$REPORT_TITLE is not found, the title is displayed using the attributes defined by the Default properties (under the Title node in the Property Inspector) of the selected template.


    Note:

    If you do not specify a title in the Report Wizard, the B_OR$REPORT_TITLE object is not copied to your report.


For layouts created using the Report Block Wizard, the title is inserted into the new layout as a group title rather than into the margin of the report. In this case, the attributes are set per the Default properties (under the Title node in the Property Inspector) of the selected template, and B_OR$REPORT_TITLE is ignored. If you do not select a template, the title uses the default attributes defined by Oracle Reports Builder.

See also

Section 4.5.6, "Adding a title to a report"

Section 4.12.5, "Formatting the report title in a template"

Section 2.7.1, "About templates"

2.1.2 About report sectioning and sections

Report sectioning enables you to define multiple layouts in the same report, each with a different target audience, output format, page layout, page size, or orientation. You can define up to three report sections, each with a body area and a margin area: the names of the sections are Header, Main, and Trailer. By default, a report is defined in the Main section. In the other sections, you can define different layouts, rather than creating multiple separate reports. If you wish, you can use the margin and body of the Header and Trailer sections to create a Header and Trailer page for your reports.

In the Object Navigator, the report sections are exposed in the Object Navigator under the Paper Layout node as Header Section, Main Section, and Trailer Section.

You can specify the order in which the three sections of a report (Header, Main, and Trailer) are formatted using SRW.SET_FORMAT_ORDER or the Format Order of Sections property. This capability allows Oracle Reports to format any section first to create information that is only known at the time of formatting, such as page numbers, then use that information in the formatting of another section. As an example, this property can be used to create a table of contents. For an example of using SRW.SET_FORMAT_ORDER for this purpose, see Chapter 35, "Building a Paper Report with a Simple Table of Contents and Index" and Chapter 36, "Building a Paper Report with a Multilevel Table of Contents".

For an example of using section-level distribution, see Chapter 37, "Bursting and Distributing a Report". This chapter covers defining distribution of a single section to multiple destinations, using the Repeat On property and a sample distribution XML file. For information about advanced section-level distribution and creating your own distribution XML file, see the chapter "Creating Advanced Distributions" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services .

Examples

Example 1

You can use sectioning and distribution to publish your report output in HTML, and also send a PostScript version to the printer.

Example 2

You can send an executive summary of the report to senior management, and also e-mail detailed breakdowns to individual managers. In this example, a single report with two report sections needs to be created: a portrait-sized summary section and a landscape-sized detail section. Use the Repeat On property to associate the detail section with a data model group that lists the managers and then alter the destination on each instance of the data model group to send the output to the appropriate managers.

See also

Section 2.8.3, "About report distribution"

Section 4.10.1, "Displaying a section layout view"

Section 4.10.2, "Creating a default layout for a section"

2.1.3 About the report unit of measurement

A report can be defined using inches, centimeters, or points. The unit of measurement is independent of the device on which you build the report. As a result, you can design reports that will run on any platform on which Reports Builder runs. You can change a report's unit of measurement in these ways:

  • Setting the Unit of Measurement property.

  • Converting the report using rwconverter, specifying a different unit of measurement with the DUNIT keyword.

  • Opening the report in a different environment. For example, if you open a character-mode report, Reports Builder will change the report's unit of measurement to the bit-mapped environment's default. If you then save the report, it will be saved with the new unit of measurement.

2.1.4 About the report dimensions

A report page can have any length and any width. Because printer pages may be smaller or larger than your paper report's "page," the concept of physical and logical pages is used. A physical page is the size of a page that is output by your printer. A logical page is the size of one page of your report; one logical page may be made up of multiple physical pages.

For each section (header, main, trailer) of a report:

  • you specify the dimensions of the physical page (including the margin) using the Width property and Height property.

  • you specify the dimensions of the logical page (report page) in physical pages (printer pages) using the Horizontal Panels per Page property (width) and the Vertical Panels per Page property (height). For example, a Horizontal Panels per Page size of 1 means that each logical page is one physical page wide, and a Vertical Panels per Page size of 2 means that each logical page is two physical pages in height.

In this example, one logical page is made up of six physical pages. The logical page is three physical pages wide and two physical pages high. Consequently, Horizontal Panels per Page size is 3 and Vertical Panels per Page size is 2. If you wanted the logical page to be two physical pages wide and three physical pages high, you would specify a Horizontal Panels per Page size of 2 and a Vertical Panels per Page size of 3.

Figure 2-1 Report dimensions

graphic depicting physical vs logical pages

2.1.5 About fonts in reports

For detailed information about using and adding fonts in Oracle Reports, including font configuration files, font aliasing, troubleshooting font issues, and font types, refer to the chapter "Managing Fonts in Oracle Reports" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.

2.1.6 About conditional formatting

Using the Conditional Formatting and Format Exception dialog boxes, you can specify output formatting attributes (font and color) for a selected layout object based on conditions that exist. The conditions that you define are called format exceptions.

You can display the Conditional Formatting dialog box from the Paper Layout view or Paper Design view in any of the following ways:

  • Double-click the object to display the Property Inspector. Under the General Layout node, click the Conditional Formatting value field (labeled...).

  • Display the pop-up menu (right-click in Windows) for the object.

  • Click the object, then choose Format > Conditional Formatting.

The Format Exception dialog box displays when you click New or Edit in the Conditional Formatting dialog box, and enables you to quickly and easily specify output formatting attributes for a selected layout object based on defined conditions. After you specify conditions and formatting for the current layout object in the Format Exception dialog box, the entire definition is exported to a PL/SQL format trigger. If a format trigger already exists for the layout object, the definition in the Format Exception dialog box overwrites the existing trigger code when you confirm the Oracle Reports Builder prompt.

You can edit the format trigger manually through the PL/SQL Editor; however, if you subsequently modify the definition using the Format Exception dialog box, Oracle Reports Builder displays a prompt to overwrite the existing format trigger.

See also

Section 4.9.1.5, "Applying conditional formatting to a layout object"

2.1.7 About nested matrix reports

A nested matrix report is a matrix report in which at least one parent/child relationship appears within the matrix grid.

A nested matrix report has more than two dimensions; therefore, it has multiple dimensions going across or down the page. For example, see . Notice that for each year there is a nested list of related departments. Also notice that the list of jobs (the across values) appears only once. Because the job values appear only once, a summary of each category of jobs can be made to line up with the values it summarizes.


Note:

In a nested matrix report, where you create a matrix query that has a child matrix query, the fields on which you join should be separated into a separate group in your master matrix. Otherwise, on some platforms, only the first group prints.


For a detailed example, see Chapter 26, "Building a Nested Matrix Report".

See also

Section 2.3.7, "About matrix objects"

Section 1.3.7, "About matrix reports"

2.1.8 About matrix with group reports

A matrix with group report is a group above report with a separate matrix for each value of the master group. For example, for each year (master) in the report below there is a unique matrix that contains only that year's departments and jobs. This means that a summary of each job category may not line up with the values it summarizes because the position of each job category in the matrix may vary for each year.

A multiquery matrix with group report is similar to a nested matrix report in that it has more than two dimensions. For example, in the following report, notice that for each year there is a nested list of related departments.

Figure 2-2 Sample matrix with group and nested matrix report

matrix with group

The advantage of using multiple queries is that you get a real break, or master/detail relationship, for the nesting groups (for example, notice that in the multiquery example above, Year 80 shows only record 20; with a single query, Year 80 would show all records whether or not they contain data for Year 80). If you want to suppress detail records that do not contain data for a particular master record, you must use multiple queries.

For a complete example, see the example report in Chapter 27, "Building a Matrix with Group Above Report".

See also

Section 2.3.7, "About matrix objects"

Section 1.3.7, "About matrix reports"

PKUFFPKa3wEOEBPS/orbr_mstrmstr006.htm ! Format a Field

8.6 Format a Field

In the Paper Design view, notice the Salary field. The values are neither aligned nor displayed as monetary amounts. You can quickly rectify this in the Paper Design view.

To assign a format mask to monetary values:

  1. In the Paper Design view, select the first number value underneath the Salary label in the second layout. Notice that all of the values are immediately selected, indicating that you can change their properties simultaneously.


    Tip:

    If you are familiar with format mask syntax, you could now right-click the field values, choose Property Inspector, and choose or manually type a value for the Format Mask property.


  2. Click the Currency button in the toolbar. A currency symbol immediately appears next to all of the values.

  3. Click the Add Decimal Place button twice. Two decimal places are added to the right of the decimal point.

  4. Click the Align Right button. All of the values are immediately right aligned.

  5. Save your report.

Figure 8-6 Paper Design view with monetary values formatted

Description of Figure 8-6 follows

PK_> PKa3wEOEBPS/orbr_invoice003.htmh Create a Data Model With a Data Link

33.3 Create a Data Model With a Data Link

When you create a report with multiple queries, it is typically easier to create all of the queries with the Data Wizard in the Data Model view. In this report, you will create two queries, linked with a group-to-group data link.

To create the queries:

  1. In the Data Model view, choose Insert > Query to display the Data Wizard.

  2. If the Welcome page displays, click Next.

  3. On the Query page, type Q_Order for the Query name, then click Next.

  4. On the Data Source page, select SQL Query, then click Next.

  5. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT 
       ORDER_ID, 
       ORDER_DATE, 
       ORDER_TOTAL, 
       ORDERS.CUSTOMER_ID, 
       SALES_REP_ID, 
       C1.CUST_FIRST_NAME, 
       C1.CUST_LAST_NAME, 
       C1.CUST_ADDRESS, 
       C1.CUSTOMER_ID, 
       C2.CUST_FIRST_NAME, 
       C2.CUST_LAST_NAME, 
       C2.CUST_ADDRESS, 
       C2.CUSTOMER_ID 
    FROM ORDERS, CUSTOMERS C1, CUSTOMERS C2 
    WHERE ORDERS.CUSTOMER_ID = C1.CUSTOMER_ID AND 
       ORDERS.SALES_REP_ID = C2.CUSTOMER_ID 
    

    This query joins the Orders table to the Customers table for customer information and sales representative information.


    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called invoice_code.txt into the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field.


  6. 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 33.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  7. On the Groups page, click Next.

  8. Click Finish to display your first query in the Data Model view.

  9. Repeat the steps above for a second query, but this time name your query Q_Item and use the following SELECT statement:

    SELECT 
       O.ORDER_ID, 
       O.LINE_ITEM_ID, 
       O.PRODUCT_ID, 
       O.QUANTITY, 
       O.UNIT_PRICE, 
       TRANSLATED_DESCRIPTION, 
       P.PRODUCT_ID, 
       O.QUANTITY * O.UNIT_PRICE 
    FROM ORDER_ITEMS O, PRODUCT_DESCRIPTIONS P 
    WHERE  O.PRODUCT_ID = P.PRODUCT_ID 
       AND P.LANGUAGE_ID = 'US' 
    

    This query joins Order items to the Product table for product descriptions.

  10. In the Data Model view, double-click the title bar of the G_ORDER_ID group (for the master query Q_ORDER) to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to G_ORDER.

  11. Double-click the title bar of the G_ORDER_ID1 group (for the detail query Q_ITEM) to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to G_LIST.

    Your data model should now look something like this:

    Figure 33-2 Queries in the Data Model view

    Description of Figure 33-2 follows

To add the data link:

  1. In the Data Model view, click the Data Link tool in the tool palette.

  2. Click and drag from the ORDER_ID column in the G_ORDER group to the ORDER_ID1 column in the G_LIST group. Notice that a line is drawn from the bottom of the G_ORDER group to the Q_Item query. Labels for ORDER_ID and ORDER_ID1 are created at each end of the line to indicate they are the columns linking G_ORDER to Q_Item.

PKWmhPKa3wEOEBPS/orbr_formula002.htm Use the Report Wizard to Create a Simple Report

14.2 Use the Report Wizard to Create a Simple Report

When you create a report, you can either use the Report Wizard to assist you or create the report yourself. To build the simple 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.

To create a simple report:

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Use the Report Wizard, then click OK.

  3. If the Welcome page displays, click Next.

  4. On the Report Type page, select Create Paper Layout Only, then click Next.

  5. On the Title page, select Group Left, then click Next.

  6. On the Data Source page, click SQL Query, then click Next.

  7. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT ALL CUSTOMERS_A1.CUSTOMER_ID, ORDERS.ORDER_ID, ORDERS.ORDER_TOTAL
    FROM CUSTOMERS CUSTOMERS_A1, ORDERS
    WHERE (ORDERS.CUSTOMER_ID = CUSTOMERS_A1.CUSTOMER_ID)
    ORDER BY CUSTOMERS_A1.CUSTOMER_ID
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called formula_code.txt into the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field.


  8. 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 14.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  9. On the Groups page, select CUSTOMER_ID and click the right arrow (>) to move this field to the Groups Fields list, then click Next.

  10. On the Fields page, click the double right arrow button (>>) to move all of the fields to the Displayed Fields list, then click Next.

  11. On the Totals page, click ORDER_TOTAL and click Sum, then click Next.

  12. 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 14-2 Paper Design view for the formula report

    Description of Figure 14-2 follows

  13. Save the report as formulareport_your_initials.rdf.

PKx2u PKa3wEOEBPS/orbr_aggregate004.htm\ Summary

30.4 Summary

Congratulations! You have successfully built a report that aggregates data, for both paper and Web. You now know how to:

  • create a report definition that aggregates data.

  • modify your report for the Web.

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".

PKh0PKa3wEOEBPS/orbr_dist.htm Bursting and Distributing a Report

37 Bursting and Distributing a Report

Oracle Reports enables you to deliver a single report to multiple destinations simultaneously. By taking advantage of this feature, you can create a single report, then send it in any format (layout driven formats, such as PDF or HTML, as well as data model driven formats, such as XML or delimited) to multiple destinations.

In this example, you will modify a simple report we have provided to burst each group to a separate report. You will then modify a sample distribution XML file to send an e-mail to each destination with an attachment based on the separate reports. You will also send multiple e-mails to the same e-mail address with a single attachment (the entire report).

Concepts

Oracle Reports enables you to deliver a single report to multiple destinations simultaneously. Using the distribution feature, you can set up your report to be distributed to an e-mail destination, a portal, a printer, or anywhere else when the report is run. This feature also enables you to improve performance, since you fetch the data only once for many different formats and destinations. Using distribution also reduces your maintenance overhead because you need only one job request to publish the report to multiple destinations. You can refine this further by sending the Header section to some recipients, the Main section to others, and the entire report to an entirely different recipient list.

For more information on bursting and distribution, see "Creating Advanced Distributions" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual, available .

Example Scenario

In this example, you are the report developer for a manufacturing company who needs to deliver monthly information to its warehouses. You will modify an existing report to burst on each warehouse ID, creating separate PDF reports for each warehouse. You will then edit the distribution XML file we have provided to e-mail each report as an attachment to the corresponding warehouses.

As you build this example report, you will:

To see a sample distribution report, open the examples folder named distribution, then open source\inventory_report_dist.rdf for report you will distribute, or result\inventory_report_dist.rdf for the report you will burst. For details on how to open these reports, see "Accessing the Example Reports" in the Preface. The example files used in this chapter are listed and described in Table 37-1.

Table 37-1 Example report files

FileDescription

distribution\source\
distribution.xml

The XML file that controls the distribution properties for your report.

distribution\source\
inventory_report_dist.rdf

The source report you will modify to burst and distribute.

distribution\result\
inventory_report_dist.rdf

The modified report you will burst and distribute.

distribution\result\REP_*.pdf

The PDFs that are generated when you distribute and burst your report.



Note:

The distribution.xml file we have provided for this example is specific to building this example report. A more comprehensive distribution.xml is shipped with Oracle Reports in the ORACLE_HOME\samples\demo directory; you can reuse this file for your own purposes so that you do not have to create one from scratch.


PKCPKa3wE OEBPS/lot.htmi List of Tables PK㌋niPKa3wEOEBPS/orbr_intermix002.htm7 Create a Data Model and a Layout

20.2 Create a Data Model and a Layout

When you are creating a single-query report, such as this one, you can use the Report Wizard to create the data model and layout simultaneously.

To create a data model and group above layout:

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Use the Report Wizard, then click OK.

  3. If the Welcome page displays, click Next.

  4. On the Report Type page, select Create Paper Layout Only, then click Next.

  5. On the Style page, type a Title for your report, select Group Above, then click Next.

  6. On the Data Source page, click SQL Query, then click Next.

  7. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT DEPT.DNAME, EMP.ENAME, EMP.SAL
    FROM DEPT, EMP
    WHERE (EMP.DEPTNO = DEPT.DEPTNO)
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called intermix_code.txt into the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field.


  8. 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 20.1, "Prerequisites for This example" describes the sample schema requirements for this example.


  9. On the Groups page, click DNAME in the Available Fields list and click the right arrow (>) to move this field to the Group Fields list.

    Figure 20-2 Group page of Report Wizard

    Description of Figure 20-2 follows

  10. Click Next.

  11. On the Fields page, click the double right arrows (>>) to move all of the fields to the Displayed Fields list, then click Next.

  12. On the Totals page, click Next.

  13. On the Labels page, change the labels as follows, then click Next:

    FieldsLabels

    DNAME

    Dept.

    ENAME

    Name

    SAL

    Salary


  14. On the Template page, click Finish to display your report output in the Paper Design view. It should look something like this:

    Figure 20-3 Paper Design view for intermixing fields report

    Description of Figure 20-3 follows

  15. Save the report as intermix_your_initials.rdf.

PK,<7PKa3wEOEBPS/orbr_summary005.htm( Summary

9.5 Summary

Congratulations! You have successfully created a summary report. You now know how to:

  • create a data model with summaries and lay out the data with the Report Wizard.

  • format fields in the Paper Design view.

  • examine the summaries and their properties.

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".

PKԈPKa3wEOEBPS/orbr_utf8004.htm Create a PDF Document of Your Report

38.4 Create a PDF Document of Your Report

Oracle Reports Builder supports multibyte characters in the PDF format. By generating the PDF file of your report, you have the advantages of being able to:

  • create the report output in a portable format.

  • use PDF font subsetting and PDF font embedding feature.


    Tip:

    Make sure you perform the following steps before you generate the file:

    • Change the registry entry for NLS_LANG to AMERICAN_AMERICA.UTF8.

    • Edit the uifont.ali file.

    • Edit the REPORTS_PATH registry entry.

    See Section 38.1, "Prerequisites for This Example" for more details.


To generate the PDF file:

  1. In Oracle Reports Builder, choose File > Generate to File > PDF.

  2. Save the report as multibyteutf8_your_initials.pdf.

  3. In the Runtime Parameter Form that displays, type the value PL (exactly as shown), and click the Run Report button to execute the report.

    The Report Progress dialog box is displayed and provides the print status of the PDF output. When the PDF is created, this dialog box disappears.

  4. Locate the PDF file (multibyteutf8_your_initials.pdf) and double-click to open the file.

It should look something like this:

Figure 38-7 PDF file of the report with Polish characters

Description of Figure 38-7 follows


Note:

You can open the PDF file on any computer and it will look exactly the same, without installing any Unicode font. This is because the PDF file includes the font used in the report.

Notice the default rough visual appearance of the characters in the PDF output. You can smooth the characters by using "smoothe lineart" setting in Acrobat Reader.


PKKZ`PKa3wEOEBPS/orbr_matrixgroup001.htmA Prerequisites for This Example

27.1 Prerequisites for This Example

To build the example in this chapter, you must have access to the SCOTT sample schema provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

PKt|FAPKa3wEOEBPS/orbr_matrixgroup.htm. Building a Matrix with Group Above Report

27 Building a Matrix with Group Above Report

In this chapter, you will learn about nested matrix with group above reports. By following the steps in this chapter, you can generate the report output shown in Figure 27-1.

Figure 27-1 Matrix with group above report output

Description of Figure 27-1 follows

Concepts

  • A matrix with group above report is a combination of a matrix and a group above report layout. Essentially, a matrix report is printed for each master group record. A matrix with group is similar to the multiquery nested matrix, except that in a matrix with group report, the parent exists above the cross product. In a multiquery nested matrix report with groups, the parent/child relationship exists within the across or down dimension of the cross product.

  • For additional conceptual information, see Section 2.1.8, "About matrix with group reports".

Data Relationships

This example of a matrix with group above report uses one query and at least five groups. At least one group is placed above the cross product to serve as the Master group.

Layout

This report uses the Matrix with Group layout style.

Example Scenario

In this example, you will create report that cross tabulates salaries by department and by job for each year. The result is a group report where year is the master and the detail is a matrix with job functions listed across the top, departments down the side, and sums of salaries in the cells. Thus, you can quickly determine the sum of all of the salaries for clerks in department 20 for any particular year.

As you build this example report, you will:

To see a sample matrix with group above report, open the examples folder named matrixgroup, then open the Oracle Reports example named matrixgroup.rdf. For details on how to access it, see "Accessing the Example Reports" in the Preface.

PK<,PKa3wEOEBPS/orbr_wrapped001.htmA Prerequisites for This Example

15.1 Prerequisites for This Example

To build the example in this chapter, you must have access to the Order Entry sample schema provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

PKFAPKa3wEOEBPS/orbr_aggregate001.htm= Prerequisites for This Example

30.1 Prerequisites for This Example

To build the example in this chapter, you must have access to the SCOTT sample schema provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

PKdB=PKa3wEOEBPS/orbr_matrix007.htm  Add a Grid

25.7 Add a Grid

Sometimes matrix reports are easier to read when they have grid lines that divide the cells from each other. For most objects, No Line is the default setting. To add grid lines, all you need to do is select the appropriate objects and give them a line color.

To add grid lines

  1. Open the matrix report which you previously modified to show zeroes instead of blanks.

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

  3. In the Object Navigator, choose View > Change Views > Object Type View.

  4. Select all of the following objects in the Object Navigator under the Paper Layout node using Ctrl-click:

    • F_SUMSUM_SALPERDEPTNO

    • F_SUMSUM_SALPERJOB

    • F_SUMSUM_SALPERREPORT

    • F_SUM_SAL

    • B_1

  5. Click the title bar of Paper Layout view to make it the active window.

  6. In the Paper Layout view, click the Line Color tool in the tool palette, and click a block that shows the color black.

  7. Click the Paper Design button in the toolbar to display the Paper Design view. You should now see a grid around all of the cells in your matrix.

    Figure 25-13 Matrix report output with a grid

    Description of Figure 25-13 follows

  8. Save your report as matrix1qb_your_initials.rdf

PKrp PKa3wEOEBPS/orbr_plsql001.htmD Prerequisites for This Example

40.1 Prerequisites for This Example

To build the example in this chapter, you must have access to the Human Resources sample schema (HR) provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

PK~>9IDPKa3wEOEBPS/orbr_concepts1001.htm Oracle Reports Builder

1.1 Oracle Reports Builder

The topics in this section discuss the features and functionality in Oracle Reports Builder.

1.1.1 About Oracle Reports Builder

Oracle Reports Builder is the report-building component of Oracle Reports, a powerful enterprise reporting tool that enables you to rapidly develop and deploy sophisticated Web and paper reports against any data source (including an Oracle database, JDBC, XML, and text files). Leveraging Java EE technologies such as JSP and XML, you can publish your reports in a variety of formats (including HTML, XML, PDF, spreadsheet, delimited text, PostScript, and RTF) to any destination (including e-mail, Web browser, Oracle Portal, and file system) in a scalable, efficient manner. Recognizing the differences between Web publishing and paper publishing, Oracle Reports Builder provides the power to develop high quality output for the Web and e-business requirements, as well as high-fidelity printed reports Oracle Reports Builder includes:

  • user-friendly wizards that guide you through the report design process

  • pluggable data sources (PDSs), such as JDBC and XML, that provide access to data from any source for your reports

  • a query builder with a graphical representation of the SQL statement to obtain report data

  • default report templates and layout styles that can be customized if needed

  • a live editor that enables you to modify paper report layouts in WYSIWYG mode

  • the ability to add dynamic report output to an HTML page by embedding custom JSP tags within an HTML document

  • an integrated graph builder to graphically represent report data

  • the ability to generate code to customize how reports will run

  • tools that dynamically generate Web pages based on your data

  • standard report output formats such as HTML, HTMLCSS, XML, PDF, RTF, Spreadsheet, PCL, PostScript, and ASCII

  • client-side parameter validation using JavaScript

  • the ability to execute dynamic SQL statements within PL/SQL procedures

  • support for Oracle database objects

  • event-based reporting (report execution based on database events)

  • seamless integration with Oracle Portal for administering report security and publishing report output to portlets

1.1.2 About this release

Oracle Reports 11g Release 1 (11.1.1) provides many new features and enhancements. The primary themes of this release are:

  • Tighter integration with Oracle Fusion Middleware Platform and Services to provide simplified administration of complex topologies and deployments.

  • Enhancements in top supportability areas with architectural changes.

  • New features in key enterprise reporting areas.

The chapter titled "Introduction" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual, available on the Oracle Technology Network details the new functionality in Oracle Reports 11g Release 1 (11.1.1), along with the equivalent 10g Release 2 (10.1.2) functionality, when applicable.

For additional information, see the Oracle Reports 11g page on the Oracle Technology Network.

PKPKa3wEOEBPS/orbr_grpl_multi001.htmT Prerequisites for This Example

11.1 Prerequisites for This Example

To build the example in this chapter, you must have access to the Summit Sporting Goods (SUMMIT) schema. To download the SQL scripts that install the schema, see "Accessing the Data Sources" in the Preface.

PK>+YTPKa3wEOEBPS/orbr_summary002.htm Create a Data Model and a Group Above Layout

9.2 Create a Data Model and a Group Above Layout

When you are creating a single-query report, such as this one, you can use the Report Wizard to create the data model and layout simultaneously.

To create a data model and layout:

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Use the Report Wizard, then click OK.

  3. If the Welcome page displays, click Next.

  4. On the Report Type page, select Create Paper Layout Only, then click Next.

  5. On the Style page, type a Title for your report, select Group Above, then click Next.

  6. On the Data Source page, click SQL Query, then click Next.

  7. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT SALES_REP_ID, CUSTOMER_ID, SUM(ORDER_TOTAL) TOTAL 
    FROM ORDERS
    GROUP BY SALES_REP_ID, CUSTOMER_ID
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called summary_code.txt into the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field.


  8. 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 9.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  9. On the Groups page, click SALES_REP_ID and click the right arrow (>) to move this field to the Group Fields list, then click Next.

    Figure 9-2 Groups page of the Report Wizard

    Description of Figure 9-2 follows

  10. On the Fields page, click the double right arrows (>>) to move all of the fields to the Displayed Fields list, then click Next.

  11. On the Totals page, click TOTAL in the Available Fields list, then click Sum. Given the data model you are using, this step will create two summary columns for you:

    • SumTOTALPerSALES_REP_ID sums the total of TOTAL for each value of SALES_REP_ID (that is, for each sales representative).

    • SumTOTALPerReport sums the total of TOTAL for the entire report (that is, for all sales representatives).

  12. Still on the Totals page, click % of Total. Given the data model you are using, this step will create two columns for you:

    • TotalTOTALPerCUSTOMER_ID calculates dollars for each customer (CUSTOMER_ID) as a percentage of the total dollars for each sales representative (SALES_REP_ID).

    • TotalTOTALPerSALES_REP_ID calculates dollars for each sales representative (SALES_REP_ID) as a percentage of the total dollars in the entire report.

    Figure 9-3 Totals page of Report Wizard

    Description of Figure 9-3 follows

  13. Click Next.

  14. On the Labels page, change the labels as follows, then click Next:

    FieldsLabels

    SALES_REP_ID

    Sales Rep

    CUSTOMER_ID

    Customer

    TOTAL

    Dollars


  15. On the Template page, make sure Beige is selected under Predefined Template.

  16. Click Finish to display your report output in the Paper Design view.

PKr7NPKa3wEOEBPS/orbr_spellcash001.htmC Prerequisites for This Example

31.1 Prerequisites for This Example

To build the example in this chapter, you must have access to the Order Entry sample schema provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

PK2HCPKa3wEOEBPS/orbr_nestedmatrix.htm Building a Nested Matrix Report

26 Building a Nested Matrix Report

In this chapter, you will learn about nested matrix reports. By following the steps in this chapter, you can generate the report output shown in Figure 26-1.

Figure 26-1 Nested matrix report output

Description of Figure 26-1 follows

Concepts

  • A nested matrix report is a matrix report which contains more than the usual two dimensions (across and down) of a simple matrix.

  • You can create nested matrix reports with any number of queries. In Section 26.2, "Create a Single-Query Matrix", you'll create the example nested matrix report using one query. In Section 26.3, "Create a Multiple-Query Matrix", you'll use multiple queries. In Section 26.4, "Create a Multiple-Query Matrix with a Break", you will use not only group hierarchy to nest one dimension within another, but you'll also create a true parent/child relationship between the relevant groups by explicitly creating a new group and placing it within the cross product and above the other group. This will restrict the records displayed to only those for which data exists.


    Notes:

    • In a nested matrix report, where you create a matrix query that has a child matrix query, the fields on which you join should be separated into a separate group in your master matrix. Otherwise, on some platforms, only the first group prints.

    • The queries used to select data for those sample matrix reports are not intended as definitive examples of matrix queries. If you are concerned with performance issues, for example, there are alternate methods of querying data that can improve the performance of a matrix report. Refer to the Oracle Reports online Help for details.


  • This example report uses a matrix with three dimensions, created by including three columns in the cross product. The cross product is capable of displaying every possible value for three dimensions: two down (YEAR and DEPTNO) and one across (JOB). This method does not include rows that have null values because there is a break group within the cross product group in the data model. As mentioned above, this chapter describes how to create a nested matrix with and without a break group inside of the cross product group so that you can see the difference in the output.

  • The order in which the two down dimensions (YEAR and DEPTNO) will be displayed is based upon the order in which you position their corresponding groups within the cross product; that is, of YEAR and DEPTNO, you'll position YEAR to the left of DEPTNO. This "nests" DEPTNO inside of YEAR and causes all records for DEPTNO to appear for each value of YEAR, regardless of whether that department has any data for that year.

  • For additional conceptual information, see Section 2.1.7, "About nested matrix reports".

Example Scenario

In this example, you will create a report that cross tabulates salaries by year and department, and by job function. The result is a matrix with job functions listed across the top, years and departments down the side, and sums of salaries in the cells. Thus, you can quickly determine the sum of all of the salaries for clerks in department 20 and compare that value to the one for all clerks in some other department.

As you build this example report, you will:

To see a sample nested matrix report, open the examples folder named nestedmatrix, then open any of the Oracle Reports examples named nested1.rdf, nested2.rdf, or nested3.rdf. For details on how to access them, see "Accessing the Example Reports" in the Preface.

PK]},PKa3wEOEBPS/orbr_timeseries002.htm5 Create a Query and the Layout

28.2 Create a Query and the Layout

The steps in this section will show you how to build a simple data model and report layout in the Report Wizard, which you can then use to generate either a JSP-based Web report or a paper report. In the next section, you will modify the JSP so that the appropriate information displays in your Web report.

When you are creating a single-query report, such as this one, you can use the Report Wizard to create the data model and layout simultaneously.

To create a data model and layout:

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Use the Report Wizard, then click OK.

  3. If the Welcome page displays, click Next.

  4. On the Report Type page, select Create both Web and Paper Layout, then click Next.

  5. On the Style page, type a Title for your report, select Group Left, then click Next.

  6. On the Data Source page, click SQL Query, then click Next.

  7. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT O.CUSTID, O.SHIPDATE, O.TOTAL,
    AVG(A.TOTAL) MAVG
    FROM ORD O, ORD A
    WHERE A.CUSTID = O.CUSTID
    AND A.SHIPDATE BETWEEN O.SHIPDATE -123 AND O.SHIPDATE
    GROUP BY O.CUSTID, O.SHIPDATE, O.TOTAL
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called timeseries_code.txt into the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field.


  8. 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 28.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  9. On the Groups page, click CUSTID and click the right arrow (>) to move this field to the Group Fields list, then click Next.

  10. On the Fields page, click the double right arrows (>>) to move all of the fields to the Displayed Fields list, then click Next.

  11. On the Totals page, click Next.

  12. On the Labels page, change the label for MAVG to 4-Month Moving Average, then click Next

  13. On the Template page, select Predefined Template and click Beige, then click Finish to display your report output in the Paper Design view.

  14. In the Paper Design view, double-click field F_MAVG to display the Property Inspector, and set the following properties:

    • Under Field, set the Format Mask property to LNNNGNN0D00.

  15. Do the same for field F_TOTAL.

  16. Select the first number value underneath the Total label. Notice that all of the values are immediately selected.Shift-click the first number value underneath the 4-Month Moving Average label.Click the Align Right button. All of the values are immediately right aligned.

  17. The report in the Paper Design view should now look something like this:

    Figure 28-2 Paper Design view of the Time Series Calculations report

    Description of Figure 28-2 follows

  18. To view the data model you just created using the Report Wizard, click the Data Model button in the toolbar. The same data model can be used for both your paper and your JSP-based Web reports.

    Your data model should look something like this:

    Figure 28-3 Data Model view of the Time series Calculations report

    Description of Figure 28-3 follows

  19. Save your report as timeseries_your_initials.rdf.

PKy:5PKa3wEOEBPS/orbr_concepts2003.htmh~ Data Model Objects

2.3 Data Model Objects

The topics in this section build on the basic concepts discussed in Section 1.7, "Data Model Objects".

2.3.1 About summary columns

A summary column performs a computation on another column's data. Using the Report Wizard or Data Wizard, you can create the following summaries: sum, average, count, minimum, maximum,% total. You can also create a summary column manually in the Data Model view, and use the Property Inspector to create the following additional summaries: first, last, standard deviation, variance.

If your report requires a customized computation, for example, one that computes sales tax, create a formula column (see Section 4.8.10, "Creating or editing a formula column").


Note:

For group reports, the Report Wizard and Data Wizard create n summary fields in the data model for each summary column you define: one at each group level above the column being summarized, and one at the report level. For example, if a report is grouped by division, and further grouped by department, then a summary column defined for a salary total would create fields for the sum of salaries for each division and each department group (group-level summaries), and the sum of all salaries (report-level summary).


See also

Section 4.8.11, "Creating a summary column"

2.3.2 About formula columns

A formula column performs a user-defined computation on the data of one or more column(s), including placeholder columns. For example, :ITEMTOT *.07 is a formula that performs a computation on one column, while :SAL + :COMM performs a computation using two columns in a record. You create formulas in PL/SQL using the PL/SQL Editor.


Note:

Formula columns should not be used to set values for parameters.


See also

Section 4.8.10, "Creating or editing a formula column"

Section 2.6.8, "About formulas"

2.3.3 About placeholder columns

A placeholder is a column for which you set the datatype and value in PL/SQL that you define. Placeholder columns are useful when you want to selectively set the value of a column (for example, each time the nth record is fetched, or each time a record containing a specific value is fetched, and so on). You can set the value of a placeholder column in the following places:

  • the Before Report trigger, if the placeholder is a report-level column

  • a report-level formula column, if the placeholder is a report-level column

  • a formula in the placeholder's group or a group below it (the value is set once for each record of the group)

See also

Section 4.8.12, "Creating or editing a placeholder column"

Section 2.6.8, "About formulas"

2.3.4 About referencing columns and parameters

You can reference user parameters, system parameters and columns as either bind references or lexical references.

2.3.4.1 About bind references

Bind references (or bind variables) are used to replace a single value in SQL or PL/SQL, such as a character string, number, or date. Specifically, bind references may be used to replace expressions in SELECT, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH clauses of queries. Bind references may not be referenced in FROM clauses or in place of reserved words or clauses.

You create a bind reference by typing a colon (:) followed immediately by the column or parameter name. If you do not create a column or parameter before making a bind reference to it in a SELECT statement, Oracle Reports Builder will create a parameter for you by default.

Restrictions

Bind references must not be the same name as any reserved SQL keywords. For more information, see the Oracle Server SQL Language Reference manual.

Examples

Example 1: SELECT clause

In the following example, the value of DFLTCOMM replaces null values of COMMPLAN in the rows selected.

SELECT CUSTID, NVL(COMMPLAN, :DFLTCOMM) COMMPLAN
  FROM ORD;

Example 2: WHERE clause

The value of CUST is used to select a single customer.

SELECT ORDID, TOTAL
  FROM ORD
  WHERE CUSTID = :CUST;

Example 3: GROUP BY clause

All non-aggregate expressions such as NVL(COMMPLAN, :DFLTCOMM) in the SELECT clause must be replicated in the GROUP BY clause.

SELECT NVL(COMMPLAN, :DFLTCOMM) COMMPLAN, SUM(TOTAL) TOTAL
  FROM ORD
  GROUP BY NVL(COMMPLAN, :DFLTCOMM);

Example 4: HAVING clause 

The value of MINTOTAL is used to select customers with a minimum total of orders.

SELECT CUSTID, SUM(TOTAL) TOTAL
  FROM ORD
  GROUP BY CUSTID HAVING SUM(TOTAL) > :MINTOTAL;

Example 5:  ORDER BY clause

The value of SORT is used to select either SHIPDATE or ORDERDATE as the sort criterion. Note that this is not the same as ORDER BY 1 because :SORT is used as a value rather than to identify the position of an expression in the SELECT list. Note that DECODE is required in this example. You cannot use a bind variable in an ORDER BY clause unless it is with DECODE.

SELECT ORDID, SHIPDATE, ORDERDATE, TOTAL
  FROM ORD
  ORDER BY DECODE(:SORT, 1, SHIPDATE, 2, ORDERDATE);

Example 6:   CONNECT BY and START WITH clauses

References in CONNECT BY and START WITH clauses are used in the same way as they are in the WHERE and HAVING clauses.

Example 7:   PL/SQL

procedure double is begin; :my_param := :my_param*2; end;

The value of myparam is multiplied by two and assigned to myparam.

2.3.4.2 About lexical references

Lexical references are placeholders for columns or parameters that you embed in a SELECT statement. You can use lexical references to replace the clauses appearing after SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH. Use a lexical reference when you want the parameter to substitute multiple values at runtime.

You cannot make lexical references in a PL/SQL statement. You can, however, use a bind reference in PL/SQL to set the value of a parameter that is then referenced lexically in SQL, as shown in the example below.

You create a lexical reference by typing an ampersand (&) followed immediately by the column or parameter name. A default definition is not provided for lexical references. Therefore, you must do the following:

  • Before you create your query, define a column or parameter in the data model for each lexical reference in the query. For columns, you must set the Value if Null property, and, for parameters, you must set the Initial Value property. Oracle Reports Builder uses these values to validate a query with a lexical reference.

  • Create your query containing lexical references.

Restrictions

  • You cannot make lexical references in a PL/SQL statement.

  • If a column or parameter is used as a lexical reference in a query, its Datatype must be Character.

  • If you want to use lexical references in your SELECT clause, you should create a separate lexical reference for each column you will substitute. In addition, you should assign an alias to each lexical reference. This enables you to use the same layout field and boilerplate label for whatever value you enter for the lexical reference on the Runtime Parameter Form.

  • If you use lexical references in your SELECT clause, you must specify the same number of items at runtime as were specified in the report's data model. Each value you specify for your lexical references at runtime must have the same datatype as its Initial Value.

  • If you use lexical references in your SELECT clause, the width of the column is derived from the Initial Value property of the parameter. Consequently, you should ensure that the Initial Value of the parameter corresponds to the widest column that you intend to use.

  • A Oracle Reports Builder link should not depend upon a lexical reference. That is, neither the child column of a link or its table name should be determined by a lexical reference. To achieve this functionality, you need to create a link with no columns specified and then enter the SQL clause (for example, WHERE) for the link directly in the query. For example, your parent and child queries might be written as follows:

    Parent Query:

    SELECT DEPTNO FROM EMP
    

    Child Query:

    SELECT &PARM_1 COL_1, &PARM2 COL_2
      FROM EMP
      WHERE &PARM_1 = :DEPTNO
    

    Note how the WHERE clause makes a bind reference to DEPTNO, which was selected in the parent query. Also, this example assumes that you have created a link between the queries in the Data Model view with no columns specified.

  • A lexical reference cannot be used to create additional bind variables after the After Form trigger fires. For example, suppose you have a query like the following (note that the WHERE clause is replaced by a lexical reference):

    SELECT ENAME, SAL FROM EMP
    &where_clause
    

    If the value of the where_clause parameter contains a reference to a bind variable, you must specify the value in the After Form trigger or earlier. You would get an error if you supplied the following value for the parameter in the Before Report trigger:

    WHERE SAL = :new_bind
    

    If you supplied this same value in the After Form trigger, the report would run.

Examples

Example 1: SELECT clause

SELECT &P_ENAME NAME, &P_EMPNO ENO, &P_JOB ROLE
  FROM EMP;

P_ENAME, P_EMPNO, and P_JOB can be used to change the columns selected at runtime. For example, you could enter DEPTNO as the value for P_EMPNO on the Runtime Parameter Form. Note that in this case, you should use aliases for your columns. Otherwise, if you change the columns selected at runtime, the column names in the SELECT list will not match the Oracle Reports Builder columns and the report will not run.

Example 2: FROM clause

SELECT ORDID, TOTAL
  FROM &ATABLE;

ATABLE can be used to change the table from which columns are selected at runtime. For example, you could enter ORD for ATABLE at runtime. If you dynamically change the table name in this way, you may also want to use lexical references for the SELECT clause (look at the previous example) in case the column names differ between tables.

Example 3: WHERE clause

SELECT ORDID, TOTAL
  FROM ORD
  WHERE &CUST;

CUST can be used to restrict records retrieved from ORD. Any form of the WHERE clause can be specified at runtime.

Example 4: GROUP BY clause

SELECT NVL(COMMPLAN, DFLTCOMM) CPLAN, SUM(TOTAL) TOTAL
  FROM ORD
  GROUP BY &NEWCOMM;

The value of NEWCOMM can be used to define the GROUP BY clause.

Example 5: HAVING clause

SELECT CUSTID, SUM(TOTAL) TOTAL
  FROM ORD
  GROUP BY CUSTID HAVING &MINTOTAL;

The value of MINTOTAL could, for example, be used to select customers with a minimum total of orders.

Example 6: ORDER BY clause

SELECT ORDID, SHIPDATE, ORDERDATE, TOTAL
  FROM ORD
  ORDER BY &SORT;

The value of SORT can be used to select SHIPDATE, ORDERDATE, ORDID, or any combination as the sort criterion. It could also be used to add on to the query, for example to add a CONNECT BY and START WITH clause.

Example 7: CONNECT BY and START WITH clauses

Parameters in CONNECT BY and START WITH clauses are used in the same way as they are in the WHERE and HAVING clauses.

Example 8: Multiple clauses

SELECT &COLSTABLE;

COLSTABLE could be used to change both the SELECT and FROM clauses at runtime. For example, you could enter DNAME ENAME, LOC SAL FROM DEPT for COLSTABLE at runtime.

SELECT * FROM EMP &WHEREORD;

WHEREORD could be used to change both the WHERE and ORDER BY clauses at runtime. For example, you could enter WHERE SAL > 1000 ORDER BY DEPTNO for &WHEREORD at runtime.

Example 9: PL/SQL and SQL 

SELECT &BREAK_COL C1, MAX(SAL)
  FROM EMP
  GROUP BY &BREAK_COL;

BREAK_COL is used to change both the SELECT list and the GROUP BY clause at runtime. The Initial Value of the parameter &BREAK_COL is JOB. At runtime, the user of the report can provide a value for a parameter called GROUP_BY_COLUMN (of data type Character).

In the Validation Trigger for GROUP_BY_COLUMN, you call the following PL/SQL procedure and pass it the value of GROUP_BY_COLUMN:

procedure conv_param (in_var IN char) is
begin
  if upper(in_var) in ('DEPTNO','EMPNO','HIREDATE') then
    :break_col := 'to_char('||in_var||')' ;
  else
    :break_col := in_var;
  end if;
end;

This PL/SQL ensures that, if necessary, a TO_CHAR is placed around the break column the user chooses. Notice how in SQL, you make a lexical reference to BREAK_COL. In PL/SQL, you must make a bind reference to BREAK_COL because lexical references are not allowed in PL/SQL.

2.3.4.3 Differences between bind and lexical references

Bind references are used to replace a single value in SQL or PL/SQL. Specifically, bind references may be used to replace expressions in SELECT, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH clauses of queries. Bind references may not be referenced in the FROM clause. An example is:

SELECT ORDID,TOTAL 
  FROM ORD
  WHERE CUSTID = :CUST

Lexical references are placeholders for text that you embed in a SELECT statement, when you want the parameter to substitute multiple values at runtime. You can use lexical references to replace the clauses appearing after SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH. You cannot make lexical references in PL/SQL. Before you reference a lexical parameter for a column or table, you must have predefined the parameter and given it an initial value. An example is:

SELECT ORDID, TOTAL
  FROM &ATABLE

2.3.5 About non-linkable queries

A non-linkable query is a detail query that contains column objects that prevent the query from being linked to through a column-to-column link (when you create a column-to-column link, Oracle Reports Builder adds a WHERE clause to your query). If you attempt to create such a link, a message dialog box displays, which prompts you to choose whether to create a group-to-group query (using the parent groups), or to cancel the operation. A non-linkable query displays the non-linkable query icon in its title bar.

Instead, you can create a group-to-group link (when you create a group-to-group link, Oracle Reports Builder does not add a WHERE clause to your query) between the two queries and add a WHERE clause to the child query's SELECT statement, using a bind variable to reference the parent column. See Section 4.8.9, "Creating a data link".

For example, suppose you want to create a column-to-column link between the ADDRESS.STREET column in your child query and the LOC1 column in your parent query. You can create a group-to-group link, and then modify the child query SQL statement to say:

SELECT * FROM EMP E WHERE E.ADDRESS.STREET = :LOC1

See also

Section 1.7.4, "About data links"

Section 1.7.1, "About queries"

Section 2.3.4.1, "About bind references"

2.3.6 About links versus groups

In Oracle Reports Builder, data is defined independent of format (layout). Therefore, you should be aware of when to use data links instead of groups.

The layouts of a master/detail report that uses two queries and a data link, and a group report that uses one query and two groups can be identical. Following is an example of a default master/detail report and a group report that query the same data. Notice the difference between the two reports: unlike the group report, the master/detail report displays department 40. This is because the data link in the master/detail report causes an outer-join: the link automatically fetches unrelated data. If you are designing a group report that requires an outer-join, explicitly add it to your SELECT statement with (+).

Figure 2-3 Default master/detail and group report that query same data

Default master/detail and group report that query same data

A master/detail/detail report, as shown in the figure below, is a report that contains three groups of data: for each master group, two unrelated detail groups are displayed. To produce a master/detail/detail report or any variation of it, you must use data links. If you try to produce this report with a control break using a single query and three groups the query will establish a relationship between the two detail groups.

Figure 2-4 Master/detail/detail report

Master/detail/detail report

See also

Section 1.7.2, "About groups"

Section 1.7.4, "About data links"

2.3.7 About matrix objects

A matrix object merely defines a relationship between two repeating frames: it isn't really owned by any object, nor does it own any object. A matrix object is created only for layouts with a Matrix layout style. A report may have multiple matrices within it, provided that the data model contains the necessary groups. Oracle Reports Builder creates one matrix object for each pair of intersecting, perpendicular repeating frames.

The repeating frames are the dimensions of the matrix and the matrix object contains the field that will hold the "filler" or values of the cell group. One of the repeating frames must have the Print Direction property set to Down and the other must have the Print Direction property set to Across in order to form a matrix.


Note:

When running a JSP-based Web report that includes a matrix object, the JSP <rw:include> tag expects the matrix object to format on only one page. However, if the cells in the across repeating frame expand, the column headers of the matrix may be forced onto a second page regardless of the page size. Therefore, these matrix headers will not appear in the report output. Additionally, in this situation, the paper layout does not display correctly as header fields move to subsequent pages where the cell values remain on the first page. To resolve this, it is important to carefully define in the Report Editor the space available to the across repeating frame to allow for displaying the largest values, then set the Vertical Elasticity property of the across repeating frame to Fixed.


Restrictions

  • The down repeating frames must be below the across repeating frames in a matrix.

  • A matrix object must always be on top of the repeating frames that form it (that is, it must be one or more layers above its horizontal and vertical repeating frames). Oracle Reports Builder prevents you from moving the matrix below its horizontal and vertical repeating frames.

  • Moving a matrix also causes its two repeating frames to move.

  • A matrix object cannot be anchored to another object and other objects cannot be anchored to it (that is, a matrix object cannot be the parent or child object for an anchor).

  • To copy a matrix, you must select the matrix and its two repeating frames. If you select the matrix object by itself, nothing will be copied to the paste buffer. If you select the matrix and one of the repeating frames, only the repeating frame is placed in the paste buffer.

  • A matrix object can only be resized by resizing its associated repeating frames.

  • You cannot use Alignment or Size Objects from the Layout menu on matrix objects.

  • The source groups of the repeating frames that make up the dimensions of a matrix must be from the same cross-product group.

  • Repeating frames whose source groups are in the same "family" hierarchy (that is, are descendants or ancestors of each other) must have the same Print Direction. Parent-child relationships within a cross-product group are used to create nesting in the matrix. As a result, the repeating frames associated with such groups must print in the same direction on the page.

  • You can put a border on a matrix object just as you would any other object, but the width will always be the minimum width possible. You cannot widen the border due to the closeness of the objects in a matrix layout.

Example

Suppose that you have a group named Group1 that contains a column called C_DEPTNO, which gets its values from the database column DEPTNO. A group called Group2, contains column C_JOB, which gets its values from the database column JOB, and column C_DEPTNO1, which is used for linking to Group1's query. A group called Group3 contains a column called SUMSAL, which is a summary of the database column SAL.

                    Job 
          Analyst  Clerk  Manager 

      10           $1300   $2450 
Dept  20    $6000  $1900   $2975 
      30           $ 950   $2850 

In this example:

  • The Vertical Repeating Frame is the repeating frame that contains Group2 (the job titles).

  • The Horizontal Repeating Frame is the repeating frame that contains Group1 (the department numbers).

  • The Cross Product Group is Group4 (the group that is the parent of Group1 and Group2).

If you need to build a more complex matrix, you can do so by adding more columns to Group1 and Group2. For example, instead of having Group1 just contain department numbers, it could also contain the locations (LOC) of the departments. The matrix might then look something like this:

                              Job
 Loc        Dept    Analyst  Clerk  Manager
 
 New York    10              $1300   $2450
 Dallas      20      $6000   $1900   $2975
 Chicago     30              $ 950   $2850

See also

Section 1.3.7, "About matrix reports"

Section 2.1.7, "About nested matrix reports"

Section 2.1.8, "About matrix with group reports"

Section 4.9.1.3, "Creating a matrix object"

Section 4.8.8, "Creating a matrix (cross-product) group"

Section 4.5.3, "Creating a nested matrix report"

PKgMm~h~PKa3wEOEBPS/orbr_paptoexcel001.htm( Prerequisites for This Example

29.1 Prerequisites for This Example

To build the example in this chapter, you must have the example files packaged with the Oracle Reports software (see "Example Scenario", above), as well as access to the Human Resources sample schema (HR) provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator. You must have Microsoft Excel 2000 or higher to complete this example.

PKI-(PKa3wEOEBPS/orbr_dyngraph003.htm| Create the Layout of the Report

24.3 Create the Layout of the Report

In this section, you will create a default layout for your report using the Report Wizard. You will then modify all the necessary layout objects for your graphics.

24.3.1 Create the initial layout of your report using the Report Wizard

To create the initial layout:

  1. In the Paper Layout view, choose Tools > Report Wizard to display the Report Wizard.

  2. In the Report Wizard, on the Report Type page, select Create Paper Layout only.

  3. On the Style page, select Group Above.

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

    • G_deptno

    • G_DEPTNO1

  5. On the Fields page:

    • Click the double right arrows (>>) to move all of the fields to the Displayed Fields list.

    • In the Displayed Fields list, click deptno, then click the left arrow (<) to move this field back to the Available Fields list.

    • Do the same for DEPTNO1.

  6. On the Labels page, delete the label for the Picture field.

  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 24-3 Initial Paper Layout view for the dynamic graphics report

    Description of Figure 24-3 follows

  8. Save your report as dynamicgraphics_your_initials.rdf.

24.3.2 Modify the layout of your report

Now that you have created an initial layout for your report, you can rearrange your layout objects and add dynamic graphics.

To modify your layout:

  1. In the Paper Layout view, select all the objects by pressing Ctrl+A on your keyboard.

  2. Use the arrow keys on your keyboard to move all the objects 0.5 inches (1.5 centimeters) to the right.

  3. In the Paper Layout view, expand the screen so that you can see down to 7 inches (18 centimeters) on the ruler.

  4. In the Object Navigator, find your report name, then navigate to Paper Layout > Main Section > Body > M_G_DEPTNO_GRPFR.

  5. Click R_G_DEPTNO. In the Paper Layout view, the R_G_DEPTNO repeating frame should also be selected.

  6. While the R_G_DEPTNO repeating frame is selected, click the right part of the frame, and drag it to 6.5 inches (16.5 centimeters). The repeating frame should now expand from the 3.0 inch (7.5 centimeter) mark to the 6.5 inch (16.5 centimeter) mark on the top ruler.

  7. Now, click the bottom part of the frame, and drag it to 2.0 inches (5 centimeters). You can see where you are by looking at the left-hand ruler. The repeating frame should now expand from the 0.5 inch (1.3 centimeter) mark to the 2.0 inch (5 centimeter) mark on the left-hand ruler.

    Figure 24-4 Paper Layout view of the modified layout

    Description of Figure 24-4 follows

  8. Click the Flex Off button in the toolbar.

  9. Move the Picture field to the right, and enlarge it to about 1.5 by 1.5 inches (4 by 4 centimeters).

  10. In the Object Navigator, navigate to Paper Layout > Main Section > Body, then select the M_G_DEPTNO_GRPFR frame.

  11. In the Paper Layout view, click the right edge of the frame and drag it to the right to include the Picture field.

  12. Do the same for the R_G_DEPTNO repeating frame.

  13. While R_G_DEPTNO is selected, choose Tools > Property Inspector to display the Property Inspector.

  14. Under Repeating Frame, set the Maximum Records per Page property to 1.


    Note:

    By setting the maximum records per page to 1, only one state will display per page in your report.


  15. Save your report as dynamicgraphics_your initials.rdf.

PKOPKa3wEOEBPS/orbr_grpl_multi.htm Building a Two-Query Group Report

11 Building a Two-Query Group Report

In this chapter, you will learn about multiquery group reports. By following the steps in this chapter, you can generate the report output shown in Figure 11-1.

Figure 11-1 Group above report output, two queries

Description of Figure 11-1 follows

Concepts

As you can see above, a two-query group report appears much the same as a single-query group report. Performance is the key issue when contrasting single-query and multiple-query group reports. In most cases, single-query reports will run faster than multiple-query reports. The multiple-query reports are, however, sometimes easier to understand conceptually and easier to maintain. For example, if you are in a situation where only a few users run the report and the report returns a relatively small number of records, you might want to use multiple queries to simplify maintenance and make the data model easier to understand. If you have many users and the report is quite large, then you should try to use a single-query report.


Note:

For more information on streamlining your report's performance, refer to the chapter "Tuning Oracle Reports" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.


Data Relationships

  • The single and multiple-query group reports look the same but have different data models. A single-query report has multiple groups underneath one query, while a multiple-query report uses one group underneath each of several queries. In the single-query case, the relationship is established by the hierarchy of groups underneath the query. In the multiple-query case, the relationship is established by data links between the groups of different queries.

  • A data link is a data model object that enables you to relate multiple queries. For a simple group report, you relate the two queries using the primary and foreign keys of the tables from which you are selecting data.

  • A primary key is a column for which each value uniquely identifies the record in which it is found. A foreign key is a column which contains the same values as the primary key for another table, and is used to reference records in that table.

  • Linking two tables through primary and foreign keys is similar to specifying a join condition. In fact, the data link causes Reports Builder to create a SQL clause defining a join, based on information specified when creating the link. This clause is added to the child query's SELECT statement at run time.

  • The join defined by a default data link is an outer join—in addition to returning all rows that satisfy the link's condition, an outer join returns all rows from one table that do not match a row from the second table.

Layout

  • This report uses a default group above layout style in which master records display across the page with the labels to the left of their fields and the detail records appear below the master records in standard tabular format.

  • You will deselect one default column to keep it from appearing in the report, change some field widths to ensure the fields fit across the page, and format one of the fields.

  • You will also specify a maximum of one master record per page to ensure that only one master record and its associated detail records are displayed per page of report output.

Example Scenario

In this example, you will create a group above report that lists employees with their jobs and salaries by department.

As you build this example report, you will:

To see a sample group above report with two queries, open the examples folder named masterdetail, then open the Oracle Reports example named grp_above.rdf. For details on how to access it, see "Accessing the Example Reports" in the Preface.

PK PKa3wEOEBPS/orbr_spellcash.htmP Building a Check Printing Report with Spelled-Out Cash Amounts

31 Building a Check Printing Report with Spelled-Out Cash Amounts

In this chapter, you will learn about reports that format output as checks with cash amounts spelled out in words. By following the steps in this chapter, you can generate the report output shown in Figure 31-1.

Figure 31-1 Check printing report output

Description of Figure 31-1 follows

Concepts

To spell out the value of a check, you use a PL/SQL function to split the number into its constituent numerals, then use a formula column to combine the words into the spelled-out cash amount.


Note:

Many of the concepts in this example are used in the following example reports:

  • This example, where you import an image of a check and use it as a guide to position fields in the Paper Layout view. In addition, you learn how to create a PL/SQL function that returns spelled-out numerical values.

  • Chapter 32, "Building a Report Using a Preprinted Form", where you learn formatting techniques for printing reports on preprinted forms when you do not have access to a computer readable version of the forms. Such reports must be designed so that the data prints in exact positions on the form.

  • Chapter 33, "Building an Invoice Report", where you import an image of an invoice and use it as a guide to position fields in the Paper Layout view.


Data Relationships

  • This report uses two linked queries. The first query retrieves the information necessary for the check, and the second query retrieves the order details that will be printed on the check stub.

  • One of the queries you will create assumes that the numbers to be spelled are stored in the TOTAL column of the ORDERS table. The text of the spelled-out number will be fetched from the table called Lookup, and returned in the Thousands_text, Thousands_Symbol, Ones_text, and Decimal_Text columns

Layout

This report uses a default Form style.

Example Scenario

In this example, you will use the Report Wizard to create your basic report definition. You will create a PL/SQL function that spells out the numerical value of the check amount. You will also create a formula column that formats the dollar amounts on your checks. You will import an image of a blank check image, and use the tools in the Paper Layout and Paper Design views to rearrange the fields in your report according to how you want them to display on the resulting check printing report. You will also use these tools to create a stub for every check.

As you build this example report, you will:

To see a sample report where the cash amounts are spelled out, open the examples folder named spellcash, then open the Oracle Reports example named spellcash.rdf. For details on how to open it, see "Accessing the Example Reports" in the Preface.

PK ?&UPPKa3wEOEBPS/orbr_plsql005.htm1& Add Vertical Space Between Records

40.5 Add Vertical Space Between Records

To make the report more readable, you can add space between a certain number of records. To do so, you first create the parameter that determines the number of records between which the space will display. Then, you create a summary column in the data model that counts the number of records. You will then modify the paper layout of your report so that the vertical elasticity is variable. Finally, you will create a format trigger that will display the space between the user-determined number of records.

40.5.1 Create a user parameter

The parameter you will create in this section will determine how many records are displayed before an extra space is printed. Since this parameter is a user parameter, the user can change this value at runtime.

To create a user parameter:

  1. In the Object Navigator, under the Data Model node, click the User Parameters node.

  2. Choose Edit > Create to create a new user parameter under the User Parameters node.

  3. If the Property Inspector is not already displayed, right-click the new user parameter (P_1), then choose Property Inspector to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to SPACE.

    • Under Parameter, set the Datatype property to Number, and set the Initial Value property to 5.


      Note:

      By giving the user parameter an initial value, the user can simply run the report without changing the parameters, and a space will display between every five records.


    The user parameter now displays in the Object Navigator:

    Figure 40-13 User Parameter in the Object Navigator

    Description of Figure 40-13 follows

  4. Save your report.

40.5.2 Create a summary column that counts the number of records

In this section, you will create a summary column in the data model that counts the number of employee records. This information will then be used by the format trigger to determine where to add extra space.

To create a summary column:

  1. In the Object Navigator, double-click the view icon next to the Data Model node to display the Data Model view.

  2. In the Data Model view, click the Summary Column tool in the tool palette, then click in the G_FIRST_NAME group beneath the TOTAL_COMP formula column to create a new summary column:

    Figure 40-14 Data Model with new summary column

    Description of Figure 40-14 follows

  3. Double-click the new summary column object (CS_1) to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to CNT_COLUMN.

    • Under Summary, set the Function property to Count, and set the Source property to FIRST_NAME.

  4. Save your report.

40.5.3 Modify the layout

To allow Reports Builder to insert the vertical spacing, you must modify the layout of your report.

To add vertical elasticity:

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

  2. Click the Flex On button in the toolbar.

  3. In the Paper Layout view, click the repeating frame associated with G_FIRST_NAME.


    Note:

    If you cannot find the repeating frame in the Paper Layout view, you can click R_G_FIRST_NAME in the Object Navigator. The associated repeating frame will be selected in the Paper Layout view.


  4. Click the center handle of the frame and drag the frame downward to create additional space. This additional space should be slightly larger than what you want to see between the sets of records.

  5. With the repeating frame selected, choose Tools > Property Inspector to display the Property Inspector, and set the following properties:

    • Under General Layout, set the Vertical Elasticity property to Variable.

  6. In the Paper Layout view, click the Rectangle tool in the tool palette, and draw a rectangle below the fields in the newly created space.

  7. Make sure the new rectangle has no fill and no line so that it is not visible.

    The following image shows the new layout with the invisible rectangle:

    Figure 40-15 Layout with added vertical space

    Description of Figure 40-15 follows

  8. Save your report.

40.5.4 Create a format trigger

Now that you have adjusted the layout, you can create a format trigger based on the new boilerplate rectangle you created in the previous section. This format trigger will display this space after every set number of records, determined by the user parameter.

To create a format trigger on the boilerplate rectangle:

  1. While the rectangle is selected in the Paper Layout view, press F11 on your keyboard (or choose Tools > PL/SQL Editor) to display the PL/SQL Editor.

  2. In the PL/SQL Editor, use the template to enter the following PL/SQL code:

    function B_1FormatTrigger return boolean is
    begin
     If :CNT_COLUMN mod :SPACE = 0 then
       return(TRUE);
     else
       return(FALSE);
     end if;
    end;
    

    Note:

    You can enter this code by copying and pasting it from the provided text file called plsql_code.txt. This code is for the Format Trigger.


  3. Click Compile.

  4. When the code is compiled without errors, click Close.

  5. Save your report.

PK;*i6&1&PKa3wEOEBPS/orbr_grpl_multi002.htmy Create a New Report Manually

11.2 Create a New Report Manually

In this case, it is easier to create the data model and layout separately. Hence, we will create an empty report first, then add the queries, and then create the layouts.

To create a blank report:

  1. Launch Reports Builder (or, if already open, choose File > New > Report)

  2. In the Welcome or New Report dialog box, select Build a new report manually, then click OK.

PKMy7~yPKa3wEOEBPS/orbr_hdr_ftr002.htm! Create a Data Model and a Group Left Layout

16.2 Create a Data Model and a Group Left Layout

When you are creating a single-query report, such as this one, you can use the Report Wizard to create the data model and layout simultaneously.

To create a data model and layout:

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Use the Report Wizard, then click OK.

  3. If the Welcome page displays, click Next.

  4. On the Report Type page, select Create Paper Layout Only, then click Next.

  5. On the Style page, type a Title for your report, select Group Left, then click Next.

  6. On the Data Source page, click SQL Query, then click Next.

  7. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT FIRST_NAME, LAST_NAME, EMPLOYEE_ID, SALARY, DEPARTMENT_ID
    FROM EMPLOYEES 
    ORDER BY DEPARTMENT_ID, EMPLOYEE_ID
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called headfoot_code.txt into the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field


  8. 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 16.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  9. On the Groups page, click DEPARTMENT_ID and click the right arrow (>) to move this field to the Group Fields list, then click Next.

  10. On the Fields page, click the double right arrows (>>) to move all of the fields to the Displayed Fields list, then click Next.

  11. On the Totals page, click SALARY, then click Sum.

  12. Click Next.

  13. On the Labels page, change the labels as follows, then click Next:

    FieldsLabels

    DEPARTMENT_ID

    Department

    SumSALARYPerDEPARTMENT_ID

    Total Salary for Department &DEPARTMENT_ID:


    This step will add a footer to each instance of the master repeating frame (departments).


    Note:

    The DEPARTMENT_ID column is part of the data model so you need to reference DEPARTMENT_ID in the footer label using &DEPARTMENT_ID.


  14. On the Template page, click Finish to display your report output in the Paper Design view. It should look something like this:

    Figure 16-2 Group left report output with footer for master repeating frame

    Description of Figure 16-2 follows

PK&!PKa3wEOEBPS/orbr_summary.htm= Building a Summary Report

9 Building a Summary Report

In this chapter, you will learn about summary reports. By following the steps in this chapter, you can generate the report output shown in Figure 9-1.

Figure 9-1 Summary report output

Description of Figure 9-1 follows

Concepts

A summary report contains at least one column whose value or values consist of a summary of other data. A column that totals sales, a column that averages a list of commissions, and a column that shows the maximum amounts found in a series of purchase orders are all examples of summary columns.

Data Relationships

  • The value or values in a summary column are calculated by summarizing data retrieved from another column. Reports Builder provides packaged summary functions you can use to compute the values of summary columns.

  • By default, the values of a column summarizing data on a record-by-record basis appear in a default report column, as in the preceding example, where % of Total displays as a default tabular column.

  • The values of a column summarizing data once per set of information (one summary for each break group) appear under the column of values it summarizes.

  • The result of a column calculating one final result appears once at the bottom of the report.

  • The difference between a summary column and the columns in previous introductory reports is that you do not select summary columns from the database. You create the summary columns and add them to groups in your report.

  • To create a summary column, you need to define at least three properties:

    • Source is the name of the column that contains the data on which the summary column performs its computations. The source column remains unchanged.

    • Function is the type of summary to be performed. The function tells Reports Builder how to compute summary column values. The functions provided with Reports Builder are Average, Count, First, Last, Maximum, Minimum, % of Total, Standard Deviation, Sum, and Variance. (If none of the Reports Builder summary functions performs the computation you need for your report, you can create your own functions using PL/SQL.)

    • Reset At is the level or frequency at which the summary columns value returns to zero. The reset level, also known as the reset group, determines when to reset the value of the summary column to zero--in other words, how much of the source column to summarize. You can specify that the summary column summarize all values of the source column for the entire report, you can summarize column values in a break group, or you can summarize column values on a record-by-record basis.

Layout

This report uses a master/detail layout style.

Example Scenario

In this example, you will create a report that displays and summarizes sales data by sales representative. This report includes the following summaries:

  • The total of all orders from all customers for each sales representative.

  • The percentage value of each customer's orders in relation to each sales representative's total orders.

  • The percentage value of each sales representative's orders in relation to the total orders.

  • The grand total of all orders in the report.

As you build this example report, you will:

To see a sample summary report, open the examples folder named summary, then open the Oracle Reports example called summary.rdf. For details on how to access it, see "Accessing the Example Reports" in the Preface.

PK cnB=PKa3wEOEBPS/orbr_multoc001.htmH Prerequisites for This Example

36.1 Prerequisites for This Example

To build the example in this chapter, you must have the example files we have provided (see "Example Scenario", above), as well as access to the Sales History sample schema provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

PKߡ4PKa3wEOEBPS/orbr_text004.htmC Summary

46.4 Summary

Congratulations! You have successfully used a Text pluggable data source for a paper report. You now know how to:

  • set up your textpds.conf file.

  • use the Report Wizard to create a paper report based on the text data source.

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".

PKأPKa3wEOEBPS/orbr_suppress002.htmz Create the Data Model with Two Linked Queries

21.2 Create the Data Model with Two Linked Queries

The steps in this section will show you how to build a simple data model with two queries in a master/detail relationship.

To create a data model

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Build a new report manually, then click OK.

  3. In the Data Model view that displays, click the SQL tool in the tool palette, then click in an open area of the Data Model view to display the SQL Query Statement dialog box.

  4. In the SQL Query Statement dialog box, type the first SELECT statement:

    SELECT * FROM DEPT
    ORDER BY DEPTNO
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called suppresslabels_code.txt into the SQL Query Statement field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the SQL Query Statement field.

    Also note that if you have not installed the Pictures table into the sample schema, you will not be able to create this query.


  5. Click OK.


    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 21.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  6. When the query displays in the Data Model view, right-click the query name (Q_1), then choose Property Inspector from the pop-up menu to set the following property:

    • Under General Information, set the Name property to Q_DEPT.

  7. Follow the steps above to create another query named Q_EMP, with the following SELECT statement:

    SELECT DEPTNO, ENAME, JOB FROM EMP
    ORDER BY ENAME
    
  8. In the Data Model view, click the Data Link tool in the tool palette.

  9. Drag a link between DEPTNO in Q_DEPT and DEPTNO1 in Q_EMP. Your data model should now look like this:

    Figure 21-2 Data Model view of the Suppress Labels report

    Description of Figure 21-2 follows

  10. Save your report as suppresslabels_your_initials.rdf.

PKBp]zPKa3wEOEBPS/orbr_visidx008.htmF Summary

3.8 Summary

In this chapter, each of the example reports contained in this manual are described. For more details on each of the examples, refer the location provided. For access to the latest versions of the documentation and example files, visit the Oracle Technology Network (OTN): on the Oracle Reports page (http://www.oracle.com/technology/products/reports/index.html), click Getting Started to display the Getting Started with Oracle Reports home page.

PKiKKFPKa3wEOEBPS/orbr_intermix006.htm- Suppress Redundant Values

20.6 Suppress Redundant Values

Notice in your output that the department values are properly positioned, but they repeat for every record in the department. What you really want is for the department values to appear once for each department. To accomplish this task, you will first create a global variable to be used in comparing the current department value to the previous one. You will then write a Format Trigger to determine which values to suppress based upon the comparison within each department's records.

To create a global variable:

  1. In the Object Navigator, click the Program Units node.

  2. Click the Create button in the toolbar. The New Program Unit dialog box displays.

  3. Type global in the Name field and select Package Spec.

    Figure 20-6 New Program Unit dialog box

    Description of Figure 20-6 follows

  4. Click OK.

  5. In the PL/SQL Editor, type the following PL/SQL:

    PACKAGE global IS
      prev_val varchar2(14);
    END;
  6. Click Compile

  7. Click Close.

To add the format trigger:

  1. In the Object Navigator, type F_DEPARTMENT in the Find field to select it.

  2. Double-click the properties icon to the left of F_DEPARTMENT to display the Property Inspector, and set the following properties:

    • Under Advanced Layout, double-click the Format Trigger property field to display the PL/SQL Editor.

  3. In the PL/SQL Editor, use the template to enter the following PL/SQL code:

    function F_DEPARTMENTFormatTrigger return boolean is
    begin
    If global.prev_val = :department then
      return(false);
      Else
        global.prev_val := :department;
        return(true);
      END IF;
    end;
  4. Click Compile.

  5. Click Close.

  6. Click the title bar of the Report Editor to make it the active window. Return to the Paper Design view if you are not already there. Notice the change in your report output.

    Figure 20-7 Final report output displayed in the Paper Design view

    Description of Figure 20-7 follows

  7. Save the report.

PK_2-PKa3wEOEBPS/orbr_pagenum005.htmO Set Properties and Format Fields

19.5 Set Properties and Format Fields

To set properties and format the fields of your report:

  1. In the Object Navigator, click the Paper Layout node and click the Expand All button in the toolbar.

  2. Double-click the repeating frame icon next to the R_G_ENAME node to display the Property Inspector, and set the following properties:

    • Under Repeating Frame, set the Maximum Records per Page property to 1.

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

    • Under Repeating Frame, set the Vert. Space Between Frames property to 0.25 to specify 0.25 inches (0.5 centimeters) of vertical space between instances of the repeating frame; that is, between each customer record.

    • Under General Layout, set the Page Protect property to Yes to specify that the first instance of the repeating frame (that is, the first customer record) must all fit on the same logical page.

  4. In the Object Navigator, click the F_CREDITLIMIT node, then Ctrl-click F_AMOUNT to select both nodes.

  5. Click the Paper Design button in the toolbar to make the Paper Design view the active window, with the F_CREDITLIMIT and F_AMOUNT fields selected, and make the format changes (you can also click the corresponding buttons in the toolbar):

    • choose Format > Number > Currency

    • choose Format > Number > Add Decimal Place

    • choose Format > Number > Add Decimal Place (again, for two decimal places)

    • choose Format > Justify > Right

  6. In the Paper Design view, click the Amount label (column heading), and choose Format > Justify > Right.

PKUjTOPKa3wEOEBPS/orbr_paptoexcel004.htm Modify Your JSP Report to Display in Microsoft Excel

29.4 Modify Your JSP Report to Display in Microsoft Excel

Now that you have created your JSP-based Web report, which looks the same as your paper report, you will modify it further to display the report in Microsoft Excel in your Web browser.

First, copy myexcelreport_your_initials.jsp to the deployment directory of your Application Server. For testing purposes, in this example, we will use the Oracle WebLogic Server instance shipped with the Oracle Developer Suite.

For more information on deploying a JSP-based Web report, refer to the section "Deploying Your Reports" in the chapter "Running Report Requests" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual

To modify the report to display in Microsoft Excel:

  1. In the Report Editor, click the Web Source button in the toolbar to display the Web Source view.

    In the Web Source view, you will change the content type of the HTTP response using the JSP directive contentType, so that the browser opens Microsoft Excel to display your report output.

  2. In the Web Source view, find the following text:

    <%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %>
    <%@ page language="java" import="java.io.*" errorPage="/rwerror.jsp"
    session="false" %>
    <%@ page contentType="text/html;charset=ISO-8859-1" %>
    <rw:report id="report">
    <rw:objects id="objects">
    </rw:objects>
    ......
    ......
    <!--
    </rw:report>
    -->
    

    and modify it to read as follows:

    <%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %>
    <%@ page language="java" import="java.io.*" errorPage="/rwerror.jsp"
    session="false" %>
    <%@ page contentType="application/vnd.ms-excel;charset=ISO-8859-1" %> 
    <rw:report id="report">
    <rw:objects id="objects">
    </rw:objects>
    ......
    ......
    <!--
    </rw:report>
    -->
    
  3. Save your report.

  4. Copy the Web report (myexcelreport_your_initials.jsp)into the following directory:

    $DOMAIN_HOME\servers\MANAGED_SERVER_NAME\stage\reports\reports\web.war
    
  5. Start your Oracle WebLogic Server instance to enable the deployment of your report.

    • On Windows, you can do either of the following:

      • From the Start menu, choose Programs > Oracle Classic Instance > Reports Services > Start WebLogic Server - WLS_REPORTS.

        For example, the Oracle Classic Instance may be Oracle Classic Instance-asinst_1.

      • From the command line, run the following command:

        cd $DOMAIN_HOME\bin\startManagedServer.bat WLS_REPORTS

    • On UNIX, start the shell script from the command line:

      • $DOMAIN_HOME\bin\startManagedServer.sh WLS_REPORTS


    Tip:

    The Oracle WebLogic Server instance starts once the containers for Java EE have been initialized.


  6. Type the following URL to display your report in Microsoft Excel in your Web browser:

    http://your_computer:port/reports/yourexcelreportname.jsp?userid=hr/hr@db
    

    In our example, we use:

    http://mycomputer-pc:8888/reports/my_excel_report.jsp?userid=hr/hr@orcl
    

    Note:

    The connect string you type in the URL is for the database you used to create the data model in Section 29.2, "Create a Query and the Layout". For the purposes of this example, we have used plain text to pass the connect string. For information on using security, refer to the chapter "Securing Oracle Reports Services" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.


  7. The report runs, and the browser displays your report in Microsoft Excel.


    Note:

    If you want your report to display the same colors in Excel as in your report definition, you must use colors supported by the Excel color palette. Otherwise, Excel tries to match unsupported colors, but the match may not be what you expect.


    Your final report output should look something like this:

    Figure 29-4 Microsoft Excel Output of Your Report

    Description of Figure 29-4 follows

PKEoyPKa3wEOEBPS/orbr_howto002.htm Set Properties and Preferences

4.2 Set Properties and Preferences

This section provides procedures for the following tasks that you may perform as you work with property and preference settings:

4.2.1 Displaying the Property Inspector

To display the Property Inspector for an object:

  • In the Object Navigator, do any of the following:

    • Double-click the icon immediately to the left of the object name.

    • Click the object name, then right-click and choose Property Inspector.

    • Click the object name, then choose Tools > Property Inspector.

    • Click the object name, then press F4.

  • In the Report Editor views, do any of the following:

    • Double-click the object.

    • Click the object, then right-click and choose Property Inspector.

    • Click the object, then choose Tools > Property Inspector.

    • Click the object, then press F4.

See also

Section 1.10.1, "About the Property Inspector"

4.2.2 Setting report properties

To set the properties for a report:

  1. In the Object Navigator, double-click the properties icon next to the report name to display the Property Inspector.

  2. Set report properties as desired.

4.2.3 Setting report preferences

To specify the preferences for a report:

  1. Choose Edit > Preferences.

  2. To specify preferences for designing reports, set values on the General, Access, and Wizards tabs.

  3. To specify preferences for running reports, set values on the Runtime Values and Runtime Settings tabs.

  4. For a detailed description of settings in the Preferences dialog box, click Help.

4.2.3.1 Using the Auto Save Feature

Oracle Reports 11g Release 1 (11.1.1) provides the Auto Save feature that recovers any unsaved changes during an unexpected event in Reports Builder or system failure.

If Auto Save is enabled, Reports Builder recovers any unsaved data automatically.

To enable the Auto Save feature:

  1. In the Object Navigator, choose Edit > Preferences...

  2. In the General tab, select the Auto Save check box.

  3. Click OK.

4.2.4 Setting preferences for the Object Navigator

To specify options for the Object Navigator display:

  1. In the Object Navigator, choose Tools > Options > Navigator.

  2. In the Object Navigator Options dialog box, change the settings as desired.

  3. Click OK.

See also

Section 1.5.1, "About the Object Navigator"

4.2.5 Setting properties for an ASCII (character-mode) report

To set properties for an ASCII (character-mode) report:

  1. Double-click the properties icon next to the report name to display the Property Inspector.

  2. Under the Character Mode node, set Design In Character Units to Yes.

  3. In the Object Navigator, under the Paper Layout node, double-click the Header Section, Main Section, or Trailer Section properties icon for the pertinent report section (Header, Main, or Trailer) to display the Property Inspector.


    Note:

    By default, a report is defined in the Main section.


  4. In the Property Inspector, under the Section node:

    • set the Report Width and Report Height to the appropriate character-mode dimensions for the report. For example, 132 (or 180) width x 66 height for landscape or 102 width x 85 (or 116) height for portrait.

    • set the Orientation property to the desired value.

  5. In the Object Navigator, expand the Data Model node, then the System Parameters node.

  6. Double-click the properties icon next to MODE to display the Property Inspector, and set the following properties:

    • Under the Parameter node, set the Initial Value property to Character.

  7. In the Paper Layout view, choose Tools > Options > Rulers to display the Ruler Settings dialog box:

    • Set Units to Character Cells and Number of Snap Points Per Grid Spacing to 1.

    • Click OK.

  8. Click View in the menu bar and make sure that Snap to Grid is checked.

  9. Choose Edit > Preferences to display the Preferences dialog box:

    • On the Wizards page, set Horizontal Interfield to 1 and Vertical Interfield to 0.

    • Click OK.

  10. Choose Format > Font, and select the font, style, and size that most closely approximates the character-mode font. For example, Courier, Regular, 12 points.

See also

Section 4.5.9, "Creating an ASCII (character-mode) report"

4.2.6 Setting color palette preferences

To set color palette preferences:

  1. Choose Edit > Preferences.

  2. In the Preferences dialog box, on the General tab page, set the Color Mode as desired:

    • Editable. Oracle Reports Builder temporarily replaces your system's color palette with the palette of the active report. Each time a new report is made active, its color palette replaces the system palette. A report can have only one color palette. The active report will then be shown accurately, although the appearance of the inactive reports may suffer. You must choose Editable if you want to modify the color palette or import or export a color palette.

    • Read Only - Shared. (Default) Oracle Reports Builder continues to append each active report's color palette to your system's original palette until there is no room left in the palette for any more colors. That palette becomes the single palette that all open reports share. If you create a report that uses entirely different colors, it may not be shown accurately.

    • Read Only - Private. Each time you make a report active, Oracle Reports Builder appends that report's color palette to your system's original palette until there is no room left in the palette for any more colors. This palette is then used whenever that report is active. The active report is then shown accurately, although the appearance of the inactive reports may suffer.


    Note:

    A report can have only one color palette.


  3. If you change the Color Mode, shut down and restart Oracle Reports Builder to enable the new mode.

See also

Section 2.4.5, "About changing colors and patterns"

Section 4.9.6.6, "Importing or exporting a color palette"

Section 4.9.6.5, "Modifying the color palette"

Section 4.9.6.2, "Changing colors"

Topics "Oracle CDE1 color palette", "Default color palette", and "Grayscale color palette" in the Reference > Color and Pattern Palettes section of the Oracle Reports online Help.

4.2.7 Setting properties of multiple objects

To set the properties of multiple objects:

  1. In the Object Navigator or any Report Editor view, select the objects whose properties you want to set. The objects can be of different types and can even be in different documents.

  2. Choose Tools > Property Inspector.

  3. In the Property Inspector, click the Union button to see all properties of all objects or leave the tool as the Intersection button to see only the properties the objects have in common.

  4. Set the properties as desired.


    Note:

    Any change you make to a property setting is applied to all of the objects in the current selection to which that property applies.


For example, a report includes several fields, each of which displays the date. The Datatype property of each field is DATE, which causes dates to be displayed in the default ORACLE format DD-MON-YY.

To use a different date format throughout the application, you need to set the Format Mask property for each field that displays dates. Rather than setting each field's Format Mask property individually, select all of the items, then set the Format Mask property once to change the format mask for each item selected.

See also

Section 1.10.1.1, "About making multiple selections in the Property Inspector"

4.2.8 Comparing the properties of one object to another

To compare the properties of one object to another:

  1. In the Object Navigators or the editors, double-click the first object so that its properties are displayed in the Property Inspector.

  2. In the Property Inspector, click the Pin button to attach this copy of the Property Inspector to the current object.

  3. In the Object Navigator, double-click the second object, then choose Tools > Property Inspector.

    A second Property Inspector is displayed. If the second window is on top of the first, drag it to move it alongside the first window.

PK@d<<PKa3wEOEBPS/orbr_graphics002.htm, Create a Simple Report Definition

18.2 Create a Simple Report Definition

When you create a report, you can either use the Report Wizard to assist you or create the report yourself. In this example, you will use the Report Wizard to create your query and basic report layout.

To create the report definition:

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Use the Report Wizard, then click OK.

  3. If the Welcome page displays, click Next.

  4. On the Report Type page, select Create Paper Layout Only, then click Next.

  5. On the Style page, type a Title for your report, select Group Above, then click Next.

  6. On the Data Source page, click SQL Query, then click Next.

  7. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT ALL DEPARTMENTS.DEPARTMENT_ID, EMPLOYEES.FIRST_NAME, EMPLOYEES.LAST_
    NAME, EMPLOYEES.JOB_ID, EMPLOYEES.SALARY, JOBS.JOB_TITLE
    FROM DEPARTMENTS, EMPLOYEES, JOBS
    WHERE ((DEPARTMENTS.DEPARTMENT_ID = EMPLOYEES.DEPARTMENT_ID)
    AND (EMPLOYEES.JOB_ID = JOBS.JOB_ID)) 
    ORDER BY DEPARTMENTS.DEPARTMENT_ID
    

    Note:

    You can enter this query in any of the following ways:

    • Copy and paste the code from the provided text file called graphics_code.txt into the Data Source definition field.

    • Click Query Builder to build the query without entering any code manually.

    • Type the code in the Data Source definition field.


  8. 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 18.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  9. On the Groups page, click DEPARTMENT_ID and click the right arrow (>) to move this field to the Group Fields list, then click Next.

  10. On the Fields page, move all fields except JOB_ID to the Displayed Fields list, then click Next.

  11. On the Totals page, click Next.

  12. On the Labels page, change the label Department Id to Department, then click Next.

  13. On the Template page, select Predefined Template and click Blue, then click Finish to display your report output in the Paper Design view. It should look something like this:

    Figure 18-2 Paper Design view for the graphics report with one query

    Description of Figure 18-2 follows

PKPi|EPKa3wEOEBPS/orbr_md_sum007.htm Summary

13.7 Summary

Congratulations! You have successfully created a group left summary report. You now know how to:

  • create two queries with a data link between them.

  • create two separate layouts.

  • combine the separate layouts into one.

  • format monetary values.

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".

PK/:4PKa3wEOEBPS/orbr_paptoexcel002.htmH Create a Query and the Layout

29.2 Create a Query and the Layout

The steps in this section show you how to build a simple data model and report layout in the Report Wizard, which you can then use to generate either a JSP-based Web report or a paper report. In the next section, you will modify the JSP, so that the appropriate information displays in your Web report.

To create a data model and layout:

  1. Launch Reports Builder (or, if already open, choose File > New > Report).

  2. In the Welcome or New Report dialog box, select Use the Report Wizard, then click OK.

  3. If the Welcome page displays, click Next.

  4. On the Report Type page, select Create Paper Layout only, then click Next.

  5. On the Style page, select Tabular, then click Next.

  6. On the Data Source page, click SQL Query, then click Next.

  7. On the Data page, enter the following SELECT statement in the Data Source definition field:

    SELECT EMPLOYEES.EMPLOYEE_ID, EMPLOYEES.FIRST_NAME, EMPLOYEES.LAST_NAME,
      EMPLOYEES.HIRE_DATE, EMPLOYEES.SALARY, DEPARTMENTS.DEPARTMENT_NAME,
      LOCATIONS.CITY 
      FROM EMPLOYEES, DEPARTMENTS, LOCATIONS 
      WHERE EMPLOYEES.DEPARTMENT_ID=DEPARTMENTS.DEPARTMENT_ID 
      AND DEPARTMENTS.LOCATION_ID=LOCATIONS.LOCATION_ID 
      ORDER BY CITY
    

    Note:

    You can enter this query in either of the following ways:

    • Copy and paste the code from the papertoexceldata_code.txt file packaged with Oracle Reports, into the Data Source definition field.

    • Click Query Builder to build the query, without entering any code manually.

    • Type the code in the Data Source definition field.


  8. 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 29.1, "Prerequisites for This Example" describes the sample schema requirements for this example.


  9. On the Fields page, click the double right arrows (>>) to move all of the fields to the Displayed Fields list, then click Next.

  10. On the Totals page, click Next.

  11. On the Labels page, click Next.

  12. On the Template page, select Predefined Template and click Wine, and then click Finish to display your report output in the Paper Design view. It should look something like this:

    Figure 29-2 Paper Design Output

    Description of Figure 29-2 follows

  13. Save your report as mypaperreport_your_initials.rdf.

PK~1zMHPKa3wE OEBPS/lof.htm List of Figures

List of Figures

PKqPKa3wEOEBPS/orbr_howto009.htm Work with the Report Layout

4.9 Work with the Report Layout

This section provides procedures for creating and modifying objects in your report layout. The procedures are grouped into the following sections:

4.9.1 General Layout Objects

This section provides procedures for the following tasks that you may perform as you work with container objects:

4.9.1.1 Creating a field object

To create a field object manually in the report layout:

  1. In the Paper Design view, Paper Layout view, or Paper Parameter Form view, click the Field tool in the tool palette.

  2. Click and drag a rectangle.

  3. Double-click the new field object.

  4. In the Property Inspector, under the Field node, set the Source property to the column or parameter that will provide the value for the field.

  5. Set other properties as desired.

See also

Section 1.8.4, "About fields"

Section 1.9.2, "About Parameter Form fields"

4.9.1.2 Creating a frame or repeating frame

To create a frame or repeating frame manually:

  1. In the Paper Layout view, click the Frame tool or the Repeating Frame tool in the tool palette.

  2. Click and drag a rectangle.


    Note:

    The size of the rectangle must be large enough to include the objects that it will contain.


  3. Double-click the new frame object.

  4. In the Property Inspector, set the desired properties.

See also

Section 1.8.1, "About frames"

Section 1.8.2, "About repeating frames"

Section 1.8.3, "About frame and repeating frame sizing"

4.9.1.3 Creating a matrix object


Note:

This procedure provides steps to create a matrix object manually. The recommended method for creating a matrix object is to use the Report Block Wizard (choose Insert > Report Block in the Paper Layout view).


To create a matrix object:

  1. In the Paper Layout view, click the Repeating Frame tool in the tool palette, then drag a rectangle to create a repeating frame.

  2. In the Property Inspector, under Repeating Frame, set the Source property to the "column" for the matrix, and set the Print Direction property to Down.

  3. Click the Repeating Frame tool in the tool palette again, then drag a rectangle to create a second repeating frame, intersecting the first repeating frame.

  4. In the Property Inspector, under Repeating Frame, set the Source property to the "row" for the matrix, and set the Print Direction property to Across.

  5. Drag a rectangle around both repeating frames to select them, then choose Insert > Layout Matrix.

    This creates a matrix object that is the intersection of the two repeating frames. For example:

    Figure 4-1 Example matrix object

    Shows two intersecting rectangles

  6. Double-click the matrix object to set its properties.

See also

Section 2.3.7, "About matrix objects"

Section 1.3.7, "About matrix reports"

Section 2.1.7, "About nested matrix reports"

Section 2.1.8, "About matrix with group reports"

Section 4.8.8, "Creating a matrix (cross-product) group"

Section 4.5.3, "Creating a nested matrix report"

4.9.1.4 Creating a barcode using a barcode font


Note:

Beginning with Oracle9i Reports, Release 2 (9.0.2), you can use a barcode JavaBean that automatically generates the barcode for you. See the example report in Chapter 43, "Building a Report with a Barcode".


To create a barcode using a barcode font:

  1. Install a barcode font on your machine (for example, on Windows, install the barcode font in the Windows Control Panel Font). Barcode fonts are available from most computer stores.


    Note:

    For portability between platforms, you can use a PostScript barcode font to allow you to print your report to any PostScript-enabled output device.


  2. Create a query that selects a column from the database containing the numbers for the barcodes you want included in your report.

  3. In the Paper Layout view, click the barcode field, and choose Format > Font to apply the barcode font to the field.

4.9.1.5 Applying conditional formatting to a layout object

To apply conditional formatting to a layout object:

  1. Click the object, then choose Format > Conditional Formatting.


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. In the Conditional Formatting dialog box, click New to display the Format Exception dialog box.

  3. Specify the conditions and formatting attributes to be applied when the condition(s) evaluate to TRUE.

  4. Click OK.

Usage notes

  • For more complex conditional formatting, you can define conditions against an object using a PL/SQL format trigger in the PL/SQL Editor.

See also

Section 2.1.6, "About conditional formatting"

Chapter 4, "Highlighting a value"

Chapter 4, "Highlighting a row"

4.9.2 Text Objects

This section provides procedures for the following tasks that you may perform as you work with text objects:

4.9.2.1 Creating a boilerplate object for text

To create a boilerplate object for text:

  1. In the Paper Design view, Paper Layout view or Paper Parameter Form view, click the Text tool in the tool palette.

  2. Click and drag a rectangle.

  3. In the new boilerplate object, type the desired text.

    The text you type is composed of paragraphs which are separated by new lines. Text within a paragraph is word-wrapped inside the boilerplate object's horizontal size.

  4. Click outside the boilerplate text object.

See also

Section 1.8.5, "About boilerplate objects"

4.9.2.2 Creating a boilerplate object for text that displays every other page

To create a boilerplate object for text that displays every other page:

  1. Create a boilerplate text object where you want it to appear on the page, either in the margin, or in a repeating frame (expand the repeating frame to make room for the boilerplate text, below the fields in the repeating frame).

  2. Double-click the boilerplate text object to display the Property Inspector. Under the Advanced Layout node, set the Format Trigger property by typing the following code in the PL/SQL Editor:

    function XXX_HDRFormatTrigger return boolean is page_num number; 
    begin 
      srw.get_page_num(page_num); 
      if mod(page_num, 2) = 0 then 
        return(false); 
      else 
        return (true); 
      end if; 
    end; 
    
  3. Run the report to see the boilerplate text appear every other page.

See also

Section 1.8.5, "About boilerplate objects"

4.9.2.3 Creating a boilerplate text object for HTML tags


Note:

This procedure applies to paper-based reports.


To create a boilerplate text object for HTML tags:

  1. In the Paper Design view, click the Text tool in the tool palette.

  2. Click and drag a rectangle.

  3. In the new boilerplate object, type the desired HTML.

  4. Click outside the boilerplate text object.

  5. Double-click the boilerplate text object (or right-click the object, and choose Property Inspector).

  6. In the Property Inspector, under the Web Settings node, set the Contains HTML Tags property to Yes.

Usage notes

When the text object's Contains HTML Tags property is set to Yes, HTML tags and attributes are formatted in your report output as follows:

  • If the report is generated to HTML or HTMLCSS output, all HTML tags and attributes are interpreted and formatted in the output.

  • If the report is generated to other bitmap output formats (for example, PDF, RTF, PostScript), a fixed set of HTML tags and attributes are interpreted and formatted in the output, as described in Section 2.8.9, "About HTML formatting". Any HTML not in the supported set of tags and attributes are not interpreted, and appear as is in the report output.

Example 1: Turning formatting on and off

Consider a text boilerplate object that is defined as follows:

<i><b>Design time format</b> is merged with <span style="font-family:Arial;
color:#00F">run time formatting instructions.</span></i>

With its Contains HTML Tags property set to Yes, this will format as:

Design time format is merged with run time formatting instructions.

With its Contains HTML Tags property set to No, this will format in the report output as:

<i><b>Design time format</b> is merged with <span style="font-family:Arial; color:#00F">run time formatting instructions.</span></i>

Example 2: Boilerplate text object tagged as a hyperlink

In a boilerplate text object, you can type the following text:

<a href=http://your_webserver/reports/my_report.html><img src=oracle.gif> </a>

With the Contains HTML tags property set to Yes, this object will appear in HTML/HTMLCSS report output as a graphic (oracle.gif) , which the end user can click to link to my_report.html.

Example 3: Parameter values output to HTML

In a boilerplate text object, you can type the following Java Applet, called NervousText.class, which takes the object width and height as parameters:

<base href=http://cagney.uk.oracle.com/java/NervousText/>
<applet code="NervousText.class" width=&ObjectWidth height=&ObjectHeight>
<param name=text value="&deptno">
</applet>

With the Contains HTML tags property set to Yes, this object will be interpreted with the parameters replaced with their actual values, as follows:

<base href=http://cagney.uk.oracle.com/java/NervousText/>
<applet code="NervousText.class" width=84 height=72>
<param name=text value="10">
</applet>

See also

Section 1.8.5, "About boilerplate objects"

Section 2.5.1, "About Parameter Form HTML extensions"

4.9.2.4 Editing text

To insert and replace text:

  1. In the Paper Design view, Paper Layout view, or Paper Parameter Form view, single-click the text object.

  2. Click the text to change to edit mode.

  3. Modify the text as desired, then click outside the text object.

To delete text:

  1. In the Paper Design view, Paper Layout view, or Paper Parameter Form view, single-click the text object.

  2. To cut all the text, choose Edit > Delete.

To cut, copy, or paste text:

  1. In the Paper Layout view or Parameter Form view, single-click the text object.

  2. Click and drag to mark the text you want to cut or copy, then choose Edit > Cut or Edit > Copy.

  3. To paste text, choose Edit > Paste.

4.9.2.5 Referencing a field in boilerplate text

To reference a field in boilerplate text:

  1. In the Paper Design view or Paper Layout view, click in the boilerplate text where you want the reference to a field to appear.

  2. Type an ampersand (&) followed by the name of the field.

    If you want to place the field reference in front of other text with no spaces in between, enclose the field name in angle brackets to separate it from the text (for example, &<fieldname>Oracle). If the field reference follows other text, no angle brackets are needed (for example, Oracle&fieldname). You can include field references right next to each other with no spaces in between and without angle brackets (for example, &field1&field2&field3).

Usage notes

  • A reference to a field includes the field's properties. Therefore, if the Horizontal Elasticity property is set to Fixed, any extra spaces in the field will appear in the report output. For example, if field f_sal is fixed horizontally, $&<f_sal>/week may produce $800/week in the report output.

  • In addition to referencing fields in a boilerplate text object, you can directly reference a database column (for example, &SAL). For example, $&<SAL>/week may produce $800/week in the report output.

See also

Section 1.8.4, "About fields"

Section 1.8.5, "About boilerplate objects"

4.9.2.6 Linking a boilerplate text object to a file


Note:

This procedure applies paper-based reports. File Link objects are not implemented in JSP-based Web reports.


To link a boilerplate text object to a file:

  1. In the Paper Design view or Paper Layout view, click the File Link tool in the tool palette.

  2. Click and drag a rectangle.

  3. Double-click the file link object to display the Property Inspector.

  4. Under the File Link Boilerplate node:

    • Set the Source File Format property to Text.

    • Set the Source Filename property to the name of the file containing the text.

See also

Section 1.8.5, "About boilerplate objects"

4.9.2.7 Linking an HTML text object to a file


Note:

This procedure applies to paper-based reports. File Link objects are not implemented in JSP-based Web reports.


To link an HTML object to a file:

  1. In the Paper Design view or Paper Layout view, click the File Link tool in the tool palette.

  2. Click and drag a rectangle.

  3. Double-click the file link object to display the Property Inspector.

  4. Under the File Link Boilerplate node:

    • set the Source File Format property to Text.

    • set the Source Filename property to the name of the file containing the HTML tags.

  5. Under the Web Settings node, set the Contains HTML Tags property to Yes.

Usage notes

When the text object's Contains HTML Tags property is set to Yes, HTML tags and attributes are formatted in your report output as follows:

  • If the report is generated to HTML or HTMLCSS output, all HTML tags and attributes are interpreted and formatted in the output.

  • If the report is generated to other bitmap output formats (for example, PDF, RTF, PostScript), a fixed set of HTML tags and attributes are interpreted and formatted in the output, as described in Section 2.8.9, "About HTML formatting". Any HTML not in the supported set of tags and attributes are not interpreted, and appear as is in the report output.

See also

Section 1.8.5, "About boilerplate objects"

4.9.2.8 Wrapping text in a field

To wrap text in a field:

  1. Choose Tools > Report Wizard.

  2. In the Report Wizard, click the Labels tab.

  3. Change the value in the Width column for the field in which you want to wrap text, as desired.

  4. Click Apply.


    Caution:

    If you have made manual adjustments to your layout in the Paper Layout view or Paper Design view, you will lose these layout changes when you click Apply or Finish in the Report Wizard, which redefaults the layout. If you do not want to overwrite your current layout, you can manually drag the column to the desired width in the Paper Layout view or Paper Design view.


  5. In the Paper Layout view or Parameter Form view, double-click the field to display the Property Inspector, and set the following properties:

    • Under General Layout, verify that the Vertical Elasticity property is set to Expand.

4.9.2.9 Changing text attributes

To change the font, justification, spacing, or reading direction of a text object:

  1. In the Paper Design view, click the text object(s).


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. From the Format menu, choose Font, Justify, Text Spacing, or Direction.

4.9.2.10 Changing text attributes using PL/SQL

To change the font or justification of a text object using PL/SQL instead of the user interface:

  1. In the Object Navigator, expand the Paper Layout node.

  2. Double-click the PL/SQL icon next to the text object(s).


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  3. In the PL/SQL Editor, use the following built-in procedures to change the font or justification of the object as desired:

    SRW.SET_CHARMODE_TEXT

    SRW.SET_FONT_FACE

    SRW.SET_FONT_STYLE

    SRW.SET_FONT_WEIGHT

    SRW.SET_FONT_SIZE

    SRW.SET_JUSTIFICATION

See also

Topic "SRW built-in package" in the Reference > PL/SQL Reference > Built-in Packages section of the Oracle Reports online Help.

4.9.3 Page Numbers or Date/Time Stamps

This section provides procedures for the following tasks that you may perform as you work with page numbers or date/time stamps:

4.9.3.1 Creating page numbers

To create default page numbers:

  1. In the Paper Layout view or Paper Design view, choose Insert > Page Number.

  2. In the Insert Page Number dialog box, choose from the list the location for the page number.

  3. Click the desired page number format: Page Number Only or Page Number and Total Pages.

  4. Optionally, change the default attributes of the page number text as desired.

To create customized page numbers:

  1. In the Paper Layout view or Paper Design view, click the Edit Margin button in the toolbar.


    Note:

    The margin area is defined by a thick black line that separates it from the body. If you create objects in the body portion of a report while displaying the margin area, you can only edit those objects when the margin is displayed.


  2. Create a field object (see Section 4.9.1.1, "Creating a field object") in the margin area for each page number value you require, for example Physical Page Number, Total Physical Pages.

  3. In the field's Property Inspector, under the Field node, set the Source property to the source for the page number, and set the Visible property to No. Under the General Layout node, set the Horizontal Elasticity property to Variable.

  4. Create a boilerplate text object (see Section 4.9.2.1, "Creating a boilerplate object for text") in the margin area, and reference the page number field(s) (see Section 4.9.2.5, "Referencing a field in boilerplate text") using &fieldname.

Usage notes

  • To generate odd page numbers on the right and even pages numbers on the left, you have to create two fields: one on the right side, one on the left side. In the format trigger of each field, you test if it is an odd or an even page by using SRW.GET_PAGE_NUM. Then, you specify whether or not to display the field.

4.9.3.2 Resetting page numbers

To reset default page numbers (created with Insert > Page Number):

  1. In the Paper Layout view or Paper Design view, click the default page number field, then choose Edit > Delete to delete it.

  2. Create customized page numbers (see Section 4.9.3.1, "Creating page numbers").

  3. In the page number field's Property Inspector, under Field, double-click the Page Numbering property value.

  4. In the Page Numbering dialog box, click the desired Reset At setting. Page numbers will reset to the Start at value each time the selected frame is formatted. Click OK.

4.9.3.3 Creating a time or date stamp

To add a date or time stamp to your report:

  1. In the Paper Layout view or Paper Design view, choose Insert > Date and Time.

  2. In the Insert Date and Time dialog box, choose from the list the location for the date or time stamp.

  3. Click the desired date or time format, or click Custom to define your own format.

4.9.4 Borders

This section provides procedures for the following tasks that you may perform as you work with borders:

4.9.4.1 Showing or hiding object borders

To show or hide the borders around an object:

  1. Click the object(s).


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. Click the Line color tool in the tool palette.

  3. To add a border, click any color solid square.

  4. To make a border transparent in the report output, click No Line at the bottom of the color palette.


    Note:

    If you make the borders transparent for all the objects, this includes the underlines beneath the column headings. To add the underlines, click the underline objects, and use the Line Color in the tool palette to select a line color.


  5. To show or hide part of the border, choose Format > Line > Border, and select from the menu to toggle between showing and hiding the sides of the border.

4.9.4.2 Changing object border attributes

To change the borders around an object:

  1. Click the object(s).


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. To change the line width, choose Format > Line > Line Width.

  3. To select a pattern, choose Format > Line > Dash. Even though it appears in the output, the dash pattern is sometimes obscured by the object's outline. You can choose Tools > Options > Paper Layout and clear the Options:Frame Outlines check box.

  4. To "frame" the border, choose Format > Bevel.

See also

Section 2.4.5, "About changing colors and patterns"

Section 4.12.8, "Modifying the color, pattern, or border of body objects in a template"

4.9.4.3 Changing the current mode (Confine or Flex)

To set or override Confine mode:

  • In the Paper Layout view, click the Confine On button or the Confine Off button in the toolbar to toggle the mode:

    On: child objects cannot be moved outside their enclosing parent objects.

    Off: child objects can be moved outside their enclosing parent objects.

To set or override Flex mode:

  • In the Paper Layout view, click the Flex On button or the Flex Off button in the toolbar to toggle the mode:

    On: parent borders "stretch" when child objects are moved against them. The child object maintains the same distance from the side it moves against.

    Off: parent borders remain fixed when child objects are moved against them.

See also

Section 2.4.7, "About moving and layering objects in the Paper Layout view"

Chapter 4, "Adjusting parent borders automatically"

Chapter 4, "Moving an object outside its parent"

4.9.5 Anchors

This section provides procedures for the following tasks that you may perform as you work with anchors:

See also

Section 2.4.4, "About anchors"

4.9.5.1 Anchoring objects together

Anchoring objects assures that the anchored object will move with the parent object. An object can be anchored to only one other object.

To anchor objects together:

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

  2. Click an edge of the child object and double-click an edge of the parent object.

    A line is drawn from the child to the parent. A small box appears at the end of the line that is attached to the parent object.

4.9.5.2 Viewing implicit anchors

By default, you see the explicit anchors created in the Paper Layout view of the Report Editor.

To view information on both implicit and explicit anchors:

  1. In the Object Navigator, choose Tools > Options > Navigator to display the Object Navigator Options dialog box.

  2. Click the Layout tab, and select the Anchoring Information check box.

    With this option selected, you can see all information on both implicit and explicit anchors in the Object Navigator.


    Note:

    By default, objects are anchored to the upper left corner of their enclosing object. If this view of the Object Navigator does not show anchoring information for an object, you can assume that the object is anchored to its enclosing object, which might be the frame or the body.


See also

Section 2.4.4.1, "Implicit anchoring algorithm"

4.9.5.3 Moving an anchor

Moving an anchor changes how the objects will be displayed in relationship to each other.

To move an anchor:

  1. In the Paper Layout view, click the anchor.

  2. Click the Reshape tool in the tool palette, then drag one of the anchor endpoints to its new location on the object edge.

To move an anchor along an object edge:

  • Press the constrain (for example, shift) key when moving the anchor.

To change the position of the anchor on the object edge, as a percentage down or across from top to bottom or left to right:

  1. Double-click the anchor object to display the Property Inspector.

  2. Set the Child Edge Percent property or Parent Edge Percent property to a new value.

To change the edge on which the anchor is positioned:

  • Set the Child Edge Type property or Parent Edge Type property as desired.

4.9.6 Colors, Patterns, and Highlighting

This section provides procedures for the following tasks that you may perform as you work with colors, patterns, and highlighting:

4.9.6.1 Setting color palette preferences

See Section 4.2.6, "Setting color palette preferences".

4.9.6.2 Changing colors

To change the color of an object or text:

  1. In the Paper Layout view, click the object(s).


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. Click the Fill Color tool, the Line Color tool, or the Text Color tool in the tool palette, depending on which part of the object you want to apply a color to.


    Note:

    The Fill/Line/Text Display, the box directly above the three Color tools, shows the currently selected fill, border, and text. The default fill and border for objects created by Oracle Reports Builder is transparent, while the default for objects you create is a black, one-point line around a white.


  3. On the color palette, click a color.

See also

Section 2.4.5, "About changing colors and patterns"

Section 4.12.8, "Modifying the color, pattern, or border of body objects in a template"

4.9.6.3 Changing patterns

To change the pattern of an object:

  1. In the Paper Layout view, click the object(s).


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. Click the Fill Color tool or the Line Color tool in the tool palette, depending on which part of the object you want to apply a pattern to.


    Note:

    The Windows platform does not support a border pattern (that is, patterns for the Line Color tool).


  3. On the color palette, click Patterns.

  4. On the pattern palette, click a pattern. To change the foreground and background colors, choose from the color palettes at the bottom of the pattern palette.

See also

Section 2.4.5, "About changing colors and patterns"

Section 4.12.8, "Modifying the color, pattern, or border of body objects in a template"

Topic "Pattern color palette" in the Reference > Color and Pattern Palettes section of the Oracle Reports online Help.

4.9.6.4 Changing colors and patterns using PL/SQL

To change the color of an object using PL/SQL instead of the user interface:

  1. In the Object Navigator, expand the Paper Layout node.

  2. Double-click the PL/SQL icon next to the object for which you want to change the color.

  3. In the PL/SQL Editor, use the following built-in procedures to change the color of the object as desired:

    SRW.SET_BACKGROUND_BORDER_COLOR

    SRW.SET_BACKGROUND_FILL_COLOR

    SRW.SET_FOREGROUND_BORDER_COLOR

    SRW.SET_FOREGROUND_FILL_COLOR

    SRW.SET_TEXT_COLOR

    SRW.SET_BORDER_PATTERN

See also

Section 2.4.5, "About changing colors and patterns"

Topic "SRW built-in package" in the Reference > PL/SQL Reference > Built-in Packages section of the Oracle Reports online Help.

4.9.6.5 Modifying the color palette

To modify the color palette:

  1. First, make the color palette editable:

    • Choose Edit > Preferences, and set Color Mode to Editable, as described in Section 4.2.6, "Setting color palette preferences".


      Note:

      By default, color palettes are read-only.


    • Shut down and restart Oracle Reports Builder to enable the Editable mode.

  2. In the Paper Layout view, choose Format > Color Palette > Edit.

  3. In the Color Palette dialog box, modify the color palette as desired:

    • Click Edit to alter the settings of the current color.

    • Type a new name in Current Color, then click Rename to rename the current color.

    • Select Color to Edit contains the current color palette being used in the Report Editor for the current report. Select a color from the palette to alter it.

    • Click OK to apply your changes to the current report.


Note:

A report can have only one color palette.


See also

Section 2.4.5, "About changing colors and patterns"

Topics "Oracle CDE1 color palette", "Default color palette", and "Grayscale color palette" in the Reference > Color and Pattern Palettes section of the Oracle Reports online Help.

4.9.6.6 Importing or exporting a color palette

To import or export a color palette:

  1. First, make the color palette editable:

    • Choose Edit > Preferences, and set Color Mode to Editable, as described in Section 4.2.6, "Setting color palette preferences".


      Note:

      By default, color palettes are read-only.


    • Shut down and restart Oracle Reports Builder to enable the Editable mode.

  2. In the Paper Layout view, choose Format > Color Palette > Import or Format > Color Palette > Export.

  3. In the dialog box, specify the name and format of the file.

  4. Click OK.


Note:

A report can have only one color palette.


See also

Section 2.4.5, "About changing colors and patterns"

Topics "Oracle CDE1 color palette", "Default color palette", and "Grayscale color palette" in the Reference > Color and Pattern Palettes section of the Oracle Reports online Help.

4.9.6.7 Highlighting a value

To highlight a value in a report:

  1. In the Paper Layout view or Paper Design view, click the field that contains the value to be highlighted.

  2. Choose Format > Conditional Formatting.

  3. In the Conditional Formatting dialog box, click New to display the Format Exception dialog box.

  4. Select the field and define the condition(s) when the value should be highlighted.

  5. In the Format group box, select the Fill Color to be used to highlight the value.


    Note:

    If you can't select the condition you want to use in the dialog box, select the formatting you want and a placeholder condition. The condition can be edited in the PL/SQL Editor for the format trigger that is created.


  6. Click OK to close the Format Exception dialog box, then click OK again to close the Conditional Formatting dialog box. If the code compiles without errors, the new formatting is reflected in the Paper Layout view. The code is stored as a format trigger for the field.

Example

The following code determines the monthly compensation and changes the background color to red if the compensation has exceeded four thousand dollars a month and the employee is not a manager.

function R_G_EMPNOFormatTrigger return boolean is varcomm number;
begin
 if :comm is null then
   varcomm := 0;
 else
   varcomm := :comm;
 end if;
  if (:sal * 2 + varcomm > 4000) and :job != 'MANAGER' then
   srw.set_background_fill_color('red');
 end if;
 return (TRUE);
end;

See also

Section 2.1.6, "About conditional formatting"

Section 4.9.1.5, "Applying conditional formatting to a layout object"

4.9.6.8 Highlighting a row

To highlight an entire row:

  1. In the Paper Layout view, click the repeating frame that contains the fields that make up the rows to be highlighted.

  2. Choose Format > Conditional Formatting.

  3. In the Conditional Formatting dialog box, click New to display the Format Exception dialog box.

  4. Select the field(s) and define the condition(s) that describe the rows to be highlighted.

  5. In the Format group box, select the Fill Color to be used to highlight the row.


    Note:

    If you can't select the condition you want to use in the dialog box, select the formatting you want and a placeholder condition. The condition can be edited in the PL/SQL Editor for the format trigger that is created.


  6. Click OK to close the Format Exception dialog box, then click OK again to close the Conditional Formatting dialog box. If the code compiles without errors, the new formatting is reflected in the Paper Layout view. The code is stored as a format trigger for the repeating frame.

Example

The following code determines the monthly compensation and changes the background color to red if the compensation has exceeded four thousand dollars a month and the employee is not a manager.

function R_G_EMPNOFormatTrigger return boolean is varcomm number;
begin
if :comm is null then
  varcomm := 0;
else
  varcomm := :comm;
end if;

if (:sal * 2 + varcomm > 4000) and :job != 'MANAGER' then
  srw.set_background_fill_color('red');
end if;
  return (TRUE);
end;

See also

Section 2.1.6, "About conditional formatting"

Section 4.9.1.5, "Applying conditional formatting to a layout object"

4.9.6.9 Alternating row colors

To alternate the colors of either the text or the fill of a row:

4.9.7 Format Masks

This section provides procedures for the following tasks that you may perform as you work with format masks:

4.9.7.1 Specifying date and time format masks

The following tables describe the date and time format masks, and the suffixes you can add to date format masks:

Table 4-2 Date and time format masks

Format MaskDescription

SCC or CC

Century, abbreviated; 'S' prefixes "BC" with (-)

SYYYY or YYYY

Year; 'S' prefixes "BC" date with a (-)

I or IY or IYY

Last 1, 2, or 3 digit(s) of year

Y or YY or YYY

Last 1, 2, or 3 digit(s) of year

Y,YYY

Year with comma

SYEAR or YEAR

Year, spelled out; 'S' prefixes "BC" date with (-)

RRRR or SRRRR

Year; 'S' prefixes "BC" date with a (-)

RR

Last 2 digit(s) of year

BC, AD, or B.C., A.D.

Century indicator

Q

Quarter of year (Jan-Mar= Quarter 1)

MM

Month in digits (Jan = 01)

MONTH or MON

Name of month, or 3-letter abbreviation

WW, IW

Week in year

W

Week in Julian days

J

Julian day; the number of days since January 1,4712 BC

DDD, DD, or D

Day in year, month, or week

DAY

Day of week fully spelled out (for example, MONDAY)

DY

Name of day, 3-letter abbreviation (for example, MON)

AM, PM, or A.M., P.M.

Meridian indicator

HH or HH12

Hour of day (1-12)

HH24

Hour of day (0-23)

MI

Minute

SS; SSSSS

Second in minute; seconds in day

FM

Toggles fill mode which replaces multiple spaces before or between dates, numbers, or words with a single space


The following suffixes may be added to the format masks:

Table 4-3 Date format mask suffixes

SuffixDescription

TH

Suffixed number ("DDth" for "4th")

SP

Spelled out number ("DDSP" for "FOUR")

SPTH or THSP

Spelled and suffixed number ("DDSPTH" for "FOURTH")


Examples

Table 4-4 Date format mask examples

Sample Date FormatDate Displayed

MM/DD/RR

03/04/09

DD MON RRRR

04 MAR 2009

Mon. DD, RRRR

Mar. 4, 2009

Day Month DD fmHH:MI AM

Monday March 4 11:35 AM

Dy Mon ddth fmHH24:MI:SS

Mon Mar 4th 23:35:22

Day "the" ddthsp "of" Month

Monday the fourth of March


4.9.7.2 Specifying number format masks

The following table describes the tokens you can use in creating a number format mask:

Table 4-5 Tokens for number format masks

Format TokenDescription

0

Prints one digit.

N

Prints one digit, unless it is a leading zero to the left of the decimal point or a trailing zero to the right of the decimal point.

*


Prints one digit, unless it is a leading zero to the left of the decimal point, in which case an asterisk (*) is printed. Trailing zeros to the right of the decimal point are printed.

9

Prints one digit, unless it is a leading zero to the left of the decimal point, in which case a space is printed. Trailing zeros to the right of the decimal point are printed.

+


Prints a leading plus (+) for positive values and a leading minus (-) for negative values. This token must lead the mask.

-

Prints a leading minus (-) for negative values and nothing for positive values. This token must lead the other tokens.

MI

Prints a minus (-) after negative values and a space after positive values. This token must trail the other tokens.

S

Prints a minus (-) for negative values and a plus (+) for positive values (wherever the S appears in the mask). This token must lead or trail the other tokens.

PR

Prints angle brackets (<>) around negative values and spaces around positive values. This token must trail the other tokens.

( )

Prints parentheses around negative values and spaces around positive values. The parentheses must surround the other tokens.

DB

Prints a "DB" after positive values. This token must trail the other tokens.

CR

Prints a "CR" after negative values. This token must trail the other tokens.

Y

Causes no sign symbol to be printed for negative or positive values.

V

Causes the number to be multiplied by 10N, where N is the number of 0, 9, *, and S tokens that appear to the right of the V.

EEEE

Causes the number to be printed in scientific notation. All digit tokens refer to digits of the mantissa. There must be exactly one digit to the left of the decimal point (displayed or implicit). The token EEEE prints as E followed by a plus (+), if the ordinate is positive or zero, and a minus (-), if the ordinate is negative, and two digits representing the ordinate (for example, E-99).

"string"

Prints the string between the double quotes. To have double-quotes inside the string, type double-quotes back to back ("").

. (period)

Prints a period (.) to separate the integral and fractional parts of a number.

D

Prints the local decimal character to separate the integral and fractional parts of a number.

, (comma)

Prints a comma (,) as the group/thousands separator.

G

Prints the local group/thousands separator.

$


Prints $

L

Prints the local currency symbol.

C

Prints the ISO currency symbol.

%


Prints %.

" "

Prints a blank space. (Do not include quotes in mask.)

v

Prints a blank space for all zero values, regardless of other tokens.

K

Prints a blank space.

<>

Delineates the beginning and ending of the decimal-aligned region (that is, that part of the number that you want aligned with the decimal point in the format mask). Angle brackets indicate that the number should always occupy the same amount of space. If necessary, values are padded with blanks to the left or right of the decimal point.

RN, rn

Prints values in uppercase or lowercase Roman numerals, respectively. You cannot enter any other tokens with this token.


Restrictions

  • For number format masks, if the actual value is longer than the specified format mask, the value will appear as a string of asterisks in the report output, regardless of the field's width. For example, if a fixed field's width is 8, the value is 1234567, and the format mask is <NNNNNN>, your output will be *******.

  • Similarly, if the number format mask causes the value to be larger than the field width, asterisks will appear in place of the value. For example, if a fixed field's width is 6, the value is 1234, and the format mask is -99999999, your output will be ******. This occurs because the format token 9 prints a blank for leading zeros to the left of the decimal. As a result, the value is too long to be displayed in a field of width 6.

  • If you do not specify a sign token in the format mask, positive values are preceded by a space and negative values are preceded by a minus (-).

  • After you create a format mask it will display in the list of values only if it is an appropriate format mask for the Datatype of the Source. That is, format masks for numbers are displayed when the Source is a number, and format masks for dates are displayed when the Source is a date.

  • Format masks that print spaces for zeros (for example, 9) increase the number of bytes per page taken up by your output.

Examples

Table 4-6 Number format mask examples

Sample Number FormatNumberNumber Displayed

-0000

7934

"7934"


-7934

"-7934"

-00000

7934

"07934"

-NNNN

7639

"7639"


535

"535"

-NNN

7639

"****"

-****

7902

"7902"

-*****

7902

"*7902"

+NNNN

100

"+100"


-99

"-99"

(NNNN)

1600

" 1600 "


-800

"(800)"

NNNNPR

1600

" 1600 "


-800

"<800>"

NNNNMI

1600

"1600 "


-800

"800-"

NNNVNN

343

"34300"

N.NNEEEE

7369

"7.37E+03"

"SRW"-0000

7782

"SRW7782"

-$NNNN.NN

800

"$800"


1600

"$1600"

-%NNN

10

"%10"

-NN NNN.NN

3000

"3 000"

+KKNNNNN.00

1950

"+ 1950.00"


900

"+ 900.00"

$<NNNNN.00>

1200

"$1200.00"


500

"$500.00"

$<NNNNN.00> DB

1200

"$1200.00 DB"


-500

"$500.00"

$<NNNNN.00> CR

1200

"$1200.00"


-500

"$500.00 CR"


* The quotation marks will not appear in your output. They are used here to make it clear where there are leading or trailing spaces.

4.9.7.3 Applying a format mask to a numeric object

  1. To apply a format mask to a numeric object:

  2. In the Paper Design view, click the object(s).


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  3. To apply the currency format to the object, click the Currency button in the toolbar.

  4. To apply the percentage format to the object, click the Percentage button in the toolbar.

  5. To add commas to the value of the object, click the Commas button in the toolbar. To move the comma right or left, click the Remove Decimal Place button or the Add Decimal Place button.

  6. Choose Tools > Property Inspector.

  7. Under the Field node, verify the Format Mask property is set to the desired format.

  8. Set other properties as desired.

4.9.7.4 Applying a format mask to a date object

To apply a format mask to a date object:

  1. In the Paper Design view, click the object(s).


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. Choose Tools > Property Inspector.

  3. Under the Field node, set the Format Mask property to the desired date format.

  4. Set other properties as desired.

4.9.7.5 Adding a custom format mask

To add a custom format mask to the default format masks list:

  1. Choose Edit > Preferences.

  2. In the Preferences dialog box, click Edit Masks.

  3. In the Format Masks dialog box, set Display to the type of format mask you want to add.

  4. In the Mask field, type the format mask to add, then click Add.

  5. Click OK.

    Now, you will see your new custom format masks in the list of values for the Format Mask property for fields and the Input Mask property for parameters.

4.9.7.6 Changing the format mask for multiple fields

To change the format mask for multiple fields at one time:

  1. In the Paper Layout view, click the fields you want to change.

  2. Choose Tools > Property Inspector.

  3. In the Property Inspector, set the Format Mask property to a new format mask.

4.9.8 Graphic or Image Objects

This section provides procedures for the following tasks that you may perform as you work with graphic or image objects:

4.9.8.1 Adding an image

To add an image to your report, perform the steps in any of the topics listed below.

For paper-based reports and JSP-based Web reports:

For paper-based reports only:

See also

Section 2.4.3, "About images"

4.9.8.1.1 Importing an image


Note:

This procedure applies to paper-based reports. For JSP-based Web reports, see the Usage notes, below.

These steps allow you to include images in the following formats: TIFF, JFIF, BMP, TGA, PCX, PICT, GIF, CALS, RAS, OIF, PCD. For images in other formats supported by Oracle Reports, including JPEG (all types, such as Progressive JPEG and Exif JPEG), PNG, BMP, TIFF, GIF, and CGM, see Section 4.9.8.1.2, "Linking an image object to a file" or Section 4.8.5, "Selecting an image from the database".


To import an image:

  1. In the Paper Layout view, choose Insert > Image and click the type of object you want to import.

  2. In the dialog box, specify the name and format of the file. Click OK.

  3. Move the object to the desired position.

Usage notes

This procedure is for paper-based reports only. If you want to include static images in your JSP-based Web reports, you can add HTML <img> tags in the Web Source view.

4.9.8.1.2 Linking an image object to a file


Notes:

This procedure applies to paper-based reports. File link objects are not implemented in JSP-based Web reports.

These steps, and the steps in Section 4.8.5, "Selecting an image from the database", allow you to include images in a wide variety of formats supported by Oracle Reports, including JPEG (all types, such as Progressive JPEG and Exif JPEG), PNG, BMP, TIFF, GIF, and CGM. For paper-based reports, you can also use Insert > Image to import an image from a file into the report layout for images in the following formats: TIFF, JFIF, BMP, TGA, PCX, PICT, GIF, CALS, RAS, OIF, PCD (see Section 4.9.8.1.1, "Importing an image", above).


To link an image object to a file:

  1. In the Paper Design view or Paper Layout view, click the File Link tool in the tool palette.

  2. Click and drag a rectangle.

  3. Double-click the file link object to display the Property Inspector.

  4. Under the File Link Boilerplate node:

    • Set the Source File Format property to Image.

    • Set the Source Filename property to the name of the file containing the image.

4.9.8.1.3 Linking an image object to a URL


Notes:

This procedure applies to paper-based reports output to an HTML or HTMLCSS file. This is unrelated to HTML that might be generated when you run a JSP-based Web report (when you click the Run Web Layout button in the toolbar, or choose Program > Run Web Layout). Additionally, file link objects are not implemented in JSP-based Web reports.

These steps, and the steps in Section 4.8.6, "Selecting an image URL from the database", allow you to include images in a wide variety of formats supported by Oracle Reports, including JPEG (all types, such as Progressive JPEG and Exif JPEG), PNG, BMP, TIFF, GIF, and CGM. For paper-based reports, you can also use Insert > Image to import an image from a file into the report layout for images in the following formats: TIFF, JFIF, BMP, TGA, PCX, PICT, GIF, CALS, RAS, OIF, PCD (see Section 4.9.8.1.1, "Importing an image", above).


To link an image object to a URL that points to an image to include in an HTML report:

  1. In the Paper Design view or Paper Layout view, click the File Link tool in the tool palette.

  2. Click and drag a rectangle.

  3. Double-click the file link object to display the Property Inspector.

  4. Under the File Link Boilerplate node:

    • Set the Source File Format property to Image URL.

    • Set the Source Filename property to the URL where the image is located with the required protocol.

Example 1: Image URL

HTTP://www.oracle.com/images/logo.gif

Example 2: Image URL containing user parameter

HTTP://&<P_SERVER_NAME>/images/logo.gif 

where P_SERVER_NAME is a user parameter of type CHAR.

At runtime, the end user can specify a value for the parameter (for example,
P_SERVER_NAME=www.oracle.us.com
for a dynamic URL link of http://www.oracle.us.com/images/logo.gif).

Example 3: URL to a file

FILE://c:/images/logo.gif

Note:

If you click Browse to find a file, Oracle Reports automatically prepends FILE:// to the returned path.


4.9.8.2 Adding a graph

To add a graph to your report, follow the steps in either of the following topics:

Usage notes

Inserting a graph with a once-per-group position in the Paper Design view of a matrix with group report causes Oracle Reports Builder to fail. As a workaround, insert the graph in the Paper Layout view, rather than the Paper Design view, when adding a graph to a matrix with group report.

See also

Section 1.6.6, "About the Web Source view"

Chapter 39, "Building a Report with Graphs"

4.9.8.2.1 Adding a graph to a paper-based report

To add a graph to your paper-based report:

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

  2. Drag a square in the area where the graph should appear to display the Graph Wizard.

  3. In the Graph Wizard, specify information for the graph. Click Help on any wizard page for assistance.


    Note:

    When you specify a graph title, subtitle, footnote, or axis title in the Graph Wizard, you can insert lexical references (to user parameters, system parameters, and columns) in the text. For example, in the Show Title field on the Title page of the Graph Wizard, type: titletext &<P_1> to insert the value of the user parameter P_1 into the title text at runtime. The angle brackets (<>) are required around the parameter or column name.


  4. Double-click the graph object you have created to display the Property Inspector, and set properties as desired.

    To customize your graph XML definition beyond the scope of the Graph Wizard, you can directly edit the XML in the graph's Graph Settings property. The full list of attributes available is defined in the DTD file, graph.dtd.


    Note:

    The graph.dtd is available in the following locations:

    • ORACLE_HOME\jlib\bigraphbean.jar

    • In Getting Started with Oracle Reports on the Oracle Technology Network (OTN): on the Oracle Reports page (http://www.oracle.com/technology/products/reports/index.html), click Getting Started to display the Getting Started with Oracle Reports home page. In the list of topic sections on the left, click Index. In the Collateral Type list, choose Documentation and click Search. In the list that displays, find the Documented Graph DTD.


  5. To re-enter the Graph Wizard, do either of the following:

    • Right-click the graph, and choose Graph Wizard.

    • Click the graph, then choose Edit > Settings.

4.9.8.2.2 Adding a graph to a JSP-based Web report

To add a graph to a JSP-based Web report:

  1. In the Object Navigator, double-click the view icon next to the Web Source node to display the source code in the Web Source view.

  2. Locate the section in the source code where you want to add the graph.


    Note:

    Previously adding some text such as "Place the graph here" to your Web page enables you to easily locate the correct position for your graph.


  3. Choose Insert > Graph.

  4. In the Graph Wizard, specify the information for the graph. Click Help on any tab page for assistance.


    Note:

    When you specify a graph title, subtitle, footnote, or axis title in the Graph Wizard, you can insert lexical references (to user parameters, system parameters, and columns) in the text. For example, in the Show Title field on the Title page of the Graph Wizard, type titletext &<P_1> to insert the value of the user parameter P_1 into the title text at runtime. The angle brackets (<>) are required around the parameter or column name.


  5. Click the Run Web Layout button in the toolbar (or choose Program > Run Web Layout) to display your report and graph in your Web browser.


    Note:

    If Netscape 7.0 is your default browser, and the browser does not display, set the registry key HKEY_CURRENT_USERS\Software\Oracle\Toolkit\Tkbrowser to the default browser location. Ensure that the BrowserName and the BrowserPath keys reflect the correct values. For example: BrowserName=Netscape 7; BrowserPath=C:\Program Files\Netscape\Netscape\Netscp.exe.


  6. To re-enter the Graph Wizard, place your cursor anywhere between the <rw:graph> and </rw:graph> tags in the Web Source view, then choose Edit > Settings.

    To customize your graph XML definition beyond the scope of the Graph Wizard, you can directly edit the XML in the Web Source view. The full list of attributes available is defined in the DTD file, graph.dtd.


Note:

The graph.dtd is available in the following locations:

  • ORACLE_HOME\jlib\bigraphbean.jar

  • In Getting Started with Oracle Reports on the Oracle Technology Network (OTN): on the Oracle Reports page (http://www.oracle.com/technology/products/reports/index.html), click Getting Started to display the Getting Started with Oracle Reports home page. In the list of topic sections on the left, click Index. In the Collateral Type list, choose Documentation and click Search. In the list that displays, find the Documented Graph DTD.


4.9.8.3 Editing a graph

To add a graph to your report, follow the steps in either of the following topics:

See also

Section 1.4.4, "About Graphs and the Graph Wizard"

Section 1.6.6, "About the Web Source view"

4.9.8.3.1 Editing a graph in a paper-based report

To edit a graph in a paper-based report:

  1. In the Paper Layout view, click the graph.


    Note:

    The graph is represented as a bar graph even if the graph is of another type.


  2. To edit the XML definition of the graph:

    • Right-click the graph, and choose Property Inspector.

    • In the Property Inspector, under the Graph node, click the Graph Settings property value field to display the Graph Settings dialog box. To customize your graph XML definition beyond the scope of the Graph Wizard, specify additional rw:graph tag attributes. The full list of attributes available is defined in the DTD file, graph.dtd.


      Note:

      The graph.dtd is available in the following locations:

      • ORACLE_HOME\jlib\bigraphbean.jar

      • In Getting Started with Oracle Reports on the Oracle Technology Network (OTN): on the Oracle Reports page (http://www.oracle.com/technology/products/reports/index.html), click Getting Started to display the Getting Started with Oracle Reports home page. In the list of topic sections on the left, click Index. In the Collateral Type list, choose Documentation and click Search. In the list that displays, find the Documented Graph DTD.


  3. To re-enter the Graph Wizard to redefine the graph, do either of the following:

    • Right-click the graph, and choose Graph Wizard.

    • Click the graph, then choose Edit > Settings.

4.9.8.3.2 Editing a graph in a JSP-based Web report

To edit a graph in a JSP-based Web report, do any of the following in the Web Source view:

  • Place your cursor anywhere between the <rw:graph> and </rw:graph> tags, then choose Edit > Settings to re-enter the Graph Wizard.


    Note:

    Any manual changes and additions you've made to the graph XML will be lost if you click Finish, which redefaults the graph to the definition in the Graph Wizard.


  • Delete and re-create the graph as follows:

    1. Delete all lines from the <rw:graph> tag to the </rw:graph> tag.

    2. Leaving the cursor in the position where the graph was cut, choose Insert > Graph and follow the Graph Wizard to re-create the graph.

  • Between the <rw:graph> and </rw:graph> tags that define the graph, make changes directly to the JSP and XML tags. This enables you to customize your graph XML definition beyond the scope of the Graph Wizard. The full list of attributes available is defined in the DTD file, graph.dtd.


Note:

The graph.dtd is available in the following locations:

  • ORACLE_HOME\jlib\bigraphbean.jar

  • In Getting Started with Oracle Reports on the Oracle Technology Network (OTN): on the Oracle Reports page (http://www.oracle.com/technology/products/reports/index.html), click Getting Started to display the Getting Started with Oracle Reports home page. In the list of topic sections on the left, click Index. In the Collateral Type list, choose Documentation and click Search. In the list that displays, find the Documented Graph DTD.


4.9.8.4 Adding a graph hyperlink

You can add a graph hyperlink to a graph in your paper-based Web report (output to PDF or HTML), or JSP-based Web report. When end users display the report on the Web, they can click the areas of the graph to drill down to additional linked information.

To add a graph hyperlink to a graph, follow the steps in either of the following topics:

See also

Section 2.2.6, "About graph hyperlinks"

Section 1.4.4, "About Graphs and the Graph Wizard"

Section 1.6.6, "About the Web Source view"

4.9.8.4.1 Adding a graph hyperlink to a paper-based report

For a paper-based Web report (for HTML or PDF output), you can add a graph hyperlink to a graph in either of the following ways:

  • Property Inspector

  • Graph Wizard

To specify a graph hyperlink in a paper-based report using the Property Inspector:

  1. In the Paper Layout view, display the Property Inspector for the graph.

  2. Set the Graph Hyperlink property to a hyperlink from any graph section to any object in your report output, another report, or any valid hyperlink destination.

    Examples:

    • A hyperlink from any graph section to any object in your report:

      #&<dept_id>

    • A hyperlink to another report:

      http://my_machine:8888/reports/myWebApp/Dept_Detail.jsp? p_deptid=&<deptid>+...

    • A hyperlink to any valid hyperlink destination:

      www.oracle.com

To specify a graph hyperlink in a paper-based report using the Graph Wizard:

  1. On the Define Hyperlink panel, use the examples shown on the panel to enter a hyperlink value to link areas of the graph to specified destinations.

  2. Click Finish.

After you have defined the graph hyperlink, generate your report to HTML, HTMLCSS, or PDF to test the graph hyperlinks. Refer to Section 4.7.5, "Generating HTML or HTMLCSS output" and Section 4.7.6, "Generating PDF output".

4.9.8.4.2 Adding a graph hyperlink to a JSP-based Web report

To add a graph hyperlink to a graph in a JSP-based Web report:

  • In the Web Source view of your report, modify the <rw:graph> JSP tag to include the graphHyperlink attribute.

    For example:

    graphHyperlink="http://my_machine:8888/reports/myWebApp/Dept_Detail.jsp? userid=hr/hr@mydb+server=myserver+p_deptno=&<deptno>"

After you have defined the graph hyperlink, click the Run Web Layout button in the toolbar (or choose Program > Run Web Layout) to display your report and graph in your Web browser, and click the graph hyperlinks to test them.

4.9.8.5 Creating a drawing object

To create a drawing object:

  1. In the Paper Layout view, click a drawing tool in the tool palette (for example, Rectangle, Ellipse, Polyline, and so on).

  2. To create a line, rounded rectangle, rectangle, ellipse, arc, or freehand object, click in the main area (canvas region) of the window and drag to create the object.

  3. To create a polygon or polyline, click in the main area (canvas region) of the window where you want each point of the object, then double-click to create the object.

  4. To draw constrained objects (that is, perfect circles and squares, and so on), hold down the constrain key (for example, the shift key) when drawing the graphic.

  5. Double-click the drawing object.

  6. In the Property Inspector, set the desired properties.

4.9.9 Page or Group Headers or Footers

This section provides procedures for the following tasks that you may perform as you work with page or group headers or footers:

4.9.9.1 Creating a text heading

To create an object or heading in the margin of a report:

  1. In the Paper Layout view, click the Edit Margin button in the toolbar.


    Note:

    The margin area is defined by a thick black line that separates it from the body. If you create objects in the body portion of a report while displaying the margin area, you can only edit those objects when the margin is displayed.


  2. To adjust the margin, click the margin border, then drag a handle to the desired position. Yo}u can adjust the margin on all four sides of a report.

  3. Create required objects in the margin area. They will appear on all pages of the report.

  4. Click the Header Section, Main Section, or the Trailer Section buttons in the toolbar to reactivate the appropriate section of the body area of the report.

4.9.9.2 Creating a heading that includes database values

To create a heading that includes database values:

  1. Choose Tools > Report Wizard to re-enter the Report Wizard for the current report.

  2. On the Totals page, create any totals that you want to include in the heading.


    Note:

    Any totals that you intend to place in the margin area of your report must be report-level totals. Group totals (for example, the total for a department) placed in the margin will cause a frequency error when you run your report.


  3. On the Fields page, verify that the fields and totals you want to include in the heading are either available or displayed in the report.

  4. In the Paper Layout view, click the Margin button in the toolbar.


    Note:

    The margin area is defined by a thick black line that separates it from the body. If you create objects in the body portion of a report while displaying the margin area, you can only edit those objects when the margin is displayed.


  5. For any values that require a format mask, create a hidden field object in the margin area (see Section 4.9.1.1, "Creating a field object"):

    • In the Property Inspector, under the Field node, set the Source property to the source column for the value, set the Visible property to No, and set the Format Mask property as desired.

    • Under the General Layout node, set the Horizontal Elasticity property to Variable.


      Note:

      If you do not need to specify a format mask, you can simply reference the value directly in Step 6, and you do not need to create this hidden field.


  6. Create a boilerplate text object in the margin area, and reference the field or report-level totals you want to include in the heading. See Section 4.9.2.1, "Creating a boilerplate object for text" and Section 4.9.2.5, "Referencing a field in boilerplate text".

See also

The example report in Chapter 17, "Building a Header with Database Values Report".

4.9.9.3 Creating a group header or footer

To create a header or footer above or below each group of records:

  1. In the Paper Layout view, click the Confine Off button and the Flex On button in the toolbar.

  2. Click frame that encloses the repeating frame for the group to which you want to add a header or footer, then drag and resize the frame to allow enough room to type the header or footer text.


    Tip:

    In the Object Navigator, under the Paper Layout node, expand the Body node to select the frame by name.


  3. Create a boilerplate text object for the header or footer text (see Section 4.9.2.1, "Creating a boilerplate object for text").

4.9.10 Margin, Header Page, or Trailer Page Objects

This section provides procedures for the following tasks that you may perform as you work with margin, header page, or trailer page objects:

4.9.10.1 Creating a margin object

To create an object or heading in the margin of a report:

  1. In the Paper Layout view, click the Edit Margin button in the toolbar.


    Note:

    The margin area is defined by a thick black line that separates it from the body. If you create objects in the body portion of a report while displaying the margin area, you can only edit those objects when the margin is displayed.


  2. To adjust the margin, click the margin border, then drag a handle to the desired position. You can adjust the margin on all four sides of a report.

  3. Create required objects in the margin area. They will appear on all pages of the report.

  4. Click the Header Section, Main Section, or the Trailer Section buttons in the toolbar to reactivate the appropriate section of the body area of the report.

4.9.10.2 Creating a header page or trailer page object

With report sectioning, Header and Trailer pages are identical to Body pages. In effect, this means that the Header, Trailer, and Body are three sections of a report. The names of the sections are exposed under the Paper Design node in the Object Navigator as Header Section, Main Section, and Trailer Section. You can use the margin and body of the Header and Trailer sections to create a Header and Trailer "page" as in earlier releases of Oracle Reports.

  1. In the Paper Layout view, click the Confine Off button and the Flex On button in the toolbar.

  2. Click the repeating frame for the page, then drag and resize the frame to allow enough room to type the header or footer text.


    Tip:

    In the Object Navigator, under the Paper Layout node, expand the Body node to select the repeating frame by name.


  3. Create a boilerplate text object for the header or footer text.

4.9.11 Move Objects

This section provides procedures for the following tasks that you may perform as you move your report objects:

4.9.11.1 Moving multiple objects

To move multiple objects:

  1. Click or drag a box around the objects you want to move.


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. Use the arrow keys on your keyboard to move the objects in the desired direction.

See also

Section 2.4.7, "About moving and layering objects in the Paper Layout view"

4.9.11.2 Moving an object outside its parent

To move a child object outside its enclosing parent object:

  1. In the Paper Layout view or Paper Design view, click the Confine Off button in the toolbar.

  2. Click and drag the child object(s) as desired.


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


See also

Section 2.4.7, "About moving and layering objects in the Paper Layout view"

4.9.11.3 Adjusting parent borders automatically

To adjust parent borders as you move child objects:

  1. In the Paper Layout view, click the Flex On button in the toolbar.

  2. Click and drag the child object(s) as desired.


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  3. To move an object that aligns with another object in the horizontal or vertical direction (for example, a field and its label), hold down the Ctrl key as you drag the first object. To move both objects simultaneously, do not use the Ctrl key.

See also

Section 2.4.6, "About resizing objects"

4.9.11.4 Moving a column in report output

To move a column in report output:

  1. In the Paper Layout view or Paper Design view, click the column.

  2. Click the Flex On button in the toolbar

  3. Drag the column to the desired position.

See also

Section 2.4.7, "About moving and layering objects in the Paper Layout view"

Chapter 4, "Changing columns labels or widths"

Chapter 4, "Changing the default layout spacing"

4.9.11.5 Offsetting detail objects in a group report

To offset the detail fields in a group above or group left report:

  1. In the Paper Design view, click the Flex On button in the toolbar.

  2. Select the detail objects and move them to the right.

  3. Click the Flex Off button in the toolbar.

See also

Section 1.3.2, "About group above reports"

Section 1.3.3, "About group left reports"

4.9.11.6 Aligning objects

To align objects:

  1. Click the objects you want to align.


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. Choose Layout > Alignment.

  3. In the Align Objects dialog box, specify the desired alignment.

  4. Click OK.

See also

Section 2.4.7, "About moving and layering objects in the Paper Layout view"

4.9.11.7 Changing object layering

To change the order in which objects are layered on top of each other:

  1. In the Paper Layout view, click the Confine Off button in the toolbar.

  2. Click the object you want to move.

  3. Choose one of the following items from the Arrange menu:

    • Bring to Front to move the object in front of all other objects.

    • Send to Back to move the object behind all other objects.

    • Move Forward to move the object in front of the object directly on top of it.

    • Move Backward to move the object behind the object directly underneath it.

See also

Section 2.4.7, "About moving and layering objects in the Paper Layout view"

4.9.11.8 Rotating a boilerplate object

You can only rotate boilerplate text and graphics. You cannot rotate other layout objects (repeating frames or fields).

To rotate a boilerplate object:

  1. Click the object(s) that you want to rotate.


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. Click the Rotate tool in the tool palette.

  3. Drag a handle to rotate the object or group.

See also

Section 1.8.5, "About boilerplate objects"

4.9.12 Resize Objects

This section provides procedures for the following tasks that you may perform as you resize your report objects:

4.9.12.1 Resizing objects

To resize one or more objects:

  1. Click the object(s) that you want to resize.


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. Set the size:

    • For a fixed size, drag the handle of one of the selected objects. All selected objects will change size accordingly.

    • Or, choose Tools > Property Inspector. In the Property Inspector, under the General Layout node, set the Vertical Elasticity and Horizontal Elasticity properties to Contract, Expand, Fixed, or Variable.

See also

Section 2.4.6, "About resizing objects"

Section 1.8.3, "About frame and repeating frame sizing"

4.9.12.2 Making multiple objects the same size

To make multiple objects the same size:

  1. Click the objects you want to size.


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. Choose Layout > Size Objects.

  3. In the Size Objects dialog box, specify the desired settings. Click OK.

4.9.12.3 Resizing object borders

See Section 4.9.11.3, "Adjusting parent borders automatically".

4.9.13 Change Spacing

This section provides procedures for the following tasks that you may perform as you change spacing between your report objects:

4.9.13.1 Changing columns labels or widths

To change column labels or widths:

  1. Choose Tools > Report Wizard.

  2. In the Report Wizard, click the Labels tab.

  3. Change the values in the Labels and Width columns, as desired.

  4. Click Apply.

See also

Chapter 4, "Moving a column in report output"

4.9.13.2 Changing spacing within a text object

To change spacing within a text object:

  1. In the Paper Design view, click the object(s).


    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.


  2. Choose Format > Text Spacing and select the desired spacing for the text object.

4.9.13.3 Changing the default layout spacing

To change the default layout spacing used by the Report Wizard when defaulting the report layout:

  1. Choose Tools > Preferences.

  2. In the Preferences dialog box, click the Wizards tab.

  3. To increase the space between objects and the objects they enclose, type larger values for Horizontal Gap and Vertical Gap.

  4. To increase the space between fields, type larger values in Horizontal Interfield and Vertical Interfield.

  5. Click OK to close the Preferences dialog box.

  6. For smaller spacings, choose View > Snap to Grid to toggle this setting off (no checkmark). When Snap to Grid is set on, defaulting the layout honors the layout spacing values, but then snaps to the closest grid point; the result may be that smaller changes to these values are not evident in the report output.

See also

Chapter 4, "Moving a column in report output"

4.9.13.4 Changing the spacing between all rows

To change the spacing between all rows using the Paper Design view:

  1. In the Paper Design view, click the second record.

  2. Drag the second record down to create the desired spacing between all rows in the report output.

To change the spacing between all rows using the Property Inspector:

  1. In the Paper Design view, click any field in the body of the report.

  2. Click the Select Parent Frame button in the toolbar.

  3. Choose Tools > Property Inspector.

  4. Under the Repeating Frame node, set the Vert. Space Between Frames (inches) property to the amount of blank space in inches to leave between row in the report output (for example, 0.25).

4.9.13.5 Adding blank lines between groups of rows

To add blank lines between groups of rows:

  1. Create a summary column (see Section 4.8.11, "Creating a summary column"). On the Totals page of the Data Wizard (or Report Wizard), select any field that appears in each row of output, and Count as the calculation. On the Fields page, remove the summary from the displayed fields column.

  2. Create a user parameter named SPACE (see Section 4.11.2, "Creating a user parameter"). In the Property Inspector, under the Parameter node, set the Datatype property to Number and the Initial Value property to the number of records you want in each group (for example, 5).

  3. In the Paper Layout view, click the Flex On and Confine Off buttons in the toolbar.

  4. Click the repeating frame for the group, then drag the handle on the bottom of the frame to create a space slightly larger than the space you want to add between groups of rows in the report output.

  5. Choose Tools > Property Inspector to display the Property Inspector for the repeating frame.

  6. Under the General Layout node, set the Vertical Elasticity property to Variable.

  7. Click the Rectangle tool in the tool palette.

  8. Draw a rectangle in the space under the record.

  9. Double-click the rectangle object.

  10. In the Property Inspector, under the Advanced Layout node, double-click the Format Trigger property value to display the PL/SQL Editor.

  11. In the PL/SQL Editor, define the PL/SQL for the format trigger. For example, the following PL/SQL code inserts blank space between groups of rows (displays a boilerplate rectangle when the row count divided by the value of SPACE leaves no remainder):

    function spacing return BOOLEAN is
    begin
      if :CountENAMEPerReport MOD :SPACE = 0 then
        return (true);
      else 
        return (false);
      end if;
    end;
    
  12. Hide the rectangle object:

    • On the Fill Color palette, click No Fill.

    • On the Line Color palette, click No Line.

4.9.14 Modify the Page Layout

This section provides procedures for the following tasks that you may perform as you modify the page layout of your report:

4.9.14.1 Adjusting margins

To adjust margins:

  1. In the Paper Layout view, click the Edit Margin button in the toolbar.


    Note:

    The margin area is defined by a thick black line that separates it from the body. If you create objects in the body portion of a report while displaying the margin area, you can only edit those objects when the margin is displayed.


  2. Click the margin border, then drag a handle to the desired position. You can adjust the margin on all four sides of a report.

4.9.14.2 Adding a page break

To add a page break:

  1. In the Paper Layout view, click any field that is part of the frame at which you want to insert a page break.

  2. Click the Parent Frame in the toolbar.

  3. Choose Tools > Property Inspector.

  4. To set a page break...

    • before the selected frame: under the General Layout node, set the Page Break Before property to Yes.

    • after the selected frame: under the General Layout node, set the Page Break After property to Yes.

    • after a certain number of rows of output on each page: under the Repeating Frame node, set the Maximum Records per Page property to the number of rows you want to display on each page.

  5. To display icons that identify where page breaks are set, choose View > Page Breaks in the Paper Layout view.

Usage notes

If you want to set a page break at a specific row of report output, you can create a hidden object (for example, a rectangle with No Fill and No Line) that formats only at the specific row. If you set the Page Break Before property to Yes for the rectangle object, you will get a page break after the row.

PKRmPKa3wEOEBPS/orbr_howto011.htm&X٧ Work with Parameters and the Parameter Form

4.11 Work with Parameters and the Parameter Form

This section provides procedures for the following tasks that you may perform as you work with parameters and the Parameter Form:

See also

Section 1.9.1, "About parameters"

Section 2.3.4, "About referencing columns and parameters"

Section 1.6.5, "About the Paper Parameter Form view"

Section 1.11.1, "About the Runtime Parameter Form"

Section 1.9.4, "About Parameter Forms for Web reports"

4.11.1 Using a pre-defined system parameter

To use a system parameter:

  1. In the Object Navigator, expand the Data Model node, then expand the System Parameters node.

  2. Double-click the properties icon for the desired parameter to display the Property Inspector.

  3. Under the Parameter node, set the Initial Value property, if required.

  4. To validate the parameter's value at runtime, set the Validation Trigger property by clicking the ... button to display the PL/SQL Editor and define the PL/SQL to be triggered at runtime.

4.11.2 Creating a user parameter


Note:

Oracle Reports Builder automatically creates a user parameter when you use a bind parameter reference in a query.


To create a user parameter:

  1. In the Object Navigator, expand the Data Model node, then click the User Parameters node.

  2. Click the Create button in the toolbar.

  3. Double-click the properties icon for the new parameter to display the Property Inspector.

  4. Under the General Information node, replace the Name property with the desired parameter name.

  5. Under the Parameter node, set the Initial Value and List of Values properties, if required.

  6. To validate the parameter's value at runtime, set the Validation Trigger property by clicking property field to display the PL/SQL Editor and define the PL/SQL to be triggered at runtime.

4.11.3 Creating a list of values (LOV) for a parameter


Tip:

If you define a parameter in a template, you must apply the template to a report in order to select that parameter for the Runtime Parameter Form.


To create a LOV for a parameter:

  1. In the Object Navigator, expand the Data Model node, then the User Parameters node.

  2. Double-click the properties icon for the parameter for which you want to create a LOV to display the Property Inspector.

  3. Under the Parameter node, double-click the List of Values property field to display the Parameter List of Values dialog box.

  4. Select the type of list that you want to create:

    • For Static Values, type a value in the Value text box and click Add. Repeat for each value you want to add. (Click Remove to delete items from the list)

    • For SELECT Statement, type a query to populate the list of values. You can select more than one column to display in the LOV, where the first column contains the value to be assigned to the parameter. The LOV displays columns in the order specified in the query.

  5. If you want the parameter value to be restricted to only those in the LOV, select the Restrict List to Predetermined Values check box. To display a combo box that allows users to edit values or type a different value in the Runtime Parameter Form, clear the check box.

  6. If you do not want the first column (which contains the parameter value) of your query displayed in the LOV, select the Hide First Column check box. If there is no need to preserve the confidentiality of the first column, clear the check box.


    Caution:

    If you send the report output to an HTML file, either from Oracle Reports Builder or running it in your Web browser, the value of the first column will be visible in the HTML source, even if Hide First Column is selected.

    If you run the report from a Web browser and the list of values is unrestricted, the HTML Parameter Form will display a text field instead of a combo box, and a list of static values that you can copy and paste into the text field. In this case, the first column will always be shown in the Parameter Form, even if Hide First Column is selected.


  7. Click OK.

4.11.4 Validating a parameter value at runtime

To validate a parameter value at runtime:

  1. In the Object Navigator, expand the Data Model node, then the System Parameters or User Parameters node.

  2. Double-click the PL/SQL icon for the parameter for which you want to add a PL/SQL validation trigger.

  3. In the PL/SQL Editor, define the PL/SQL to be triggered at runtime.

See also

Section 2.6.13.3, "About validation triggers"

4.11.5 Creating a default Parameter Form

To create a default Parameter Form:

  1. Choose Tools > Parameter Form Builder.

  2. Click OK to display the Paper Parameter Form view with the default Parameter Form.

4.11.6 Selecting parameters to include in the Runtime Parameter Form

To select parameters to include in the Runtime Parameter Form:

  1. Choose Tools > Parameter Form Builder.

  2. In the Parameter Form Builder, click the parameters you want to include in the Runtime Parameter Form.

  3. Modify the parameter labels as desired.

  4. Click OK to display the Paper Parameter Form view.

4.11.7 Displaying the Parameter Form at runtime

To display the Runtime Parameter Form when you run your report:

  1. Choose Edit > Preferences to display the Preferences dialog box.

  2. On the Runtime Settings page, make sure that the Parameter Form check box is selected.


    Note:

    The Parameter Form can be used only for paper reports. If you display your paper-based report on the Web, you can create an HTML Parameter Form by adding HTML header and footer tags (using either the Before Form Value property and After Form Value property or the SRW.SET_BEFORE_FORM_HTML and SRW.SET_AFTER_FORM_HTML procedures). However, if you design a JSP-based Web report with a Parameter Form in Oracle Reports Builder, be aware that Web reports that use JSPs do not support the display of the Runtime Parameter Form at runtime. For more information, see Section 1.9.4, "About Parameter Forms for Web reports".


4.11.8 Adding more pages to the Runtime Parameter Form

To add more pages to the Runtime Parameter Form:

  1. In the Object Navigator, double-click the properties icon next to the report name.

  2. In the Property Inspector, under the Parameter Form Window node, set the Number of Pages property as desired.

4.11.9 Passing parameters to reports running in batch mode

To pass parameters (for example, data ranges) to reports running in batch mode:

  • Use bind variables in your query to restrict the query, and use the command line parameters to pass the values to the query. For example:

Query:

 SELECT * FROM EMP WHERE HIREDATE BETWEEN
 :FROM_DATE AND :END_DATE 

Runtime:

RWRUN REP1 SCOTT/TIGER FROM_DATE='12-JUN-92' 
END_DATE='24-JUN-92' 

4.11.10 Creating an HTML Parameter Form header using PL/SQL

See Section 4.6.10.2.5, "Creating an HTML Parameter Form header using PL/SQL"

4.11.11 Creating an HTML Parameter Form footer using PL/SQL

See Section 4.6.10.2.6, "Creating an HTML Parameter Form footer using PL/SQL"

4.11.12 Creating HTML Parameter Form input or select events

To create an HTML Parameter Form field with input or select events:

  1. In the Object Navigator, double click the view icon next to the Paper Parameter Form node to display the Paper Parameter Form view.

  2. Create or edit a Parameter Form field (see Section 4.9.1.1, "Creating a field object").

  3. Double-click the field object to display the Property Inspector.

  4. Under Web Settings, set the Additional Attributes (HTML) property to a valid JavaScript event handler.


    Note:

    In some cases, for example, when raising messages it may be necessary to type JavaScript code in the Before Form trigger.


To insert the JavaScript code in the Before Form trigger:

  1. In the Object Navigator, double-click the properties icon next to the report name to display the Property Inspector.

  2. Under Report Escapes, set the Before Form Type property to Text (if you will type the Javascript) or File (if you will import the JavaScript from a file).

  3. Set the Before Form Value property by clicking the ... button to either type JavaScript in the dialog box or select an HTML file with the JavaScript to import.

Example 1: Data input validation

This example shows how to set Parameter Form fields for input validation when the report is run throughwith the Web. Doing so will raise a message whenever an end user enters invalid data in the Parameter Form field.

  1. In the Paper Parameter Form view, create a Parameter Form field called PF_DEPTNO.

  2. Double-click the field object to display the Property Inspector, and set the following properties:

    • Under Parameter Form Field, set the Source property to DEPTNO.

    • Under Web Settings, set the Additional Attributes (HTML) property to the following JavaScript event handler:

      onChange="checkIt(this.form)"
      
  3. In the Object Navigator, click (the properties icon) next to your report name to display the Property Inspector, and set the following properties:

    • Under Report Escapes, set the Before Form Type property to Text.

    • Set the Before Form Value property the following JavaScript code:

    <SCRIPT LANGUAGE = "JavaScript">
    function isNumber(inputStr){
       for (var i = 0; i < inputStr.length; i++) {
          var oneChar = inputStr.charAt(i)      
          if (oneChar < "0" || oneChar > "9") {
             alert("Please enter a numeric value.")
             return false
             }
         }
        return true
       }
    function checkIt(form) {
       inputStr = form.DEPTNO.value
       if (isNumber(inputStr)) {
          // statements if true
          } 
          else {
             form.numeric.focus()
             form.numeric.select()
          }
       }
    </SCRIPT>
    

At runtime, if the end user enters the department name in the Runtime Parameter Form rather than the department number when running the report through the Web, the following message is raised:

Please enter a numeric value.

Example 2: Select validation

This example shows you how to set Parameter Form fields for select validation when the report is run through the Web. Doing so will raise a message whenever an end user selects Printer from the DESTYPE list of values in the Runtime Parameter Form.

  1. In the Paper Parameter Form view, create a Parameter Form field called PF_DESTYPE.

  2. Double-click the field object to display the Property Inspector, and set the following properties:

    • Under Parameter Form Field, set the Source property to DESTYPE.

    • Under Web Settings, set the Additional Attributes (HTML) property to the following JavaScript event handler:

      onChange="isPrinter(this.form)"
      
  3. In the Object Navigator, click (the properties icon) next to your report name to display the Property Inspector, and set the following properties:

    • Under Report Escapes, set the Before Form Type property to Text.

    • Set the Before Form Value property the following JavaScript code:

      <SCRIPT LANGUAGE = "JavaScript">
      function isPrinter(form) {
        if( form.DESTYPE.options[form.DESTYPE.selectedIndex].value 
             == 'Printer')
          alert("Please be sure that your print is installed and running.")
          return true}
         }
      </SCRIPT>
      

At runtime, if the end user selects PRINTER from a list of values in the DESTYPE field, the following message is raised:

Please be sure that your print is installed and running.

See also

Section 2.5.1, "About Parameter Form HTML extensions"

4.11.13 Changing HTML Parameter Form input to uppercase

To change data input values default to uppercase upon entry in a Parameter Form field:

  1. Choose Tools > Parameter Form Builder.

  2. In the Parameter Form Builder, create a Parameter Form field called PF_DESFORMAT, with a source of DESFORMAT.

  3. Choose Tools > Property Inspector.

  4. In the Property Inspector, under Web Settings, set the Additional Attributes (HTML) property to:

    onChange="this.value=this.value.toUpperCase()"
    

Example: Default input to uppercase

This example specifies that data input values default to uppercase upon entry in a Parameter Form field.

  1. In the Paper Parameter Form view, create a Parameter Form field called PF_DESTYPE.

  2. Double-click the field object to display the Property Inspector, and set the following properties:

    • Under Parameter Form Field, set the Source property to DESFORMAT.

    • Under Web Settings, set the Additional Attributes (HTML) property to the following JavaScript event handler:

      onChange="this.value=this.value.toUpperCase()"
      

At runtime, if the end user enters pdf as the destination format, the value will change to uppercase (that is, PDF) in the Runtime Parameter Form when running the report through the Web.

PKd +X&XPKa3wEOEBPS/orbr_concepts2005.htms Parameter Form Objects

2.5 Parameter Form Objects

The topic in this section builds on the basic concepts discussed in Section 1.9, "Parameter Form Objects".

2.5.1 About Parameter Form HTML extensions

Parameter Form HTML extensions enable you to enhance your Runtime Parameter Form with HTML tagged text and JavaScript when your paper reports are run through the Web. To enhance your Paper Parameter Form for displaying on the Web, you can:

You can access the Parameter Form Builder from the Object Navigator or by choosing Tools > Parameter Form Builder.

See also

Section 1.2.2, "About Web Reports"

Section 1.9.4, "About Parameter Forms for Web reports"

Section 2.2.3, "About Web links for HTML output"

PKxsPKa3wEOEBPS/orbr_md_sum004.htm ' Use the Paper Layout View to Create Two Layouts

13.4 Use the Paper Layout View to Create Two Layouts

Once your data model is complete, you need to create a layout for the data objects to display in the report output. This particular report consists of two separate layouts:

  • a group left layout for listing customer purchases individually

  • a tabular layout that shows a summary of the customer's purchases by product

Given that two layouts are required, you need to create the first layout through the Report Wizard and the second by inserting a report block. The reason for taking this approach is that the Report Wizard overwrites everything in the layout. Hence, you can only create the first layout through the Report Wizard. Additional layouts must be created by inserting a report block.

To create the first layout:

  1. Choose Tools > Report Wizard.

  2. On the Report Type page, select Create Paper Layout only.

  3. On the Style page, select Group Left.

  4. On the Groups page, ensure that all of the groups from your data model appear in the Displayed Groups list.

  5. On the Fields page, click column names and the right arrow (>) or left arrow (<) to move columns so that the following columns appear in the Displayed Fields list:

    • NAME

    • DESCRIP

    • ITEMTOT

    • ORDERDATE

    Figure 13-5 Fields page of Report Wizard

    Description of Figure 13-5 follows

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

    Table 13-1 Field Description Labels Page

    FieldsLabelsWidth

    NAME

    (no change)

    15

    DESCRIP

    Product

    20

    Itemtot

    (no change)

    (no change)

    Orderdate

    (no change)

    (no change)


  7. On the Template page, make sure Beige is selected under Predefined Template, then click Finish to display your report output in the Paper Design view. It should look like this:

    Figure 13-6 Paper Design view for the group left layout with two group columns

    Description of Figure 13-6 follows

To create the second layout:

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

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

  3. Starting about 0.5 inches (1.5 centimeters) below the existing layout, click and drag a box about 2 inches (5 centimeters) high and 4 inches (19 centimeters) wide. Release your mouse button to display the Report Block Wizard.

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

  5. On the Groups page, click G_CUSTID1 and click Down to specify the Print Direction and move this group to the Displayed Groups list, then click Next. (G_CUSTID1 should be the only group in the Displayed Groups list when you are done.)

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

    • DESCRIP

    • SumITEMTOTPerCUSTID1.

    DESCRIP and SumITEMTOTPerCUSTID1 should be the only fields in the Displayed Fields list when you are done.

  7. On the Labels page, change the labels as follows, then click Next:

    Table 13-2 Field Description

    FieldsLabels

    DESCRIP

    Product

    SumITEMTOTPerCUSTID1

    Sum Total


  8. On the Template page, make sure Beige is selected under Predefined Template, then click Finish to display your report output in the Paper Design view. It should look like this:

    Figure 13-7 Paper Layout view with two layouts

    Description of Figure 13-7 follows

PKS|&`' 'PKa3wEOEBPS/orbr_maillab001.htmF