Beruflich Dokumente
Kultur Dokumente
A user exit is a 3GL program that you write and then link into the Report Builder
executable.
It is a way to pass control from Report Builder to a program you have written, which
performs some function, and then returns control to Report Builder.
You can also write a user exit that combines both the ORACLE Precompiler interface
and the OCI.
4. How can be values be passed between precompiler user exits and Oracle reports?
By using the statements EXEC IAF GET & EXEC IAF PUT
An EXEC IAF GET statement passes a value from Report Builder to an ORACLE
Precompiler user exit. Specifically, it places the value of an Report Builder parameter or
column into a host language variable. Once Report Builder passes a value to a user exit,
the user exit can use the value for calculation, manipulation, or update.
Syntax
EXEC IAF GET report_variable_1[, report_variable_2, ...] INTO :host_variable_1[,
:host_variable_2, ...];
where:
report_ variable_n Contains the name of the Report Builder parameter or column from
which you are reading a value.
host_variable_n Is the name of the host language variable into which you are
reading a value.
An EXEC IAF PUT statement passes a value from an ORACLE Precompiler user exit to
Report Builder. Specifically, it places the value of a constant or the value of a host
language variable into an Report Builder parameter or column.
Syntax
EXEC IAF PUT report_variable[, ...] VALUES ({:host_variable | constant}[, ...]);
where:
Examples
Suppose you have a user exit named STORE to which you want to pass salary values
from Report Builder. To do so, you could write the following formula:
function foo return boolean is
begin
if :sal >= 0 then
srw.reference(:sal);
srw.user_exit('store sal');
else
srw.message(100, 'Found a negative salary. Check
the EMP table.');
end if;
exception
when srw.unknown_user_exit then
srw.message(200, 'STORE user exit was unknown.
Check if it''s linked.');
when srw.user_exit_failure then
srw.message(200, 'STORE user exit failed. Check
its code.');
return(true);
end;
If the user exit fails and the user exit program does not write a message to the SRWERB
buffer, SRW.USER_EXIT_FAILURE will be FALSE, and Report Builder will not raise
an error message. If the user exit program does write a message to the SRWERB buffer,
then SRW.USER_EXIT_FAILURE will be TRUE, and Report Builder will raise the
message, "STORE user exit failed. Check its code."
Assume you have a user exit named BIG_EXIT. Assume also that BIG_EXIT contains
code to check itself for errors in three different locations. If it finds an error, it will return
(EXEC IAF PUT) one of the following values: A if portion A of BIG_EXIT failed, B if
portion B of BIG_EXIT failed, and C if portion C of BIG_EXIT failed. Your user exit
call could look like this:
Procedure multi_errors is
function inner return char is
begin
srw.user_exit('big_exit');
return(:error);
end;
begin
if :error='A'
srw.message(100, 'Portion A of BIG_EXIT failed.');
elsif :error='B'
srw.message(200, 'Portion B of BIG_EXIT failed.');
else
srw.message(300, 'Portion C of BIG_EXIT failed.');
end if;
end;
GENERAL
A global variable you can create and use outside of a PL/SQL package.
It can be used in various clauses like
SELECT Clause
The value of DFLTCOMM replaces null values of COMMPLAN in the rows selected.
WHERE Clause
GROUP BY Clause
SELECT NVL(COMMPLAN, :DFLTCOMM) COMMPLAN, SUM(TOTAL) TOTAL
FROM ORD GROUP BY NVL(COMMPLAN, :DFLTCOMM)
HAVING Clause
The value of MINTOTAL is used to select customers with a minimum total of orders.
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.
References in CONNECT BY and START WITH clauses are used in the same way as
they are in the WHERE and HAVING clauses.
PL/SQL
7. What are the different file extensions that are created by Oracle reports?
Previewer
9.Is it possible to disable the parameter form while running the report?
Yes.
10.What is a lexical reference ? How can it be created?
-A lexical reference is a place holder for text that can be embedded in a SQL statement.
A lexical reference can be created using a & before the column or parameter name.
A reference to a parameter used to replace a single literal value(for e.g a character string,
number or date) appearing any where in a PL/SQL construct or a SQL SELECT
statement.
A bind reference can be created using a colon(:) before the column or parameter name.
Description CMDFILE is a file that contains arguments for the RWCON60 command.
This option enables you to convert a report/library without having to specify a large
number of arguments each time you invoke RWCON60.
Syntax
[CMDFILE=]cmdfile
Values
Any valid command file.
Usage Notes
à Command file syntax for RWCON60 arguments is identical to that used on the
command line.
à Values entered on the command line override values specified in command files.
For example, suppose that you specify RWRUN60 from the command line with COPIES
equal to 1 and CMDFILE equal to RUNONE (a command file). In RUNONE, COPIES
is set to 2. Only one copy of the report would be generated in this case. For more
information, see "Command Line Syntax Rules".
PARAMETERS
13.What are parameters in repots?
A parameter is a variable whose value can be set at runtime (e.g, from the Runtime
Parameter Form or the command line). User parameters are created by you for the
report. System parameters are created by Report Builder.
Note that while you can delete or rename a user parameter you cannot delete or rename a
system parameter.
2.COPIES Is the number of report copies that should be made when the report
is printed.
5.DESFORMAT Is the definition of the output device's format (e.g., landscape mode
for a printer). This parameter is used when running a report in a
character-mode environment, and when sending a bitmap report to
a file (e.g. to create PDF or HTML output).
6.DESNAME Is the name of the output device (e.g., the file name, printer's name,
mail userid).
7.DESTYPE Is the type of device to which to send the report output (screen,
file, mail, printer, or screen using PostScript format).
9.ORIENTATION Is the print direction for the report (landscape, portrait, default).
10.PRINTJOB Is whether the Print Job dialog box should appear before the report
is run.
11.THOUSANDS Is the symbol for the thousand's indicator (e.g., ",").
15.What are the default parameters that appear at runtime in the parameter
screen?
16.Which parameter can be used to set read Level consistency across multiple
queries?
READONLY
Description READONLY requests read consistency across multiple queries in a report.
When accessing data from ORACLE, read consistency is accomplished by a SET
TRANSACTION READ ONLY statement (refer to your Oracle8 Server SQL Language
Reference Manual for more information on SET TRANSACTION READ ONLY).
Syntax
[READONLY=]{YES|NO}
Values
YES requests read consistency.
NO means do not provide read consistency.
Default
NO
Usage Notes
n This keyword is only useful for reports using multiple queries, because
ORACLE automatically provides read consistency, without locking, for single query
reports.
Description TERM is the type of terminal on which you are using RWRUN60. TERM
is useful for the Runtime Parameter Form and Runtime Previewer only. This keyword is
only used in character mode.
Syntax
[TERM=]termtype
Values
Any valid terminal type.
Default
Installation dependent. (See your System Administrator for a compatible definition.)
Usage Notes
n The argument(s) for this keyword may be case sensitive, depending on your
operating system.
19.To exclude a row from being displayed but still use columns in the row, which
property can be used?
Format Trigger.
20.Is it possible to insert comments into SQL statements written in the data model
editor?
Yes.
In report formatting.
23.What are the SQL clauses supported in the link property sheet?
24. Is it possible to set a filter condition in a cross product group in a matrix report?
No.
25.What is a filter?
A PL/SQL function or anonymous function that restrict the data displayed by a group.
26.If a break order is set on a column would it affect columns which are under that
column?
No
% of Total function
28.What is the purpose of the product order option in the column property sheet?
Yes.
Yes.
31.How can a break order be created on a column in an existing group?
àA place holder column is used to hold a calculated value at a specified place rather
than allowing it to appear in the actual row where it has to appear.
à A placeholder is a column for which you set the datatype and value in PL/SQL that
you define. You can set the value of a placeholder column in the following places:
n a formula in the placeholder's group or a group below it (the value is set once for
each record of the group)
A hidden column is used when a column has to be embedded into a boilerplate text
A break group is used to display one record for one group once, while multiple related
records in other groups can be displayed.
36. If two groups are not linked in the data model editor, what is the hierarchy
between them?
The group that is above or leftmost ranks higher than the group that is to right or below it.
37. The join defined by the default data link is an outer join.Yes/No?
Yes.
39.What are the types of report triggers? And their order of execution.
Report triggers execute PL/SQL functions at specific times during the execution and
formatting of your report.
1.Format Trigger
2.Action Trigger
Description The Before Parameter Form trigger fires before the Runtime Parameter
Form is displayed. From this trigger, you can access and change the values of
parameters, PL/SQL global variables, and report-level columns . If the Runtime
Parameter Form is suppressed, this trigger still fires. Consequently, you can use this
trigger for validation of command line parameters.
Definition Level report
On Failure
Displays an error message and then returns to the place from which you ran the report.
Description The After Parameter Form trigger fires after the Runtime Parameter Form is
displayed. From this trigger, you can access parameters and check their values. This
trigger can also be used to change parameter values or, if an error occurs, return to
the Runtime Parameter Form. Columns from the data model are not accessible from
this trigger. If the Runtime Parameter Form is suppre ssed, the After Parameter
Form trigger still fires. Consequently, you can use this trigger for validation of
command line parameters or other data.
Description The Before Report trigger fires before the report is executed but after
queries are parsed and data is fetched.
Definition Level report
On Failure
Displays an error message and then returns to the place from which you ran the report.
Description The Between Pages trigger fires before each page of the report is formatted,
except the very first page. This trigger can be used for customized page formatting. In
the Runtime Previewer or Live Previewer, this trigger only fires the first time that you go
to a page. If you subsequently return to the page, the trigger does not fire again.
Definition Level report
On Failure
Displays an error message when you try to go to the page for which the trigger returned
FALSE. The pages subsequent to the page that returned FALSE are not formatted. If the
trigger returns FALSE on the last page, nothing happens because the report is done
formatting. The Between Pages trigger does not fire before the first page. If the trigger
returns FALSE on the first page, the first page is displayed, but, if you try to go to the
second page, an error message is displayed.
Description The After Report trigger fires after you exit the Runtime Previewer, or after
report output is sent to a specified destination, such as a file, a printer, or a mailid. This
trigger can be used to clean up any initial processing that was done, such as deleting
tables. Note, however, that this trigger always fires, whether or not your report
completed successfully.
Definition Level report
On Failure
Does not affect formatting because the report is done. You can raise a message, though,
to indicate that the report did not run correctly. For example, you could put the system
time in a variable in the Before Report trigger and then compare it against the system
time in the After Report trigger. If the report took longer than a certain time to run, you
could raise an error.
Usage Notes
n The After-Report trigger does not fire when you are in the Live Previewer.
Description A ref cursor query uses PL/SQL to fetch data for the report. In a ref cursor
query, you specify a PL/SQL function that returns a cursor value from a cursor variable.
Usage Notes
n When you make a ref cursor query the child in a data link, the link can only be a
group to group link. It cannot be a column to column link.
n If you use a stored program unit to implement ref cursors, you receive the added
benefits that go along with storing your program units in the Oracle database.
Example
Description Validation triggers are PL/SQL functions that are executed when parameter
values are specified on the command line and when you accept the Runtime Parameter
Form. (Notice that this means each validation trigger may fire twice when you execute
the report.) Validation triggers are also used to validate the Initial Value property of the
parameter. The function must return a boolean value (TRUE or FALSE). Depending on
whether the function returns TRUE or FALSE, the user is returned to the Runtime
Parameter Form. You can access validation triggers from the Object Navigator, the
PL/SQL Editor, or the Property Palette (Validation Trigger property).
Definition Level parameter
On Failure The user is returned to the parameter value in the Runtime Parameter Form
where they can either change it or cancel the Runtime Parameter Form
Examples
Description Format triggers are PL/SQL functions executed before the object is
formatted. The trigger can be used to dynamically change the formatting attributes of the
object. The function must return a Boolean value (TRUE or FALSE). Depending on
whether the function returns TRUE or FALSE, the current instance of the object is
included or excluded from the report output. You can access format triggers from the
Object Navigator, the Property Palette, or the PL/SQL Editor.
On Failure Excludes the current instance of the object from the output.
Usage Notes
n Format triggers do not affect the data retrieved by the report. For example, if a
format trigger returns FALSE for a field, the data for the field is retrieved even though
the field does not appear in the output.
n If a format trigger suppresses report output on the last page of the report, the last
page will still be formatted and sent to the appropriate output and the page will be
included in the total number of pages.
Example
Format trigger example (highlighting a value)
/* Suppose that you are building a banking report and
** would like it to indicate if a customer is overdrawn.
** To do so, you give the repeating frame around the
** customer information a format trigger that causes
** it to have a border only if a customer's account
** balance is less than 0 (or the required minimum
**balance).
*/
/* Suppose that you are building a salary report and ** you only want to see salaries
above $2500. In the ** report summary of all salaries, however, you want all
** salaries to be included. To do this, you create a * data model for the report without
restricting the records ** retrieved. Then, you enter the following format trigger
** for the repeating frame. The report output will only show salaries greater than $2500,
but the summary that ** calculates the sum of all salaries will include all the
** salaries retrieved from the database.
*/
Description Action triggers are PL/SQL procedures executed when a button is selected
in the Runtime Previewer. The trigger can be used to dynamically call another report
(drill down) or execute any other PL/SQL. You can access action triggers from the
Object Navigator, the Property Palette (PL/SQL Trigger property), or the PL/SQL Editor.
n PL/SQL action triggers cannot be tested in the Live Previewer because the buttons
are not active there. You must use the Runtime Previewer (choose ViewRuntime
Preview from the Live Previewer).
n You cannot use the PL/SQL Interpreter to debug action triggers because it is not
available from the Runtime Previewer and buttons cannot be activated in the Live
Previewer. To get around this, you can move your action trigger code to a report trigger
to test it from the Live Previewer.
Example
procedure U_1ButtonAction is
begin
srw.run_report('module=web4.rdf destype=Screen paramform=yes');
end;
SRW.USER_EXIT_FAILURE;
Description This exception is raised when the user exit you called has failed. When
called, it stops the report execution and raises the following error message:
REP-1416: User exit <exit_name> failed.
Syntax
SRW.USER_EXIT_FAILURE;
Usage Notes This exception is raised when the SRWERB buffer is non-empty.
54.Does a Before Report trigger fire when the parameter form is suppressed?
Yes
55.At what point of report execution is the Before Report Trigger Fired.?
After the query is executed but before the report is executed and the records are
displayed.
56.Is the after report trigger fires if the report execution fails?
Yes
LAYOUT EDITOR
57.How can a text file be attached to a report while creating it in the report writer?
By using the link file property in the Layout boiler plate property sheet.
No.
Yes
Anchors are used to determine the vertical and horizontal positioning of a child object
relative to its parent.
The end of the anchor with a symbol on it is attached to the parent object..
Since the size of some layout objects may change when the report runs (and data is
actually fetched), you need anchors to define where you want objects to appear relative to
one another.
An anchor defines the relative position of an object to the object to which it is anchored.
Positioning is based on the size of the objects after the data has been fetched rather than
on their size in the editor. It should also be noted that the position of the object in the
Layout editor effects the final position in the report output. Any physical offset in
the layout is incorporated into the percentage position specified in the Anchor property
sheet.
62.What are the two repeating frames always associated with a matrix object?
63.Is it possible to split the print previewer into more than one region?
Yes.
64.Does a grouping done for objects in the layout editor affect the grouping done in
the data model editor?
No.
65.How can a square be drawn in the layout editor of the report writer?
66.To display the page number for each page on a report , what would be the source
-&Logical page number or &Physical page number.
67. What does the term panel refer to with regard to pages?
A panel is the number of physical pages needed to print one logical page.
A layout object use to fix a spot on one object to a spot on another object., ensuring the
position of the first object in relation to the second object.
Physical page is the size of the page that is output by the printer.
Logical page is the size of one page of the actual report(it may be displayed on one or
more physical pages) as seen in the priviewer.
Master/Detail Report
A master detail report contain two groups of data, the master group and the detail group.
For each master record fetched , the related details records are fetched.
71. What is the difference between Break report and Master/Detail reports?
Break reports and master/detail reports are similar in output but require different data
models.
A break report uses one query and two groups, while a master/detail report uses two
queries, each of having one group. A relation between the two queries is established
using a data link.
A data model object used to define a master /detail (parent-child) relationship between a
group and a query.
Outer join.
74.What is a frame ?
A layout object used to include other layout object and control the formatting ,frequency
and positioning of several layout objects.
A layout object used to display rows of data that are fetched for a group.
A repeating frame is used to display a set of records when the number of records that are
to display is not known before.
OPTIMISATION
No.
78.What are the two types of view available in the object navigator?
The Object Navigator enables you to view objects by ownership hierarchy or by object
type.
ViewOwnership-> View displays objects in a parent-child hierarchy. For example, a
query’s columns would appear underneath the query and a field would appear underneath
the repeating frame that encloses it. This view can be a useful debugging tool because it
enables you to easily see the relationships between objects.
ViewObject Type ->View displays objects by their type. For example, all queries would
appear underneath the Queries heading and all database columns underneath the Database
Columns heading. This view can be useful when you want to quickly find objects in the
Object Navigator.
View Ownership
80.How is it possible to restrict the user to a list of values while entering values for
parameters?
Applies to parameters
Default checked
By setting the action associated with that button to execute PL/SQL option and using the
SRW.Run_report function.
82.What is SRW.RUN_REPORT?
Description This procedure invokes RWRUN60 with the string that you specify. This
procedure is useful for:
n running drill-down reports (i.e., calling a report from a button's action trigger)
n sending parts of a report to different recipients (e.g., to send a report via e-mail to
each manager with just his or her group's data)
n sending parts of a report to different printers (e.g., to send each manager's report
to his or her printer)
82.What are the two ways by which data can be generated for a parameter’s list of
values?
84.What are the three panes that appear in the run time PL/SQL interpreter?
1.Source Pane.
2.Interpreter Pane.
3.Navigator Pane.
When confine mode is on, an object cannot be moved outside its parent in the layout
editor.
When Flex mode is on, Reports automatically resizes the parent when the child is resized.
By selecting the cross product tool and drawing a new group surrounding the base groups
of the cross product.
88.How can a group in a cross product be visually distinguished from a group that
does not form a cross product?
A group that forms part of a cross product will have a thicker border.
89.At least how many sets of data must a data model have before a matrix report
can be based on it?
Four.
90.Is it possible to have a link from a group that is inside a cross product to a group
outside it?
No.
91.Is it possible to link two groups inside a cross product after the cross product
group has been created?
No
Form like
Mailing label
Form letter
93.What does the & symbol before the column in report builder indicate?
The ampersands indicate that they are hidden fields, and are contained within
boilerplate and repeating frame objects.
A master/master report displays at least two sets of data which are not directly
related—that is, the records constituting the data are fetched using at least two
separate queries. A master/master report (also called a parent/parent report)
contains two or more queries with no links (parent/child relationships).
Confine mode
With Confine mode on, an object cannot be moved outside of or placed behind its parent.
Such a situation renders the layout invalid and no output is produced.Sometimes moving
an object outside of its parent is a valid action. If you need to do so, you can turn off
Confine mode by clicking the Confine Off button in the toolbar.
Reports Builder provides packaged summary functions you can use to compute the values
of summary columns.
1.Source
2.Function
3.Reset At
4.Compute At(optional)
Source is the name of the column that contains the data on which the summary column
¦
RDF file
A file that contains a single report definition in binary format. .RDF files are used to
both run and edit reports.
REP file
A file that contains a single report definition in binary format. .REP files are used
Only to run reports; you cannot edit a .REP file.
repeating frame
A layout object used to display rows of data that are fetched for a group.
102.What is XML?
XML
GROUP REPORTS
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).
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,
3.At least two of the groups must be within the cross product group. These
groups furnish the "labels" of the matrix report.
4. At least one group must be a "cell" group; i.e., it must provide the
information related to the labels. The values from this group fill the cells
created by the matrix.
107. With how many queries you can create matrix report?
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.
By using a ref cursor, which is a PL/SQL cursor datatype, you can reference a cursor
from within a PL/SQL query.
For example, if you already have numerous queries built and you want to reuse those
queries in your reports, you can simply use a ref cursor in your report data model to
access those queries.
A ref cursor is a PL/SQL datatype that you can use in a query to fetch data. Each ref
cursor query is associated with a PL/SQL function that returns a strongly typed ref
cursor. The PL/SQL function must ensure that the ref cursor is opened and
associated with a SELECT statement that has a SELECT list that matches the ref
cursor type. You base a query on a ref cursor when you want to:
Furthermore, if you use a stored program unit to implement ref cursors, you receive
the added benefits that go along with storing program units in the Oracle database.