9.9 Printing Report Regions

Configure a report region to print by exporting it to several different formats.

Tip:

If you run Oracle Application Express with Oracle Database 11g Release 1 (11.1) or later, you must enable network services to use report printing if you configured an external print server. See "Enabling Network Services in Oracle Database 11g or Later."

9.9.1 About Report Printing

By taking advantage of region report printing, your application users can view and print reports that have a predefined orientation, page size, column headings, and page header and footer. Classic reports, interactive reports and interactive grids also have the ability to export to PDF, Microsoft Excel, HTML, and Comma Separated Values (CSV). Additional export formats require the use of an external print server.

Oracle Application Express provides three report printing configuration options:

  • None (Native) - Select this option if you do not use an external print server. This option enables you to use the basic printing functionality, which includes CSV, HTML, PDF and XLSX.

  • Oracle BI Publisher - This option requires a valid license of Oracle BI Publisher (also known as Oracle XML Publisher). This option enables you to take report query results and convert them from XML to RTF format using Oracle BI Publisher. Select this option to upload your own customized RTF or XSL-FO templates for printing reports within Application Express.

    Oracle BI Publisher supports Adobe Portable Document Format (PDF), Microsoft Word Rich Text Format (RTF), or Microsoft Excel format (XLS), or Extensible Markup Language (XML). If you choose to use other third-party rendering engines, other output formats can also be configured.

    Tip:

    To learn more about installing and configuring Oracle BI Publisher, see "About Report Printing Configuration Options".

  • External (Apache FOP) - Select this option if you are using Apache FOP on an external J2EE server. This option enables you to use the basic printing functionality, which includes creating report queries and printing report regions using the default templates provided in Application Express and using your own customized XSL-FO templates.

  • Oracle REST Data Services - Select this option if you are using the Oracle REST Data Services (formerly called Application Express Listener) release 2.0 or later. This option enables you to use the basic printing functionality, which includes creating report queries and printing report regions using the default templates provided in Application Express and using your own customized XSL-FO templates.

    Note:

    The Oracle REST Data Services option does not require an external print server, instead the report data and style sheet are downloaded to the listener, rendered into PDF format by the listener and then sent to the client. The PDF documents in this setup are not returned back into the database, thus the print APIs are not supported when using the Oracle REST Data Services-based configuration.

    Note:

    The functionality to produce PDF Reports has been removed in Oracle REST Data Services (ORDS) release 19.4.

Note:

Your Oracle Application Express instance administrator can change the report printing configuration for your instance. See "Configuring Report Printing for an Instance" in Oracle Application Express Administration Guide

9.9.2 About Printing Reports to PDF

Oracle Application Express has native support to print basic reports to PDF. Use a report server if you want full control and advanced layouts for your reports.

9.9.3 Configuring Report Printing at the Application-Level

Configure the print server type for an application by editing the Print Server Type attribute on the Application Definition page. The application-level Print Server Type overrides similar settings in Instance Administration.

To configure report printing at the application-level:

  1. On the Workspace home page, click the App Builder icon.
  2. Select an application.
    The Application home page appears.
  3. From Application home page, you can access the Definition page in two ways:
    • Click the Edit Application Properties button.
    • From Shared Components:
      • Click Shared Components.

      • Under Application Logic, click Application Definition Attributes.

    The Definition page appears.

  4. Under Report Printing, select a Print Server Type. Options include:
    • Native Printing - Use native printing. No external print server required.
    • Remote Print Server - Choose a remote server of the type "Print Server" that is configured in the Workspace Utilities.
    • Use Instance Settings - Use the Report Printing settings defined at Instance Administration.
  5. Click Apply Changes to save your changes.

Note:

9.9.4 About Classic Report Printing Methods

There are two ways to print classic report regions:

Both report regions and report queries can be downloaded in the following formats:

  • PDF - Adobe Portable Document Format.

  • RTF - Microsoft Word Rich Text Format.

  • Excel - Microsoft Excel format. Note that when BI Publisher is configured as print server and a custom report layout is specified, the export is not a true .xls file because the content is HTML-based.

  • HTML

  • XML - Extensible Markup Language.

To format either a report region or report query, you associate it with a report layout.

Tip:

You can also have the output format specified by an item that determines the output format at runtime. Select the item that holds the format value. Valid values are PDF, RTF (to open the document in Microsoft Word), XLS (to open the document in Microsoft Excel) and HTML (to download the document as an HTML file).

9.9.5 Configuring Classic Report Print Attributes

One approach to printing a report region is to configure Print Attributes. Once configured, these attributes apply only to the current region and cannot be used outside the context of the region.

To configure a classic report region for printing:

  1. View the page in Page Designer:
    1. On the Workspace home page, click the App Builder icon.
    2. Select an application.
    3. Select a page.
    Page Designer appears.
  2. In the Rendering tab, select the region containing the report.
  3. Enable the Attribute, Printing:
    1. In the Property Editor, select the Attributes tab.
    2. Under Printing, set Enabled to On.
  4. Configure Printing attributes:
    1. In the Property Editor, select the Printing tab.
    2. Edit the appropriate Printing attributes.

      Tip:

      To view help for an attribute, select the attribute in the Property Editor and click the Help tab in the central pane.

  5. To save your changes click Save. To save and run the page, click Save and Run Page.

9.9.6 Configuring Interactive Report Regions for Printing

You can configure a report region to print in various formats.
Unlike classic reports, the interactive report Print Attributes can only use the default XSL-FO layout and is initiated from the report Attributes, Download.. Once configured, these attributes only apply only to the current region and cannot be used outside the context of the region.

To configure an interactive report region for printing:

  1. View the page in Page Designer:
    1. On the Workspace home page, click the App Builder icon.
    2. Select an application.
    3. Select a page.
    Page Designer appears.
  2. In the Rendering tab, select the region containing the report.
  3. Enable the Attribute, Printing:
    1. In the Property Editor, select the Attributes tab.
    2. Find Printing.
    3. Set Enabled to On.
  4. Configure Printing attributes:
    1. In the Property Editor, select the Printing tab.
    2. Edit the appropriate Printing attributes.

      Tip:

      To view help for an attribute, select the attribute in the Property Editor and click the Help tab in the central pane.

  5. To save your changes click Save. To save and run the page, click Save and Run Page.

9.9.7 About Report Queries

You can print a report region by defining a report query as a Shared Component. A report query identifies the data to be extracted. Unlike SQL statements contained in regions, report queries contain SQL statements that are validated when you save the query. Note that report queries must be SQL statements, not functions returning SQL statements.

9.9.8 About Report Layouts

To format either a classic report region or report query, you associate it with a report layout. Using report layouts renders the data in a printer-friendly format. If you do not select a report layout, a default XSL-FO layout is used. The default XSL-FO layout is always used for rendering Interactive Report regions.