Documente Academic
Documente Profesional
Documente Cultură
Electronic Presentation
Authors Ellen Gravina Smitha Keshav Technical Contributors and Reviewers Cem Ayberkin Christian Bauwens Alena Bugarova Kathryn Cunningham Laurent Dereac Mark Fleming Warren Lord Marcelo Manzano Darren McBurney Paul Narth Daphne Nougier Miyuki Ohsato Ligia Jasmin Robayo Jim Safcik Rie Saitoh Navneet Singh Sarah Spicer Martijn van der Bruggen Vanessa Wang Philipp Weckerle Ted Witiuk Publisher Sujatha Nagendra
Copyright 2004, Oracle. All rights reserved. This documentation contains proprietary information of Oracle Corporation. It is provided under a license agreement containing restrictions on use and disclosure and is also protected by copyright law. Reverse engineering of the software is prohibited. If this documentation is delivered to a U.S. Government Agency of the Department of Defense, then it is delivered with Restricted Rights and the following legend is applicable: Restricted Rights Legend Use, duplication or disclosure by the Government is subject to restrictions for commercial computer software and shall be deemed to be Restricted Rights software under Federal law, as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013, Rights in Technical Data and Computer Software (October 1988). This material or any portion of it may not be copied in any form or by any means without the express prior written permission of the Education Products group of Oracle Corporation. Any other copying is a violation of copyright law and may result in civil and/or criminal penalties. If this documentation is delivered to a U.S. Government Agency not within the Department of Defense, then it is delivered with Restricted Rights, as defined in FAR 52.227-14, Rights in DataGeneral, including Alternate III (June 1987). The information in this document is subject to change without notice. If you find any problems in the documentation, please report them in writing to Worldwide Education Services, Oracle Corporation, 500Oracle Parkway, Box SB-6, Redwood Shores, CA 94065. Oracle Corporation does not warrant that this document is error-free. Oracle is a registered trademark and all references to Oracle and Oracle Products are trademarks or registered trademarks of Oracle Corporation. All other products or company names are used for identification purposes only, and may be trademarks of their respective owners.
Introduction
Course Objectives
After completing this course, you should be able to do the following: Describe the capabilities of Oracle Reports Develop and maintain Web and paper reports in different styles using Reports Builder Lay out and format data to meet user reporting requirements Incorporate text, images, and graphics in reports
Course Content
Day 1: Introducing Oracle Reports Developer Designing and running reports Working in Oracle Reports Builder Creating and modifying paper reports using the Wizard Enhancing a paper report in the Paper Design view Day 2: Managing templates Creating a Web report Enhancing report structure
Copyright 2004, Oracle. All rights reserved.
Course Content
Day 3: Using the paper layout Modifying properties Using Web reporting Extending functionality using XML Day 4: Customizing reports with parameters Embedding graphs Enhancing matrix reports Adding PL/SQL code
Course Content
Day 5: Extending functionality using the SRW package Using OracleAS Reports Services Efficiency and performance guidelines
Objectives
After completing this lesson, you should be able to do the following: Describe business intelligence List the benefits of enterprise reporting Describe the differences between Web publishing and paper publishing Describe the key features of Oracle Reports Developer Describe the architecture of Oracle Application Server Describe OracleAS Reports Services
Business Intelligence
Discoverer Server Reports Server
XML
Enterprise Reporting
Provides access for more users to vital customized information Lowers cost of ownership Uses integrated business intelligence
Any Client Web Application Server Data Server
Enterprise Reporting
Reporting
Ad hoc query
Web Client
Web Publishing
GIF89a hyperlinks
JavaScript
Paper Publishing
8.5
GIF89a
hyperlinks 11 JavaScript
Benefits
Publish data from any source, in any format, with high fidelity Develop one time and deploy anywhere Open, standards-based, modular architecture
Oracle 10g provides the complete solution: Oracle Database 10g Oracle Developer Suite 10g Oracle Application Server 10g
Documents
Multimedia
Browser
Oracle DB Non-Oracle
Wireless
Packaged Apps
Web Services
B2B Apps
User-friendly wizards Pluggable data sources Customizable report templates WYSIWYG live editor for paper reports Dynamic Web publishing using JSP/HTML Run-time customization Dynamic SQL execution Portal integration Event-based reporting
HTTP Oracle HTTP Listener mod_OC4J JSP Engine Oracle Internet Directory CORBA/IIOP OracleAS Reports Services CORBA/IIOP Reports Engine PDS
Summary
In this lesson, you should have learned how to: Describe integrated business intelligence List the benefits of enterprise reporting Describe the challenges of publishing for different media List the Oracle 10g products List the key features and benefits of Oracle Reports Developer Describe OracleAS Reports Services
Objectives
After completing this lesson, you should be able to do the following: Identify user requirements Name the common report styles Describe the structure of each style Run prebuilt reports as an end user Identify supported report file types
Web or Paper
Designing Reports
Tabular
List of Products Product Number
Description
Price
Master-Detail
Outstanding Customer Items Customer Name Product Number Price
Matrix
Customer Matrix Product ID Customer
Keep database access to a minimum Consider report structure and number of queries Make effective use of common code and objects
Running a Report
Your browser OracleAS Portal application Command line (Start > Run) OracleAS Reports Queue Manager Java application Database trigger Menu integrated with a Forms application Button in a Forms application
Previewing Reports
Print Preview
1 2 3
Print Preview
1 2 3
Summary
In this lesson, you should have learned how to: Identify key questions to help understand user requirements List the simple report styles and describe their underlying structures Identify key design considerations:
Report style Database access Common code Common objects
Practice 2 Overview
Objectives
After completing this lesson, you should be able to do the following: Describe the main Oracle Reports executables Describe the main components of Reports Builder Describe the main objects in a report
Developer
Reports Builder rwbuilder Reports Runtime rwrun Reports Converter rwconverter
Reports Services
Reports Server rwserver Reports Client rwclient Queue Manager rwrqm
Report
Template
PL/SQL Library
Paper
Web
Wizards
Report Editor
Data Model Web Source Paper Layout Paper Design Paper Parameter Form
Object Navigator
Report-Level Objects
Fields Boilerplate
Object Interrelationship
1
Select
...
2 3
Saving Preferences
Summary
In this lesson, you should have learned how to: Describe the Oracle Reports executables List the types of modules you can create in Reports Builder Describe the views of the Report Editor Describe the main object categories in a report module
Practice 3 Overview
Invoking Reports Builder Opening an existing report Switching views in the Report Editor Accessing the Help system
Objectives
After completing this lesson, you should be able to do the following: Create a simple tabular paper report using the Report Wizard Describe the methods of building the report query Summarize report values Modify the style and content of a report Create other report styles available in the Report Wizard Preview a paper report on the Web
Data Model Web Source Paper Layout Paper Parameter Form Program Units
Wizard Pages Report Style Data Source Type Data Source Definition Fields Totals Labels Template
Wizard Pages Report Style Data Source Type Data Source Definition Fields Totals Labels Template
Building a Query
Building a Query
6 5
xxx.rdf
yyy.rdf
Select Tools > Report Wizard. Tabs are different for each report style. Wizard preserves all previous settings.
Location Id xxxx
Group Above
Location Id
Three additional wizard pages: Matrix rows Matrix columns Matrix cells
Use Insert > Bookmark to create a bookmark for your break report
Summary
In this lesson, you should have learned how to: Create paper reports with the Report Wizard Build queries using the Query Builder Apply templates to paper reports Modify reports by reentering the wizard Create new reports of different styles Preview a paper report on the Web
Practice 4 Overview
Creating a Tabular report Modifying the report to create a Group Above break report Creating a Form Letter Creating a Matrix report Creating a Matrix with Group report
Objectives
After completing this lesson, you should be able to do the following: Describe the Paper Design view Modify the display of report data in the Paper Design view Modify the positioning of report data Highlight data using conditional formatting Add page numbering and the current date
The Paper Design is a view of report output that allows live editing of text and paper layout attributes: True WYSIWYG report editing Easy editing: See it. Click it. Change it. Cached report data
4
Copyright 2004, Oracle. All rights reserved.
Modifying a Report
Common modifications: Align columns Set format masks Manipulate objects Edit text Modify visual attributes Highlight data using conditional formats Insert page numbers and current date
Aligning Columns
Manipulating Objects
Modify text colors and fonts Edit text Set fill, patterns, and colors Use the Parent Frame tool to select an enclosing object
-Sales Report Year 1993 1993 1993 Year 1994 1994 Region Sales Americas 200 Europe 400 Asia Pacific 770 Region Americas Europe Sales 210 390 Sales Report by Area Year 1993 1993 1993 Year 1994 1994 Region Sales Americas 200 Europe 400 Asia Pacific 770 Region Americas Europe Sales 210 390 Sales Report by Area Year 1993 1993 1993 Year 1994 1994 Region Sales
Americas 200 Europe 400 Asia Pacific 770 Region Americas Europe Sales 210 390
Customizing Dates
Summary
In this lesson, you should have learned how to: Enhance report output using live data:
Move, resize, delete objects Edit text Alter fonts, colors, and patterns Apply format masks Add page numbering and current date
Practice 5 Overview
Objectives
After completing this lesson, you should be able to do the following: Describe the template regions Describe the difference between default and override template sections Modify a predefined report template Register a customized template Add a Web link to a template
For paper reports, you have three template options: Predefined User-defined No template
Modifying a Template
Margin Body
Modify and save template file (mytemp.tdf) Move file to template directory: <oracle_home>\reports\templates> Register name and description in cagprefs.ora
Reports.Tabular_Template_File = (rwbeige, rwblue, mytemp, rwgray, rwgreen, rwpeach, Reports.Tabular_Template_Desc = ("Beige", "Blue", "My Template Description", "Gray", "Green", "Peach",
Image area is 200 x 150 pixels Image filenames = template name + .bmp Move .bmp files to template directory
Summary
In this lesson, you should have learned how to: Modify existing templates to create your own userdefined template Modify the default section for all styles or override for individual style changes Add your templates to the predefined list Display an image for a predefined template Add Web links for report HTML output
Practice 6 Overview
Customizing an existing template Applying the modified template to an existing report Adding a Web link
Objectives
After completing this lesson, you should be able to do the following: Identify the options for designing a Web page Create a simple Web report using the Report Wizard Invoke the Web Source view of the Report Editor Describe the elements of the Web source code Preview a Web report Identify supported image formats for Web reports
Dynamic scripting capability for Web pages Server-side technology Enables the separation of dynamic and static content in a Web page
JSP Advantages
Separation of dynamic and static content Support for scripting and tags Reuse of components and tags Portable, powerful, and easy to use Accepted industry standard for building dynamic Web pages
<HTML> <HEAD><TITLE>Simple JSP Example</TITLE></HEAD> <BODY> Welcome to my page!! Current time is : <%= new java.util.Date() %> </BODY> </HTML>
Two Options: Open an existing HTML page in Reports Builder Use one of the predefined HTML templates shipped with Oracle Reports Developer
End of report
JSP Tags
Generating Output
Source Image Formats: JPG, JPEG GIF PNG BMP TIFF CGM Progressive JPEG Exif JPEG
Summary
In this lesson, you should have learned how to: Create a Web report using the Report Wizard and a predefined HTML template Identify and describe standard and Reports custom JSP tags Use the Run Web Layout feature to test Web deployment
Practice 7 Overview
Creating Web reports using the Report Wizard Examining the Web source code Modifying a Web report using the Report Wizard
Objectives
After completing this lesson, you should be able to do the following: Describe the Data Model objects Modify query properties Modify the report hierarchy Change the order of data in a group Eliminate data from a report
More Properties
Aid maintenance and testing: Rename queries in complex reports Add comments to describe queries:
Use the Comment property -- comment for single lines /*comment*/ for multiple lines
Applying Changes
Update the paper layout and Web source to reflect changes in the Data Model. For paper reports:
Select Report Wizard. Alter the necessary tabbed pages.
The Wizard destroys previous layout and creates new objects. For Web reports:
Select the Report Wizard and navigate through each of the tabbed pages, reselecting the desired options. or Edit the Web source manually.
Copyright 2004, Oracle. All rights reserved.
Group Hierarchy
1 2 3
Query Modifications
In a break report, data order is determined by: Break order columns in the break groups Columns that you specify in the ORDER BY clause
SELECT d.department_id, d.department_name, e.last_name... FROM employees e, departments d WHERE e.department_id = d.department_id ORDER BY 2, e.salary
Reports Developer provides two packaged filters: First: Retrieves the first <n> records for the group Last: Retrieves the last <n> records for the group
Summary
In this lesson, you should have learned how to: Identify Data Model objects Modify query properties Modify the report hierarchy by creating additional groups Filter data in a group
Practice 8: Overview
Modifying report hierarchy Restricting records in a query Restricting records with a packaged filter
Objectives
After completing this lesson, you should be able to do the following: Describe the various data source types Create reports using pluggable data sources Create supplemental rows of data by adding queries Reuse PL/SQL code to create a REF cursor Link data from multiple data sources using a data link
Access data from a variety of sources: SQL-based XML Oracle OLAP JDBC Express Text
Express JDBC
OLAP
SQL
XML
Oracle Reports
Client Oracle10g
Out-of-the-Box Options
XML Report
1 5 6 7 2 3 4
Compound join:
Multicolumn primary or foreign key Define multiple equijoins
Nonequijoin:
Primary key value between two other values Create two links: employees.salary >= job_grades.lowest_sal employees.salary <= job_grades.highest_sal
Other methods of forming a link: Manual: Using a WHERE clause to form the link (SQL queries + column objects) Manual: Using parameters to form the link (REF cursor queries) Automatic: Using primary/foreign key constraints to form the link (SQL queries)
Summary
In this lesson, you should have learned how to: Publish data from any source using the Pluggable Data Source feature Add additional queries using the Data Wizard Publish a report with data returned from a REF cursor query Create a relationship between data in different queries using a data link Design the data model to be most efficient
Practice 9 Overview
Creating a second query in an existing report Creating a data link Creating a report using a pluggable data source Creating a report containing a REF cursor query
Objectives
After completing this lesson, you should be able to do the following: Describe various Data Model columns Display the contents of a file Identify characteristics of user-defined columns Create report summaries and subtotals Derive data using a formula column Create and populate a placeholder
2 3 4
Read-only properties
Creating a Column
Summary column
C_xxx
C_xxx
C_xxx
Specific properties:
Function Source Reset At Compute At
Data type depends on Source data type Page summaries: Not supported in the wizard
Displaying Subtotals
Reset At: G_DEPARTMENT Report
Displaying Percentages
Reset At: G_EMPLOYEE Compute At: G_DEPARTMENT G_EMPLOYEE Report
Reset At REPORT Grand Total Running Total Running Total G_DEPARTMENT G_EMPLOYEE XXXX Sub Total Running Total XXXX XXXX Record Total
Performs a user-defined computation Executes a PL/SQL function Must return a value Can be Character, Number, or Date Returned value must match data type
function CF_SALCALCFormula return Number is begin return(my_function(:salary)); end;
CP_xxx
CF_xxx
Summary
In this lesson, you should have learned how to: Identify column types and their uses Create Summary columns Define valid summary levels in a report Specify column properties based on required output:
Reset At: Resets to zero Compute At: % of Total only
Create Formula columns to return values Create Placeholder columns to hold values
Practice 10 Overview
Creating a new report with summaries Adding summary calculations to an existing report Creating a new report with ranking summary columns Adding placeholders for highest and lowest values
Objectives
After completing this lesson, you should be able to do the following: Identify the paper report sections Design multipanel reports Mail a report Distribute a report to various destinations Describe the layout objects and relationships Modify an existing paper report layout Create variable length lines
Compensation Report
Compensation Report
Page 1 of 1
Main section
Compensation Report
Page 1 of 1
Main section
Trailer section
End of report
Compensation Report
Page 1 of 1
Main section Body/ Margin
Trailer section
End of report
Body/ Margin
Header
Main
Trailer
Page 1-1
Page 1-2
Page 2-1
Page 2-2
4 5 1 2 3 6
F_xxx
Confine Mode
Flex Mode
Report Processing
BEGIN M_G_master REPEAT R_G_master
f_xxx
f_xxx
f_xxx
f_xxx
f_xxx
END M_G_detail
END M_G_master
The tool palette contains: Standard GUI drawing tools Frame, repeating frame, field objects Other layout objects
2 3 4 5
Copyright 2004, Oracle. All rights reserved.
7 8 9
Pin a tool: Double-click Shift key for constrained objects Magnify Frame Select Report Block
Report Bursting
Header e-mail
Report Bursting
Body PDF
Report Bursting
Trailer HTML
Report Bursting
Dept 10
West East
Dept 20
West East
;
Dept 30
West East
Dept 40
Dept 80
Distributing a Report
Distributing a Report
Summary
In this lesson, you should have learned how to modify the Paper Layout using: Report sections Layout objects and tools Report mailing, bursting, and distribution features Variable length lines
Practice 11 Overview
Using report sections Adding a repeating frame to the header page Adding flexible lines Distributing a report
Objectives
After completing this lesson, you should be able to do the following: Identify common paper layout properties Modify common paper layout properties Explain the use of format triggers Modify Web Settings properties
Comparing Properties
Intersection Pin
Four objects with common properties: Frames Repeating Frames Fields Boilerplate Objects Some common properties affect: Sizing Pagination Frequency of display
Sizing Objects
Layout icons Elasticity Vertical Horizontal
fixed
expand
contract variable
Anchors
Objects in the push path have implicit anchors (not visible in Paper Layout)
Explicit anchors override implicit anchors All anchors appear in Object Navigator
Implicit (shaded) Explicit (solid)
1 2
4 1 2 3 6 5
-12
f_dept_id Employee
40 xxxxxxxx xxxxxxxx
Summary
In this lesson, you should have learned how to: Identify common properties for most layout objects:
Size Pagination Print frequency Format trigger Web settings
Practice 12 Overview
Creating a break report with continuation pages displaying limited information Modifying properties for object Web support
Objectives
After completing this lesson, you should be able to do the following: Identify specific layout properties Modify specific layout properties Explain the use of specific properties Create a file link Specify the format order for the report sections Enable cataloguing and searching of PDF output
2
-1-
1 2
Page 2
Page 2
Page 2
Column Mode
Column Mode Off
Page 1
10
20
Page 2
20
30
Column Mode
Column Mode Off
Page 1
Column Mode On
Page 1
10
20
10
20
30
Page 2
Page 2
20
30
20
Properties of a Field
Fields define formatting attributes and logic Wizard creates a field for each column You create additional fields in the Paper Layout:
Source: Column, parameter, or system variable Format mask: Standard Oracle format symbols
System Variables
Page Numbering
Page 4 of 4 Example 1 Page 3 of 4 Page 2 of 4 Page 1 of 4 Report Title Example 2 End
End
G_Emp
F_REPORT
Reports Builder reads the file contents when you: Modify the Property Inspector Open a report definition Run a report
Link
Link 3
Link 3 4
Q_EMP
Summary
In this lesson, you should have learned how to: Identify object-specific properties Modify these properties when necessary Create a file link in your report Modify the default format order for report sections Specify taxonomy properties for PDF documents
Practice 13 Overview
Modifying the printing of a mailing label report Controlling the number of records on a page Adding a file link to a report Ensuring all details of a master print on the same page
Web Reporting
Objectives
After completing this lesson, you should be able to do the following: Identify the attributes of a high quality Web report Describe the JavaServer Page run-time environment Describe static and dynamic Web reporting Add dynamic content to a Web page Identify Reports custom JSP tags Customize Web reports
<rw:report id="report"> <rw:objects id="objects"> Data Model & Business Logic (XML) <layout> Paper Layout (XML) </layout> </rw:objects> <HTML> Web Layout (JSP) Graph (XML) </HTML> </rw:report>
Copyright 2004, Oracle. All rights reserved.
rw:foreach Tag
... <rw:foreach id="R_G_EMPLOYEE_ID_1" src="G_EMPLOYEE_ID"> <tr> <td <rw:headers id="HFEMPLOYEEID" src="HBEMPLOYEEID"/>. . . <td <rw:headers id="HFEmployee" src="HBEmployee"/> . . . ...
rw:field Tag
... <td <rw:headers id="HFEMPLOYEEID" src="HBEMPLOYEEID"/> class="OraCellNumber"> <rw:field id="F_EMPLOYEE_ID" src="EMPLOYEE_ID" nullValue=" "> F_EMPLOYEE_ID </rw:field></td> ...
Modify the classes in the style sheet Use HTML tags and attributes Use Reports custom tags
.OraCellNumber { color: #000000; background-color: #f7f7e7; font-family: Arial, Helvetica, sans-serif; font-size: 10px ; textalign: right}
<thead> <tr> <th <rw:id id="HBEMPLOYEEID" asArray="no"/> class="OraColumnHeader"> Employee Id </th> <th <rw:id id="HBSALARY" asArray="no"/> align="right" bgcolor="yellow"> Salary </th> </tr> </thead>
Summary
In this lesson, you should have learned how to: Create a Web report using an existing HTML page and the Report Block Wizard Describe the structure of a Reports JSP and identify key custom JSP tags Use style sheets to customize Web reports Use HTML attributes and Reports custom tag attributes to customize Web reports
Practice 14 Overview
Adding dynamic content to an existing Web page Customizing a Web report using JSP tag attributes
Objectives
After completing this lesson, you should be able to do the following: Describe the benefits of XML definitions Create XML report definitions Apply XML report definitions Debug XML report definitions
Apply run-time customizations Perform batch updates Build fully functional reports Product openness
<report> <layout> <section> <field ...> <exception> <condition .../> </exception> </field> </section> </layout> </report>
Summary
In this lesson, you should have learned how to: Use XML report definitions:
Run-time customizations Batch updates
Practice 15 Overview
Creating an XML report definition Applying a run-time customization Debugging an XML definition
Objectives
After completing this lesson, you should be able to do the following: Create and reference a parameter Create a list of values for parameter input Use and modify a system parameter Build a Paper Parameter Form layout Customize a Paper Parameter Form layout Use HTML parameter form extensions
Make sure that the number and data types match at run time.
Copyright 2004, Oracle. All rights reserved.
2 4 5
Boilerplate text with HTML tags Parameter fields with JavaScript Parameter Form header Parameter Form footer
Header
Footer
Summary
In this lesson, you should have learned how to: Define and use bind and lexical parameters Create a list of values Reference system parameters Modify parameter values at run time, using:
Command line arguments Run-time parameter form
Practice 16 Overview
Modifying an existing report to use a bind parameter Adding a dynamic list of values Adding a lexical parameter Adding a static list of values Creating a customized parameter form
Objectives
After completing this lesson, you should be able to do the following: Create and display a simple graph Customize a graph in a Web report Modify graph data dynamically Specify additional graph attributes using Graph.XML Use graph hyperlinks
Graph XML
</rw:graph>
<rw:graph id="graph-id" src="group-name" groups="column-list" dataValues="list" [series="column-list"] [width="size"] [height="size"] [graphHyperlink="link"] tag body </rw:graph>
Summary
In this lesson, you should have learned how to: Build a new graph by invoking the Graph Wizard to build and embed a graph in a paper report Customize a graph in a Web report using the rw:graph tag Customize graphs using the Graph.XML file Use a graph hyperlink for drilling down
Practice 17 Overview
Using the Graph Wizard to create a graph Altering the graph in the Graph Wizard Creating graphs that print once for each record of a group Adding a graph to a Web layout Customizing a graph in a Web report
Objectives
After completing this lesson, you should be able to do the following: Design a matrix Data Model Design a matrix Paper Layout Modify a matrix structure Create and modify matrix summaries Create a matrix with group report Create a nested matrix report
F_CITY
F_SumsalaryPerCITY
F_SumsalaryPer
Entirely manual:
Select the appropriate query tool Create extra groups Create the cross product group
Region:
F_CITY
F_SumsalaryPerCITY
Total:
F_SumsalaryPer
F_SumSALARY
F_SumSALPerDEPA
F_Sum_CITY
F_SumSALPerJOB_
Displaying Zeros
Summary
In this lesson, you should have learned how to: Create matrix reports with the Report Wizard Describe the relationship between the data and layout in a cross product structure Identify and describe matrix-specific elements:
Cross product group Product Order property Matrix layout object
Practice 18 Overview
Opening and changing an existing matrix report Building a nested matrix report Adding summaries to a nested matrix report Displaying zeros for summary values and restricting columns per page Displaying more meaningful column information and rotating the text
Objectives
After completing this lesson, you should be able to do the following: Describe the different types of triggers Describe sample uses of triggers Write and reference common code Create a PL/SQL library Publish a report as a result of a database event
Report:
Five triggers Report Triggers node in Object Navigator
Data Model:
Formula (column) Filter (group) Parameter validation
Trigger Code
If readonly=yes
Query syntax
SELECT CUSTOMER_ID, CUSTOMER_NAME FROM CUSTOMERS &p_where_clause ORDER BY CUSTOMER_NAME
Copyright 2004, Oracle. All rights reserved.
Format triggers: Exist on most layout objects Can suppress an entire layout section (master group frame): No records fetched Can suppress the display of individual records (repeating frame): All records fetched
17-JUN-87 24000
Kochhar 21-SEP-89 17000 De Haan 13-JAN-93 17000 Employee Details 17-JUN-87 21-SEP-89 13-JAN-93
Kochhar 21-SEP-89 17000 De Haan 13-JAN-93 17000 Employee Details King 17-JUN-87
f_3
At the Report level: Object Navigator, Program Units Menu: Program > PL/SQL Editor In a library: Object Navigator, PL/SQL Library File > New: Create new library File > Open: Add to existing library Attach library to report
Event-Based Reporting
Output
Client
Data model
Data interface
Reports Services
Reports Cache
Create a database trigger Include a parameter list with the required entries:
GATEWAY SERVER REPORT USERID
Summary
In this lesson, you should have learned how to: Select the appropriate trigger type for your requirement: Report, Data Model, or Layout Identify the trigger and code needed for:
Building a dynamic WHERE clause Validating a parameter value Dynamically altering record display Suppressing null fields
Use Report-level program units and create PL/SQL libraries for common code Invoke a report from a database event
Practice 19 Overview
Creating a format trigger to display different paper layouts conditionally Creating and using a report-level PL/SQL function Creating an using an external PL/SQL library Creating a PL/SQL group filter
Objectives
After completing this lesson, you should be able to do the following: Describe the package contents Output messages at run time Execute a drill-down report Create a simple table of contents Create and populate temporary tables Modify visual attributes dynamically
SRW.SET_BOOKMARK SRW.SET_FONT_STYLE
SRW.DO_SQL SRW.RUN_REPORT
SRW.SET_MAXROW SRW.MESSAGE
SRW.TRACE_START SRW.PROGRAM_ABORT
Outputting Messages
Warning:
WHEN <exception> THEN SRW.MESSAGE (999, Warning: report continues);
Error:
WHEN <exception> THEN SRW.MESSAGE (999, Warning: report terminated); RAISE SRW.PROGRAM_ABORT;
Exceptions:
SRW.INTEGER_ERROR SRW.NULL_ARGUMENTS
SRW.RUN_REPORT
Example:
SRW.RUN_REPORT ('Report=EMPS DESTYPE=FILE DESNAME='||:LAST_NAME||'.LIS BATCH=YES MGRNO='||TO_CHAR(:MANAGER_ID));
Exceptions:
SRW.RUN_REPORT_FAILURE SRW.RUN_REPORT_BATCHNO
Function: SRW.GETERR_RUN
Restricting Data
Q_EMP EMPLOYEE_ID LAST_NAME G_EMP EMPLOYEE_ID LAST_NAME 100 101 102 KING KOCHHAR DE HAAN
Initializing Fields
Output: logical page no. = 2
Page: 5
1 FUNCTION F_LOGICAL_PAGEFormatTrigger RETURN BOOLEAN IS my_page number; BEGIN SRW.GET_PAGE_NUM(my_page); SRW.SET_FIELD_NUM(0,my_page+3); RETURN(TRUE); END;
Use SRW.SET_FORMAT_ORDER in an After Parameter Form trigger to format the Main section of the report first Use SRW.GET_PAGE_NUM in a format trigger to fetch the page number for each topic in the TOC
Example:
SRW.DO_SQL('CREATE TABLE SRW_LOG (RPT_NAME VARCHAR2(40), REC_NUM NUMBER, MSG_TEXT VARCHAR2(80))' ); SRW.DO_SQL('INSERT INTO SRW_LOG (RPT_NAME, REC_NUM, MSG_TEXT) VALUES (''PAY_REPORT'', TO_CHAR(:EMPLOYEE_ID), :LAST_NAME||''PAY REPORT RUN'') ');
Exception: SRW.DO_SQL_FAILURE
Car Policy
Define a bookmark
Visual attributes: SRW.SET_FILL_PATTERN('solid'); SRW.SET_BORDER_WIDTH(250); SRW.SET_FORMAT_MASK('Day, Month yyyy'); Printer tray control: SRW.SET_PRINTER_TRAY('letterhead'); Defining a bookmark: SRW.SET_BOOKMARK('Car Policy');
FUNCTION mystyles RETURN BOOLEAN IS BEGIN SRW.SET_JUSTIFICATION(SRW.RIGHT_HJUST); SRW.SET_TEXT_COLOR('Red'); SRW.SET_FONT_WEIGHT(SRW.BOLD_WEIGHT); SRW.SET_FONT_STYLE(SRW.ITALIC_STYLE); return (TRUE); END;
Summary
In this lesson, you should have learned how to: Describe the SRW package contents:
Procedures Functions Exceptions
Use SRW.PROGRAM_ABORT to stop report processing Use the SRW package to:
Execute a detail report Create a table of contents Dynamically execute DDL statements Provide conditional layout formatting and display
Practice 20 Overview
Building a report containing conditional highlighting Modifying a Web report with conditional highlighting Executing a detail report from a master report Writing to a temporary table from a report
Objectives
After completing this lesson, you should be able to do the following: Describe the OracleAS Reports Services architecture Distinguish between the JSP and Servlet run-time architectures Describe the various ways to run a report List the options for managing and monitoring OracleAS Reports Services
RWCLIENT command line URL syntax OracleAS Portal SRW.RUN_REPORT Event-Driven Publishing API
System Management
Enterprise Portal
Application Development Framework Business Intelligence Application server Grid Computing Infrastructure Integration Broker Management
Portal
Packaged Application
Log in only once Access application level authentication Access data level authentication
HTTP Oracle HTTP Listener mod_OC4J JSP Engine CORBA/IIOP OracleAS Reports Services CORBA/IIOP Reports Engine PDS
rept.jsp OID
Fax
t rin P
ma il
URL syntax:
http://vesuvius.world.com:8888/reports/rwservlet? report=emp_dept.rdf&desformat=html&destype=cache& server=repsrv1&dept_param=10
SERVER = <server_name> MODULE|REPORT = <runfile> DESTYPE = FILE, PRINTER, MAIL, CACHE, LOCALFILE, SYSOUT,ORACLEPORTAL DESNAME = <desname> DESFORMAT = PDF, HTML, HTMLCSS, RTF, DELIMITED, XML
RWCLIENT SERVER=server1 MODULE=my_rep.rdf DESTYPE=cache DESFORMAT=html
rwclient
Syntax:
OUTPUTIMAGEFORMAT={PNG|JPEG|JPG|GIF|BMP}
FREQ
CLOCK
DATE
TIME
Reports Caching
Cached reports on server: Tolerance = n (minutes) Tolerance = 0 (default/current behavior) Maximum tolerance is 232 minutes (approximately 10,000 years) Cached output controlled by a CACHEDIR server parameter
Real-time Reports Server status: View report status and scheduled jobs Refresh to see the up-to-date status Reprioritize or cancel jobs
Queue Manager
Past jobs Current jobs Scheduled jobs
Queue Manager
All my jobs All jobs Refresh
Connect to any number of servers Administrator can shut down server Reports Services restores scheduled jobs after shutdown
Summary
In this lesson, you should have learned how to: Describe the JSP and servlet run-time architectures List several ways to run a report Describe the features of Oracle Enterprise Manager and Queue Manager for monitoring Reports Services
Practice 21 Overview
Constructing a URL to run a report on the Web Creating an entry in the key map file
Objectives
After completing this lesson, you should be able to do the following: Describe performance areas Use performance measuring tools Build reports to run in other languages
Tuning Reports
Performance Measurement
Measurement tool: Trace option Server and network measurements: SQL Trace Traffic and bandwidth
Frames Object size Format triggers Fetching ahead Bursting and distribution
Unicode:
NLS_LANG=<lang>_<territory>.UTF8
Use TranslationHub to translate messages and text defined as part of the application. Consider: Format masks Hard-coded strings Multiple character sets
Summary
In this lesson, you should have learned how to: Use performance measuring tools Describe the facilities for running reports in other languages
Practice 22 Overview
Identifying areas to investigate for tuning reports Using the trace facility Interpreting time statistics Improving performance