Está en la página 1de 33

ORACLE Report 6i

TCS INTERNAL

OVERVIEW

Oracle Report 6i is a D2K tool which will help us to build simple and complex production quality report. While making a report in our GEHC project we dont use the Report Wizard. We make the report manually. It gives us much flexibility to develop report.
TCS INTERNAL

Report Design
Before you start development, consider: Specification
Data retrieval Common features

Structure

Style

TCS INTERNAL

The Common Report Style


TABULAR. MASTER-DETAIL. MASTER AND MULTIPLE DETAIL. MATRIX

TCS INTERNAL

Types Of Reports

Tabular/Master Detail Reports


Master-detail report Outstanding Customer Items

Tabular report List of Products Product Number Description NNNN XXXXXXXXXX NNNN XXXXXXXXXX NNNN XXXXXXXXXX NNNN XXXXXXXXXX NNNN XXXXXXXXXX

Price 9999.99 9999.99 9999.99 9999.99 9999.99

Customer Name: XXXXXXXXXX Product Price NNNN 9999.99 NNNN 9999.99

Customer Name: XXXXXXXXXX Product Price NNNN 9999.99 NNNN 9999.99 NNNN 9999.99

TCS INTERNAL

Master with Multiple Detail


Master with two detail report Customer Statistics Customer Name: XXXXXXXXXX Outstanding items Product Price NNNN 9999.99 NNNN 9999.99 Customer Name: XXXXXXXXXX Outstanding items Product Price NNNN 9999.99 NNNN 9999.99 Orders in last six months Order Date xxxxx ddmmyy nn xxxxx ddmmyy nn xxxxx ddmmyy nn Orders in last six months Order Date xxxxx ddmmyy nn Qty 9999.99 9999.99 9999.99 Amount

Qty 9999.99

Amount

TCS INTERNAL

Report Editor

DATA MODEL: It displays a structural representation of the data in a report. The object do not appear in the report output, but the structure determines the layout style and the data objects provide the values that appear in the layout objects. ( Data Structures and Values to be displayed).

LAYOUT MODEL: Displays the layout objects in a report and allows us to make many modifications to any layout object. All layout objects have properties that we can modify in a property pallet. The hierarchy of the layout is determined by the DATA model.
(Formatting information about how the values will appear in the output)

TCS INTERNAL

DATA Model Objects


Query
Group. Columns

Datalink
Parameters

TCS INTERNAL

DATA Model Objects


Query: Select the DATA for our report. Group: Organize the data to form the required hierarchical structure Columns: Contain individual data values. Database columns exist by default or contain the data from the database column or expressions defined in the query. We can also create Formula, Summary and Place Holder Column Types.
TCS INTERNAL

Data Model Formula Column


Performs a user-defined computation Executes a PL/SQL function Must return a value Can be a Character, Number, Date Returned value must match datatype
function CF_SALCALCFormula return Number is begin return(:salary) end;
TCS INTERNAL

Data Model:Placeholder

CP_xxx

An empty container at design time Populated by another object at run time Before report trigger Formula column at report level Formula column in same group or below placeholder

CF_xxx
NOTE: You cannot populate a placeholder by writing code in the placeholders own Formula property.
TCS INTERNAL

DATA Model Objects


Data Link: Join queries for complex data relationships. Data links relate the results of multiple queries. A data link (or parent-child relationship) causes the child query to be executed once for each instance of its parent group There are three types of DATA Links are present Query to Query Group to Group Column to Column

TCS INTERNAL

DATA Model Objects

Parameter: Provide for runtime deafults or user input We can create also the User Parameters There are basically two types of user parameters we create Bind Parameter Lexical Parameter.
TCS INTERNAL

Data Model: Parameters: User Parameter


Bind reference replaces a value :parameter_name

parameter object is created by default


Lexical reference replaces a clause &Lparameter_name

parameter object is never created by default

TCS INTERNAL

Data Model: Parameters: User Parameter


Restrict values in a WHERE clause SELECT NAME, SALES_REP_ID FROM S_CUSTOMER WHERE ID > :P_CUST Substitute a single value or expression in the select statement SELECT NAME, SALES_REP_ID FROM S_CUSTOMER ORDER BY DECODE(:SORT, 1, NAME, 2, STATE, COUNTRY)

TCS INTERNAL

Data Model: Parameters: User Parameter


Use to substitute any part of the query. SELECT NAME, SALES_REP_ID FROM S_CUSTOMER &LP_WHERE_CLAUSE &LP_ORD_CLAUSE
SELECT NAME, SALES_REP_ID FROM S_CUSTOMER &LP_WHERE_ORD_CLAUSE SELECT &LP_CUST CUST, &LP_SALESREP REP FROM &LP_TABLE Ensure number of values and datatypes match at runtime!
TCS INTERNAL

Data Model: Paramete: User Parameter


Always do the following Specify column aliases when substituting column names. Create lexical parameters explicitly in the Object Navigator (Report Builder creates bind parameters if necessary). Enter an initial value for parameters that affect query validation when NULL.
TCS INTERNAL

Layout Model Objects

Frame : Contains objects and print only once Repeating Frame: Contains other objects and print once for each record of the associated groups. Field: Contains data and other variable and their formats. Text: We can use this for Lebel.
TCS INTERNAL

Layout Model: Layers Layout


F_xxx F_xxx
R_G_xxx
Repeating frame displays for each row of data that is retrieved for a group Fields define the appearance of columns; can contain character, number, date, for each database column

M_G_xxx
Group frame encloses other objects and controls the format, frequency, and position of several objects simultaneously.

Body
TCS INTERNAL

@ !

Sizing Objects
fixed
expand contract

variable

TCS INTERNAL

@ !

Report Triggers:
There are 5 types of report Triggers. But we commonly use three types of Report Triggres 1> After Parameter Form. 2> Before Report. 3> After Report.

TCS INTERNAL

Format Trigger

BOOLEAN TYPE

TCS INTERNAL

Format Trigger
Format Triggers: Exist on most layout objects Can suppress entire layout section (master group frame): no records fetched Can suppress display of individual records (repeating frame): all records fetched
TCS INTERNAL

SRW Package: Outputting Message

Warning
WHEN <exception> THEN SRW.MESSAGE(999, Warning: report continues);

Error
WHEN <exception> THEN SRW.MESSAGE(999, Error: report terminated); RAISE SRW.PROGRAM_ABORT;
TCS INTERNAL

SRW Package: Performing DDL Statement

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(:ID), :LAST_NAME||PAY REPORT RUN));

TCS INTERNAL

Report Builder Files


.rdf

Full report definition (includes source code and comments) Modifiable through Builder binary, executable Portable as binary
.rep

No source code or comments Not modifiable binary, executable Sometimes portable as binary (if no PL/SQL)
.rex

Full report definition Not modifiable ASCII text, not executable Fully portable as text
TCS INTERNAL

Data Model- Example 1

TCS INTERNAL

Data Model- Example 2

TCS INTERNAL

Data Model- Example 3

TCS INTERNAL

Data Model- Example 4

TCS INTERNAL

Types Of Report O/P In GEHC


1> Simple report output which we get from the View output in Oracle Apps. 2> Excel Report 3> Optio Report

TCS INTERNAL

Questions Please

TCS INTERNAL

THANK YOU

TCS INTERNAL

También podría gustarte