<function>
XML tagThe <function>
tag defines a PL/SQL function that you want
to add to the report definition. The <function>
tag must
be nested within a <programUnits>
tag. To reference a function, you use the formatTrigger
attribute
of the <field>
tag.
<function
name="function_name">
PLSQL_function
</function>
Parameters /Options |
Description |
|
Is the identifier for the function. This is the name that should be
used when referencing the function (for example, from the |
For reports developed in a release prior to Oracle Reports 10g Release 2 (10.1.2) patch 2, you may find the PL/SQL package specification or body is missing when opening the XML reports. In this case, either:
If the RDF exists, regenerate the XML output file using Oracle Reports 10g Release 2 (10.1.2) patch 2 or later (for example, pen the RDF in Reports Builder, and save as XML).
Or, edit the XML to add type="packageSpec"
and/or
type="packageBody"
in the function
element,
as follows:
<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;
...
END;]]>
</textSource>
</function>
<function name="cf_1formula" returnType="date">
...
</function>
</programUnits>
The following example shows a segment of an XML report definition that defines
some PL/SQL functions. The functions are referenced from fields in the layout
through the formatTrigger
attribute.
<layout>
<section name="header">
<field name="F_ssn1"
source="ssn1"
formatTrigger="F_ssn1FormatTrigger"/>
</section>
<section name="main">
<field name="F_ssn"
source="ssn"
formatTrigger="F_ssnFormatTrigger"/>
</section>
</layout>
<programUnits>
<function name="F_ssn1FormatTrigger">
<![CDATA[
function F_ssn1FormatTrigger return boolean is
begin
SRW.SET_HYPERLINK('#EMP_DETAILS_&<'
|| LTRIM(TO_CHAR(:SSN))
|| '>');
return (TRUE);
end;
]]>
</function>
<function name="F_ssnFormatTrigger">
<![CDATA[
function F_ssnFormatTrigger return boolean is
begin
SRW.SET_LINKTAG('EMP_DETAILS_&<'
|| LTRIM(TO_CHAR(:SSN))
|| '>');
return (TRUE);
end;
]]>
</function>
</programUnits>
Copyright © 1984, 2005, Oracle. All rights reserved.