Skip to main content

APEX Features

Oracle APEX offers various regions for displaying data in effective ways, including Interactive Reports, Interactive Grids, Classic Reports and Oracle Charts. AOP simplifies and streamlines the process of exporting data from APEX to Word, Excel, PDF and other document types.

To gain a deeper understanding and explore practical examples, you can refer to APEX Features section of the APEX Office Print Sample Application, which provides a comprehensive demonstration of how to export data from various reports, charts, calender and many more to AOP.

Interactive Reports(IR)

Available From: v2.0

In an APEX application, users have the option to export an interactive report using the {&interactive} tag in a designated template. This tag will be substituted with the selected interactive report in APEX. Apart from the standard interactive report, users can also choose from three other options: Control Break, Group By, and Pivot. These options will be demonstrated below. It is important to note that the tag {&interactive} will always be replaced, no matter which of the above options is selected in APEX.

StaticID and Data Type

When exporting Interactive Reports, it's important to include the staticID and specify the data type as Region(s):Classic Report, Interactive Report/Grid, SVG, Canvas, HTML, and others.

Layout for IR

Some aop_api_pkg global variables available for IR Layout are available here: Layout for IR.

Supported Attributes Options

See the supported attributes options for Interactive Report in Supported Attributes for Regions section. These attributes can be used to manipulate the output of IR in exported file.

Example

The interactive report with static Id row is as shown below.

Data Source

The dynamic action settings to export the IR is as shown below. The data type is Region(s):Classic Report, Interactive Report/Grid, SVG, Canvas, HTML and other. You also need to provide the unique staticId for the IR Region.

Template

The template uses the {&interactive} to process the exported IR. The {&interactive} is replaced by the IR as shown in application.

 IR-template.docx    IR-template.xlsx  

Output

The output with given template and IR export with staticID row is as shown below:

 IR-Output.docx    IR-Output.xlsx  

Control Break

By clicking on Actions and selecting Control Break, one or more columns can be selected on which the table should be broken. For the purpose of illustration, assume we select Quantity.

This splits the table up into partitions based on the value of the selected column. Thus, rows sharing the same value for Quantity, will be grouped together into the same partition. The resulting table can be seen below.

As a final note, this option also supports the application of aggregation of the table data.

Group By

By clicking on Actions and selecting Group By, one or more columns can be selected on which the table data should be grouped by. For the purpose of illustration, assume we select Product Name. Furthermore, one or more functions can be applied on the table data. In this example, we request the sum of the unit price and average of Quantity for every group.

The result is a new table with one column for every selected column on which the data should be grouped by, and one column for every selected function to be applied on the group data.

The resulting table can be seen below:

Additionally, a custom label and format may be selected for each function column and a sum can be performed over the values of each function column.

Pivot

By clicking on Actions and selecting Pivot, the user is prompted to select at least one pivot column, at least one row column and at least one function over a particular column. Important to note is that the row column, pivot column and function column need to be different. For the purpose of illustration, we select Quantity as pivot column, Product Name as row column and sum over the Unit Price as function.

The resulting table can be seen below:

The additional options supported in this case are the same as the ones in Group By.

Chart

AOP can also print your Interactive Report Chart view directly in your template by using {$interactive}D

The resultant chart from the above setup is as follows:

The result in PowerPoint can be seen below:

Note that this is a native PowerPoint chart, so you can adapt, make bigger, change colors, etc. directly in PowerPoint.

More

Examples for IR Features like Compute and Aggregate, Filter and Highlight, Multiple Highlights, Number and Date Format, Multiple Reports and orthers important functionalities are available in AOP Sample Application with practical implementation.

Multiple Interactive Reports in one template

When exporting multiple interactive reports, the template needs to have tags of the form {&interactive_1},{&interactive_2} and these tags will be replaced by the corresponding interactive reports. Many interactive reports can be inserted by giving their static IDs in a particular order (ir1,ir2,...). It is in that order that their data will be inserted in the template. Thus, {&interactive_1} gets replaced by the data in the first interactive report (static Id: ir1) and similarly for {&interactive_2} that will get replaced by the data in the second interactive report (static Id: ir2) and so on.

Example

This examples shows the export of multiple interactive reports with static Ids ir1, ir2 and ir3.

The IR with static ID ir1 has following contents.

The IR with static Id ir2 has used control break for order name and order total column. (Shows the export of IR with control break)

The IR with static Id ir3 is as shown below. The ir3 is converted to chart before exporting to get its chart in output. (Shows the export of IR as chart)

Data Source

The dynamic action settings to export the IG has the data type Region(s):Classic Report, Interactive Report/Grid, SVG, Canvas, HTML and other selected and unique staticIds ir1,ir2,ir3 are provided in Region Static ID(s) field (seperated by comma).

Template

 multiple-IR-template.docx    multiple-IR-template.xlsx  

{?!pagebreak}

{?!pagebreak} inserts the page break in word template. For more information how pagebreak tag works, click here.

Output

On processing the template and the given output, AOP produces the output with multiple IRs as shown below.

 multiple-IR-output.docx    multiple-IR-output.xlsx  

Export of IR With Saved Report

To export IR with saved report , use the format IR_StaticId|Saved_ReportName. Give the report's static ID followed by the saved report’s name, separated by a pipeline. This allows AOP to export the specific saved report you've defined.

For an example, refer to the AOP feature in the sample app.

Interactive Grid(IG)

Using the interactive grid tag {&...&}, user can get the exported IG in the designated template. The tag consist of interactive grid static id, with & on both sides enclosed by the delimiters.
Like the Interactive reports, it also supports Highlights, Filters, Aggregates, Break, Charts and many more. For more detail on its uses, please refer to AOP Sample Application > APEX Features > Interactive Grid.

Supported Attributes Options

See the supported attributes options for Interactive Grid in Supported Attributes for Regions section. These attributes can be used to manipulate the output of IG in exported file.

Example

Here, Interactive Grids with static id igrid1 and igrid2 are used to export to AOP.

The interactive grid with staticId igrid1 is as shown below.

The interactive grid with staticId igrid2 is as shown below.

Data Source

The dynamic action settings to export the IG is as shown below. The data type is Region(s):Classic Report, Interactive Report/Grid, SVG, Canvas, HTML and other and unique staticIds igrid1,igrid2 are provided in Region Static ID(s) field.

Template

The template consists of tags {&igrid1&} and {&igrid2&} for the two interactive grid as shown below:

 igrids-template.docx    igrids-template.xlsx  

Output

Upon processing, AOP produces the following output which includes the interactive grid shown in APEX.

 igrids-output.docx    igrids-output.xlsx  

Classic Report

AOP also supports the data exported of classic reports. The tag is similar to interactive grid tag where static id, with & on both sides enclosed by the delimiters like {&crStaticID&}. Upon processing, the tag is replaced by the data from the classic report. A simple example to demonstrate the use of classic report tag is as shown below.

Supported Attributes Options

See the supported attributes options for Classic Report in Supported Attributes for Regions section. These attributes can be used to manipulate the output of classic report in exported file.

All of these attributes work the same way for Classic Reports as they do for Interactive Reports, allowing you to achieve consistent formatting across all report types.

Example

Hearby, the classic reports with static ID products.

Classic reports with static ID customers.

Data Source

The dynamic action settings consist of the data type Region(s):Classic Report, Interactive Report/Grid, SVG, Canvas, HTML and other and unique staticIds products,customers are provided in Region Static ID(s) field.

Template

The template consist of {&products&}, {&customers&} and a table with loop tag (to show the possibility of using staticID in loop tag to insert CR data in used defined table) as shown below.

 classic-reports-template.docx    classic-reports-template.xlsx  

Output

Upon processing with the given data source and template, AOP produces the following output.

 classic-reports-output.docx    classic-reports-output.xlsx  

Calendar

AOP also supports the export of APEX Calendar. The tag used in the template should be ?CALENDAR followed by static id of calendar on APEX, enclosed by delimiters eg. {?CALENDAR cal} .

Settings for Calendar

Some aop_api_pkg global variables available for the settings of calendar are available here: Settings for Calendar.

Example

The example shows the export of calendar of static id cal which is shown below.

Data Source

In the dynamic action, the static id for calendar cal is provided and Data type selected is Region(s):Classic Report, Interactive Report/Grid, SVG, Canvas, HTML, and others . Also in Init PL/SQL aop_api_pkg.g_separate_pages := 'true'; to get separate pages for each months.

Template

The template consists the calendar tag {?CALENDAR cal} as shown in the image below.

 template.docx  

Output

Upon processing, AOP provides the output with following contents.

 output.docx    output.pdf  

More on AOP Sample Application > APEX Features

In addition to Interactive Reports (IR), Interactive Grids (IG), and Classic Reports, AOP supports the export of various other regions, including charts, calendars, and many more. The AOP Sample Application provides practical examples that demonstrate the insertion of these regions in a meaningful way. By exploring the AOP Sample Application, you can gain hands-on experience and a better understanding of how to utilize AOP for exporting charts, calendars, and other supported regions.

Supported Attributes For Regions

You can control the output of your exported regions by using various attributes. These attributes can be added to the Region Custom Attributes and in HTML expression in the column of interactive report, classic report or interactive grid to manipulate the output in the exported file.

Region Custom Attributes

This attributes are added in the custom region for report which you want to export.

data-aop-report-width (Word only) Sets the width of the report in the exported Word document. Use this attribute to control how much horizontal space the report occupies in the Word document.

  • Values: percent or size value (can be in px, %, pt, in, cm, mm...for example 80% or 16cm)
  • Example: data-aop-report-width="80%" for Interactive report/Classic report /Ig region custom attributes

HTML Expression

The HTML expression attributes are added in the column of interactive report, classic report or interactive grid. These attributes will be applied on the column in which they are added and will manipulate the output of that column in exported file.

Supported Options for Excel

The following attributes are supported when exporting to Excel:

  • data-aop-width: Sets the specific width of the column. Use this when you need to define precise column widths in your exported report.

    • Values: Number + unit (in, cm, px, pt, em, eu)
    • Example for Interactive report/Classic report : <span data-aop-width="30eu">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-width="30eu">&CUST_FIRST_NAME.</span>
  • data-aop-height: Sets the height of the row(s) for this column. Useful for accommodating taller content or improving readability.

    • Values: Number + unit (in, cm, px, pt, em)
    • Example for Interactive report/Classic report : <span data-aop-height="25pt">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-height="25pt">&CUST_FIRST_NAME.</span>
  • data-aop-wrap-text(Excel Exclusive): Enables Excel cell wrap-text behavior so long values can continue on multiple lines inside the same cell. Essential for making long text content visible without needing to expand column width.

    • Values: YES, TRUE
    • Example for Interactive report/Classic report : <span data-aop-wrap-text="YES">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-wrap-text="YES">&CUST_FIRST_NAME.</span>
  • data-aop-character-per-line (Excel Exclusive): Defines an approximate characters-per-line value so AOP can estimate how many lines a cell needs in Excel. This is a smart way to auto-size columns based on content length and ensure text wraps appropriately.

    • Values: Numeric
    • Example for Interactive report/Classic report : <span data-aop-character-per-line="20">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-character-per-line="20">&CUST_FIRST_NAME.</span>
  • data-aop-line-height (Excel Exclusive): Sets the height of each wrapped text line in Excel cells, so row height is calculated with consistent spacing when using data-aop-character-per-line to wrap text into multiple lines.

    • Values: Number + unit
    • Example for Interactive report/Classic report : <span data-aop-line-height="15pt">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-line-height="15pt">&CUST_FIRST_NAME.</span>
  • data-aop-max-line(Excel Exclusive): Caps the maximum number of wrapped lines used to calculate Excel row height, preventing excessively tall rows when wrapping long text with data-aop-character-per-line.

    • Values: Numeric
    • Example for Interactive report/Classic report : <span data-aop-max-line="3">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-max-line="3">&CUST_FIRST_NAME.</span>

    Example for long address text ( using data-aop-wrap-text, data-aop-character-per-line, data-aop-line-height and data-aop-max-line)

    here for exmaple you have customer name Albert Lambort with address columns "10701 Lambert International Blvd". By defaullt some of the address will be cut in excel output. Here is the before screenshot without using the attributes to manipulate the text in excel output.

    For the above case, you can use the following HTML expression to wrap the address into multiple lines in excel output and make the complete address visible.

    <span data-aop-wrap-text="true" data-aop-character-per-line="18" data-aop-line-height="14pt" data-aop-max-line="3">&CUST_STREET_ADDRESS1.</span> - For Interactive Grid

    <span data-aop-wrap-text="true" data-aop-character-per-line="18" data-aop-line-height="14pt" data-aop-max-line="3">&CUST_STREET_ADDRESS1.</span> - For Interactive report/Classic report

    • data-aop-wrap-text="true" enables wrapping for the cell.
    • data-aop-character-per-line="18" tells AOP to estimate about 18 characters per line.
    • data-aop-line-height="14pt" sets each wrapped line height to 14 points.
    • data-aop-max-line="3" limits growth to 3 lines max, so rows do not become too tall.

    In below screenshot we can see that the address is wrapped into multiple lines in excel output and complete address is visible unlike before where it was cut after certain characters.

  • data-aop-header-line-break-off: Prevents the header text from breaking lines, even if the header contains <br> tags or long text.

    • Values: YES, TRUE
    • Example for Interactive report/Classic report : <span data-aop-header-line-break-off="TRUE">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-header-line-break-off="TRUE">&CUST_FIRST_NAME.</span>
  • data-aop-freeze family (Excel Exclusive): Freezes specific panes in Excel for easier navigation when scrolling large datasets.

    • Variations:
      • data-aop-freeze: Freezes both rows above and columns to the left of the current cell.
      • data-aop-freeze-row: Freezes all rows above this cell, keeping headers visible when scrolling down.
      • data-aop-freeze-column: Freezes all columns to the left of this cell, keeping row identifiers visible when scrolling right.
    • Values: YES, TRUE, 1
    • Example for Interactive report/Classic report : <span data-aop-freeze="true" data-aop-freeze-row="true" data-aop-freeze-column="1">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-freeze="true" data-aop-freeze-row="true" data-aop-freeze-column="1">&CUST_FIRST_NAME.</span>
  • data-aop-exclude-column: Completely removes the column from the exported file. Useful when you have columns needed in APEX but not required in the export.

    • Values: YES, TRUE
    • Example for Interactive report/Classic report : <span data-aop-exclude-column="YES">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-exclude-column="YES">&CUST_FIRST_NAME.</span>
  • data-aop-ignore: Completely ignores the HTML element containing this attribute in the output. Perfect for excluding buttons, icons, or HTML elements from the exported report.

    • Values: true, false
    • Example: If you have <span><i class="fa fa-edit"></i></span> that you don't want in the export, use <span data-aop-ignore="true"><i class="fa fa-edit"></i></span>. The icon will be removed from the final report but remain visible in APEX.
  • data-aop-heading-vertical-alignment: Sets vertical alignment for the header cell. Use to position header text at the top, center, or bottom of the header cell.

    • Values: TOP, BOTTOM, CENTER
    • Example for Interactive report/Classic report : <span data-aop-heading-vertical-alignment="CENTER">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-heading-vertical-alignment="CENTER">&CUST_FIRST_NAME.</span>
      • or in init PL/SQL for whole report: aop_api_pkg.g_rpt_header_vertical_alignment := "top";
  • data-aop-column-vertical-alignment: Sets vertical alignment for the data cells in the column. Use to align data consistently throughout the column.

    • Values: TOP, BOTTOM, CENTER
    • Example for Interactive report/Classic report : <span data-aop-column-vertical-alignment="TOP">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-column-vertical-alignment="TOP">&CUST_FIRST_NAME.</span>
      • or in init PL/SQL: aop_api_pkg.g_rpt_data_vertical_alignment := "bottom";

Supported Options for Word

The following attributes are supported when exporting to Word:

  • data-aop-heading-vertical-alignment: Vertical alignment for the header cell. Use to position header text at the top, center, or bottom.

    • Values: TOP, BOTTOM, CENTER
    • Example for Interactive report/Classic report : <span data-aop-heading-vertical-alignment="TOP">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-heading-vertical-alignment="TOP">&CUST_FIRST_NAME.</span>
      • or in init PL/SQL: aop_api_pkg.g_rpt_header_vertical_alignment := "top";
  • data-aop-column-vertical-alignment: Vertical alignment for data cells in the column. Use to align data consistently throughout the column.

    • Values: TOP, BOTTOM, CENTER
    • Example for Interactive report/Classic report : <span data-aop-column-vertical-alignment="BOTTOM">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-column-vertical-alignment="BOTTOM">&CUST_FIRST_NAME.</span>
      • or in init PL/SQL: aop_api_pkg.g_rpt_data_vertical_alignment := "bottom";
  • data-aop-exclude-column: Removes the entire column from the export. Useful when you have columns needed in APEX but not required in the Word document.

    • Values: YES, TRUE
    • Example for Interactive report/Classic report : <span data-aop-exclude-column="YES">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-exclude-column="YES">&CUST_FIRST_NAME.</span>
  • data-aop-ignore: Completely ignores the HTML element containing this attribute in the output. Perfect for removing buttons, icons, or HTML elements from the exported report.

    • Values: true, false
    • Example: <span data-aop-ignore="true"><i class="fa fa-edit"></i></span>
  • data-aop-width-weight: (Available in Interactive report/Classic report )Sets the width of the column based on a weight system. The default weight for each column is 1. By assigning a higher weight to a column, you can increase its width proportionally compared to other columns.

    • The width of each column is calculated using the formula: (weight of column) / (total weight of all columns) * 100%. This allows for flexible width adjustments based on the relative importance of each column.
    • Values: Numeric (weight value)
    • Example: <span data-aop-width-weight="2">#CUST_FIRST_NAME#</span>
  • data-aop-width: Sets the specific width of the column in the Word table. Use this for fixed-width columns that need exact dimensions.

    • Values: Number + unit (in, cm, px, pt, em)
    • Example for Interactive report/Classic report : <span data-aop-width="4cm">#CUST_FIRST_NAME#</span>
    • Example for Interactive Grid: <span data-aop-width="4cm">&CUST_FIRST_NAME.</span>

Oracle Charts

Available From: v24.1

AOP enables the direct export of Oracle Charts to native office Charts. This functionality is achieved by using the staticID of the chart region, similar to how we export Interactive Grids (IG), Interactive Reports (IR), and Classic Reports (CR).

The charts types that are currently supported are as follows:

  • Area
  • Bar
  • Bubble
  • Combination
  • Pie and Donut
  • Line
  • Line with Area
  • Radar
  • Scatter
  • Stock

The unsupported chart types are :

  • Box Plot
  • Status Meter Gauge
  • Funnel
  • Gantt
  • Polar
  • Pyramid
  • Range

Supported options

To override the default chart settings in the AOP output, you can use custom attributes for charts. The available custom attributes for charts allow you to control the exact dimensions of your exported charts:

  • data-aop-height: Sets the height of the exported chart. Use this to ensure your chart has enough vertical space in the document.

    • Supported units: in, cm, px, pt, em, eu
    • Supports decimal values for precise sizing
    • Example: data-aop-height="20pt"
  • data-aop-width: Sets the width of the exported chart. Use this to control how much horizontal space the chart occupies in the document.

    • Supported units: in, cm, px, pt, em
    • Supports decimal values for precise sizing
    • Example: data-aop-width="20pt"

Example

The following example shows the export of Bar Chart with a vertical orientation.

Data Source

The dynamic action settings to export the chart is as shown below. The data type is Region(s):Classic Report, Interactive Report/Grid, SVG, Canvas, HTML and other. You also need to provide the unique staticId for the Chart Region.

Template

The template consists the chart tag {$column}, where column is staticID of chart region and $ means it is a chart tag enclosed by the delimiters {..}.

Output

Upon processing the template and the chart data, AOP generates the following output.

Screeenshot of Regions

As a Image

With AOP, you can export a screenshot of a specific region by assigning a static ID to the region.
To utilize this feature, use the tag {%region_static_id}, where region_static_id represents the actual static ID assigned to the region.
This feature is available for standard regions such as static content and others. However, regions like Oracle Charts, Interactive Report, Classic Report, Interactive Grid, or Calendar must wrapped within the static content region as subregions, and the entire process is the same as for the static content region.

Supported Options

The supported options for screenshot of region are as follows you can specify these options as custom attributes of the region that you want to export as image:

  • data-aop-height: Sets the height of the exported image of the region.
    • Supported units: in, cm, px, pt, em, eu
    • Supports decimal values
    • Example: data-aop-height="20pt"
  • data-aop-width: Sets the width of the exported image of the region.
    • Supported units: in, cm, px, pt, em, eu
    • Supports decimal values
    • Example: data-aop-width="20pt"
  • data-aop-max-height: Sets the maximum height of the exported image of the region.
    • Supported units: in, cm, px, pt, em, eu
    • Supports decimal values
    • Example: data-aop-max-height="20pt"
  • data-aop-max-width: Sets the maximum width of the exported image of the region.
    • Supported units: in, cm, px, pt, em, eu
    • Supports decimal values
    • Example: data-aop-max-width="20pt"

Example

This example demonstrates how to export a report region by following the Interactive Report methodology.

alt text

However, to take screenshot of region instead of exporting it, the Interactive Report region(Report Region Screenshot) must wrapped within a Static Content region (Export Report Screenshot) and same static ID (IR_region) should be assigned to both the Static Content region and the dynamic action, as shown in the picture.

alt text

Template

The template includes the image tag {%IR_region}, where IR_region represents the staticID of the Static Content region. The % indicates that it is an image tag enclosed within the delimiters {..}

 Template  

Output

Upon processing the template, AOP generates the following output.

 Output  

AS a HTML Element

AOP also allows you to export a screenshot of a specific region as an HTML element in the output. The process is similar to exporting as an image, where you need to assign a static ID to the region and use the tag {_region_static_id} in the template and provide the custom attributes as aop-region-as="client_html". The difference is that instead of rendering the screenshot as an image, it will be rendered as an HTML element in the output document.

As a Svg Element

AOP also allows you to export a SVG elemnt of a specific region in the output. The process is similar to exporting as an image, where you need to assign a static ID to the region and use the tag {%region_static_id} in the template and provide the custom attributes as aop-region-as="client_svg". The difference is that instead of rendering the screenshot as an image, it will be rendered as a SVG element in the output document.

For more detailed information, you can visit the "Screenshots of Region" sample application example on AOP features.

Exporting APEX Page Items

AOP allows exporting APEX Page Items directly into your templates. There are different methods to achieve this based on your requirements which are as follows:

Using SQL query as source

In the SQL query, you can select the page items as columns Then add the page item in the Affected Elements section. For example:

select 'file1' as "filename",
cursor (
select :P1_ITEM1 as "item1"
from dual
) as "data"
from dual

Affected Items

Then in template, you can use the tag format {item1} to export the value of the page item.

Example Template

 APEX-ITEM-SQL.docx  

Using Region as source

You can create a region (e.g., static content) that contains the desired page items and provide static ID to the region. Then in Data Source provide the Static Id of the region and in Affected Elements section, provide the name of page items. In template, you can use the tag format

{#static_id}
{P1_ITEM1}
{P1_ITEM2}
{P1_ITEM3}
{P1_ITEM4}
{/static_id}

Using this option, you can export multiple page items at once along with their labels or you can export the image of the region containing the page items. Please check the template below for reference.

 APEX-ITEM-Region.docx  

Using g_apex_items option

You can use the g_apex_items option in AOP to include specific page items in the export. This can be done by setting the aop_api_pkg.g_apex_items variable in the initialization PL/SQL code of your dynamic action. For example:

aop_api_pkg.g_apex_items := 'P1_ITEM1:P1_ITEM2:P1_ITEM3';

Then in Affected Elements section, provide the name of page items. In template, you can use the tag format {P1_ITEM1}, {P1_ITEM2}, {P1_ITEM3} to export the values of the specified page items.

Additionally, you can also export app id using this option by adding APP_ID in the g_apex_items variable as shown below:

aop_api_pkg.g_apex_items := 'P700_TITLE:APP_ID';

 APEX-ITEM-INLINE-PLSQL.docx  

Using large XML as data source

AOP DA plugin provides the option XML (data part) but due to its character limitation, it cannot be used for long XML data. In this case you can use the SYS.XMLTYPE.createXML function in the PL/SQL. Below is a simple example that demonstrates how to use the SYS.XMLTYPE.createXML function to handle large XML data in AOP. This funtion takes a CLOB input, converts it to XMLTYPE, and then writes it as JSON using APEX_JSON package.

CREATE OR replace FUNCTION get_json_from_xml (p_data_source IN CLOB) RETURN CLOB IS l_data CLOB;
BEGIN apex_json.initialize_clob_output;
apex_json.open_object;

-- Convert the XML string/CLOB INTO an XMLTYPE AND write as JSON
-- Note: Ensure p_data_source IS valid XML OR this will throw an error
apex_json.write(
p_name = > 'xml_data',
p_value = > SYS.XMLTYPE.createXML(p_data_source)
);
apex_json.close_object;
l_data := apex_json.get_clob_output;
apex_json.free_output;
RETURN l_data;
EXCEPTION
WHEN OTHERS THEN
apex_json.free_output;
RAISE;
END get_json_from_xml;
/

In AOP DA's data type, select PL/SQL (returning JSON) and provide the following data source. This will use the get_json_from_xml function to get the JSON data for the XML data from aaa_xml_clob table.

declare
l_xml clob;
l_data_json clob;
l_return clob;
begin
select x.xml
into l_xml
from aaa_xml_clob x
where x.id = 2;

l_data_json := get_json_from_xml(l_xml);

apex_json.initialize_clob_output(dbms_lob.call, true, 2);
apex_json.open_array;

apex_json.open_object;
apex_json.write('filename', 'file1');
apex_json.write_raw('data', l_data_json);
apex_json.close_object;

apex_json.close_array;

l_return := apex_json.get_clob_output;
apex_json.free_output;

return l_return;

exception
when others then
apex_json.free_output;
raise;
end;

Using the above method, you can handle large XML data in AOP without running into character limitations of the XML data type in the AOP DA plugin. Just ensure that the XML data you are trying to convert is well-formed, otherwise the SYS.XMLTYPE.createXML function will throw an error.

Custom Report Layout

Available From: v26.1

When the standard report tags are too rigid, you can use the |report filter to shape your Interactive Reports, Interactive Grids, and Classic Reports exactly the way you want with your template.

When to use |report

when you want to build your own layout with {staticID|report} you can access all the report data and metadata to create a fully customized report layout as your tempale.

PropertyDescriptionExample
region_nameThe title of the report region{region_name}
filtersThe filters currently applied to the report{#filters}..{/filters}
highlightsThe highlight definitions currently active on the report{#highlights}..{/highlights}
columnsThe visible report columns in display order, each with name, alias, and label{#columns}.. {/columns}
rowsThe report rows. Each row still exposes the original column aliases{#rows}..{/rows}
cellsThe visible cells for that row in display order, each with label, alias, value, and optional highlight{#cells}..{/cells}

cells only contains visible columns, so the export automatically follows the user's current report layout.

Examples

1. Label and value layout

This is useful when you want a readable block instead of a table.

{#aopireportdata|report}
{#rows}
{#cells}
{label}: {value}
{/cells}
{/rows}
{/}

2. Fixed layout with specific fields

If you already know which fields you want to print, reference them directly inside rows.

{#aopireportdata|report}
{region_name}

{#rows}
{product_name}
{%image}
Quantity: {quantity}= Total: {order_total}

{/rows}
{/}

3. Show only highlighted rows

Each row exposes a highlight object when it matches an APEX row highlight rule.

{#aopireportdata|report}
{#rows}
{#highlight}
{name}
Customer: {CUST_FIRST_NAME} {CUST_LAST_NAME}
{/highlight}
{/rows}
{/}

Rows without a matching row highlight are skipped by the inner {#highlight} loop.

4. Show the active filters or highlights with meta data

{#aopireportdata|report}
Filters:
{#filters}
{name}
{background_color} {font_color}
{column} {operator} {expression}
{/filters}

Highlights:
{#highlights}
{name}: {background_color} {font_color}{column} {operator} {expression} color will be in hex format
{/highlights}

{/}
note

The |report filter only reshapes the report data for templating. Existing features continue to work as usual with these filter.