Upload
swapnil-yeole
View
20
Download
0
Embed Size (px)
DESCRIPTION
Training_ORACLE_REPORT_206i.ppt
Citation preview
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 don’t use the Report Wizard. We make the report manually. It gives us much flexibility to develop report.
TCS INTERNAL
Report Design
Specification
Structure
Style
Data retrievalCommon features
Before you start development, consider:
TCS INTERNAL
Types Of Reports
Tabular/Master Detail ReportsTabular report
List of ProductsProductNumber Description PriceNNNN XXXXXXXXXX 9999.99NNNN XXXXXXXXXX 9999.99NNNN XXXXXXXXXX 9999.99NNNN XXXXXXXXXX 9999.99NNNN XXXXXXXXXX 9999.99
Master-detail reportOutstanding Customer Items
Customer Name: XXXXXXXXXXProduct PriceNNNN 9999.99NNNN 9999.99
Customer Name: XXXXXXXXXXProduct PriceNNNN 9999.99NNNN 9999.99NNNN 9999.99
TCS INTERNAL
Master with Multiple DetailMaster with two detail reportCustomer Statistics
Customer Name: XXXXXXXXXXOutstanding items Orders in last six monthsProduct Price Order Date Qty AmountNNNN 9999.99 xxxxx ddmmyy nn 9999.99NNNN 9999.99 xxxxx ddmmyy nn 9999.99
xxxxx ddmmyy nn 9999.99
Customer Name: XXXXXXXXXXOutstanding items Orders in last six monthsProduct Price Order Date Qty AmountNNNN 9999.99 xxxxx ddmmyy nn 9999.99NNNN 9999.99
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: 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 isbegin
return(:salary)end;
TCS INTERNAL
Data Model:Placeholder 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
CP_xxx
CF_xxx
NOTE: You cannot populate a placeholder by writing code in the placeholder’s 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
Restrict values in a WHERE clauseSELECT NAME, SALES_REP_IDFROM S_CUSTOMERWHERE ID > :P_CUST
Substitute a single value or expression in the select statement
SELECT NAME, SALES_REP_IDFROM S_CUSTOMERORDER BY DECODE(:SORT, 1, NAME,
2, STATE, COUNTRY)
Data Model: Parameters: User Parameter
TCS INTERNAL
Data Model: Parameters: User Parameter
Use to substitute any part of the query.SELECT NAME, SALES_REP_IDFROM S_CUSTOMER&LP_WHERE_CLAUSE&LP_ORD_CLAUSE
SELECT NAME, SALES_REP_IDFROM S_CUSTOMER&LP_WHERE_ORD_CLAUSE
SELECT &LP_CUST CUST, &LP_SALESREP REPFROM &LP_TABLE
Ensure number of values and datatypes match at runtime!
TCS INTERNAL
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.
Data Model: Paramete: User Parameter
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
Layout Model: Layers
F_xxx F_xxx
R_G_xxx
M_G_xxx
Body
Repeating frame displays for each row of data that is retrievedfor a group
Group frame encloses other objects and controls the format, frequency, and position of several objects simultaneously.
Fields define the appearance of columns; can contain character, number, date, for each database column
!@
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
Format Triggers:Exist on most layout objectsCan suppress entire layout section
(master group frame): no records fetched
Can suppress display of individual records (repeating frame): all records fetched
TCS INTERNAL
WarningWHEN <exception> THEN SRW.MESSAGE(999, ‘Warning: report continues’);
ErrorWHEN <exception> THEN SRW.MESSAGE(999, ‘Error: report terminated’);
RAISE SRW.PROGRAM_ABORT;
SRW Package: Outputting Message
TCS INTERNAL
ExampleSRW.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”)’);
SRW Package: Performing DDL Statement
TCS INTERNAL
Report Builder Files.rdf
Full report definition (includes source code and comments)Modifiable through Builder binary, executablePortable as binary
.repNo source code or commentsNot modifiable binary, executableSometimes portable as binary (if no PL/SQL)
.rexFull report definitionNot modifiableASCII text, not executableFully portable as text
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 Report3> Optio Report