3.5.6 Configuring Report Printing for an Instance

Enable end users to download and print reports in various formats, including PDF.

3.5.6.1 About Configuring Report Printing

Enable report printing by configuring printing settings at the instance level, application level, and page and region level.

To set up report printing functionality, you must configure the following printing settings:
  1. Instance Level: For full development environments, instance administrators must select a Print Server under Instance Settings, Report Printer. In runtime environments, instance administrators must specify the level of functionality (Standard or Advanced) for an entire APEX instance, as described in this section.

  2. Application Level: Developers can specify a Print Server at the application-level by editing the Print Server Type attribute on the Application Definition page. Alternatively, workspace administrators and developers can define Report Queries and Report Layouts. Report Queries and Report Layouts are stored under Shared Components and are not tied to a specific page.

  3. Page/Region Level: Developers can edit the report regions on specific pages to enable printing. This enables end users to print regions as reports in various formats.

See Also:

Printing Report Regions in Oracle APEX App Builder User’s Guide

When using the Oracle Document Generator Pre-built Function, your APEX instance must run off a database with DBMS_CLOUD installed. Prior to configuring report printing, you must create the DBMS_CLOUD credential in the database, and configure Document Generator as a Remote Print Server through the OCI Pre-built Function Page.

Tip:

For more information on configuring the DBMS_CLOUD credential, see Understanding Web Credentials in Oracle APEX App Builder User’s Guide.

For more information on configuring Document Generator as a Remote Print Server, see Document Generator Function in Oracle Cloud Infrastructure Documentation.

3.5.6.2 Configuring Report Printing in a Full Development Environment

Configure the print server type for an instance by editing the Print Server Type attribute on the Instance Settings page.

To configure the printing of reports in a full development environment:

  1. Sign in to Administration Services.
  2. Click Manage Instance.
  3. Under Instance Settings, click Instance Settings.
  4. Click Report Printing.
  5. For Printer Server, select an option:
    • 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 APEX and using your own customized XSL-FO templates.
    • 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 APEX.
    • APEX Office Print - Select this option if you are using APEX Office Print. This option enables you to take report query results and convert them from JSON to PDF/MS Office formats using APEX Office Print. Select this option to upload your own MS Office templates for printing reports within APEX.
    • Oracle Document Generator Pre-built Function - Select this option if you are using Oracle Document Generator Pre-built Function. This option enables you to take report query results and convert them from JSON to PDF format using Oracle Document Generator Pre-built Function. Select this option to upload your own DOCX templates for printing reports within APEX.
    What appears next depends upon the selected Print Server.
  6. For External (Apache FOP) or Oracle BI Publisher, specify the following:
    1. Protocol - Select whether the print server uses HTTP or HTTPS protocol.
    2. Host Address - Specify the host address of the print server converting engine. By default, this is set to localhost.
    3. Port - Specify the host address of the print server converting engine. The default setting is 8888.
    4. Script - Defines the script that is the print server engine. The default setting is:
      /xmlpserver/convert
      
    5. Print Timeout - Enter the number of seconds. Defines the transfer timeout for communicating with the print server in seconds.
  7. For APEX Office Print, specify the following:
    1. Protocol - Select whether the print server uses HTTP or HTTPS protocol.
    2. Host Address - Specify the host address of the print server converting engine. By default, this is set to localhost.
    3. Port - Specify the host address of the print server converting engine. The default setting is 8888.
    4. Script - Defines the script that is the print server engine.
    5. API Key - If you are using APEX Office Print Cloud Server, enter the Print Server API Key. Do not enter an API Key if you running APEX Office Print locally.
    6. Print Timeout - Enter the number of seconds. Defines the transfer timeout for communicating with the print server in seconds.
  8. For Oracle Document Generator Pre-built Function, specify the following:
    1. Cloud Credential - Specifies the cloud credential to use for Oracle Object Storage bucket management and use of the Oracle Document Generator Pre-built function.
      Note: The Cloud credential can be created using the APEX_INSTANCE_ADMIN.CREATE_CLOUD_CREDENTIAL API.
    2. Object Storage Namespace - Specifies the top-level container for all buckets and objects. At account creation time, each Oracle Cloud Infrastructure (OCI) tenant is assigned one unique system-generated and immutable Object Storage namespace name. This information can be found in the OCI console.
    3. Object Storage Bucket Compartment OCID - Specifies the Oracle Cloud Identifier (OCID) of the compartment where the Oracle Document Generator Pre-built function is located.
    4. Object Storage Bucket Endpoint - Specifies the base URL endpoint for the Oracle Object Storage bucket.
    5. Function OCID - Specifies the Oracle Cloud Identity (OCID) of the Oracle Document Generator Pre-built function. This can be found in the Oracle Cloud Infrastructure (OCI) console.
    6. Function Endpoint - Specifies the base URL endpoint of the Oracle Document Generator Pre-built function. This can be found in the Oracle Cloud Infrastructure (OCI) console.
  9. Click Apply Changes.

Tip:

You can override the Print Server Type instance-level setting at the application-level by editing the Print Server Type attribute on the Application Definition page.

See Also:

Configuring Report Printing at the Application Level in Oracle APEX App Builder User’s Guide

3.5.6.3 Configuring Report Printing Settings in a Runtime Environment

Configure report printing settings in a runtime environment by starting SQLcl and running the following SQL statements.

To configure report printing settings in a runtime environment:

  1. Start SQLcl and connect to the database where APEX is installed as SYS. For example:
    • On Windows:

      SYSTEM_DRIVE:\ sql /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sql /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. Run the following statement:
    BEGIN
        APEX_INSTANCE_ADMIN.SET_PARAMETER(PARAMETER_NAME, PARAMETER_VALUE);
        COMMIT;
    END;
    

    For a description of available parameters, see Table 3-3.

    Table 3-3 Report Printing Parameters in Runtime Environment

    Parameter Name Description

    PRINT_BIB_LICENSED

    Specify either standard support or advanced support. Advanced support requires an Oracle BI Publisher license. Valid values include:

    • STANDARD

    • ADVANCED

    • APEX_LISTENER

    PRINT_SVR_HOST

    Specifies the host address of the print server converting engine, for example, localhost. Enter the appropriate host address if the print server is installed at another location.

    PRINT_SVR_PORT

    Defines the port of the print server engine, for example 8888. Value must be a positive integer.

    PRINT_SVR_PROTOCOL

    Valid values include:

    • http

    • https

    PRINT_SVR_SCRIPT

    Defines the script that is the print server engine, for example:

    /xmlpserver/convert
    

See Also:

SET_PARAMETER Procedure in Oracle APEX API Reference

3.5.6.4 Determining Report Printing Settings in a Runtime Environment

Determine report printing settings in a runtime environment.

To determine report printing settings in a runtime environment:

  1. Start SQLcl and connect to the database where APEX is installed as SYS. For example:
    • On Windows:

      SYSTEM_DRIVE:\ sql /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sql /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. Run the following statement:
    SELECT 
    APEX_INSTANCE_ADMIN.GET_PARAMETER(PARAMETER_NAME)
    FROM DUAL;
    

See Also: