Beta Draft: 2016-09-09

27.20 DOWNLOAD_PRINT_DOCUMENT Procedure Signature 2

This procedure initiates the download of a print document using pre-defined report query and RTF and XSL-FO based report layout.

Syntax

APEX_UTIL.DOWNLOAD_PRINT_DOCUMENT (
    p_file_name           IN VARCHAR,
    p_content_disposition IN VARCHAR,
    p_application_id      IN NUMBER,
    p_report_query_name   IN VARCHAR2,
    p_report_layout       IN CLOB,
    p_report_layout_type  IN VARCHAR2 default 'xsl-fo',
    p_document_format     IN VARCHAR2 default 'pdf',
    p_print_server        IN VARCHAR2 default null);

Parameters


Table 27-18 DOWNLOAD_PRINT_DOCUMENT Parameters

Parameter Description

p_file_name

Defines the filename of the print document.

p_content_disposition

Specifies whether to download the print document or display inline ("attachment", "inline").

p_application_id

Defines the application ID of the report query.

p_report_query_name

Name of the report query (stored under application's Shared Components).

p_report_layout

Report layout in XSL-FO or RTF format.

p_report_layout_type

Defines the report layout type, that is "xsl-fo" or "rtf".

p_document_format

Defines the document format, that is "pdf", "rtf", "xls", "htm", or "xml".

p_print_server

URL of the print server. If not specified, the print server is derived from preferences.


Example for Signature 2

The following example shows how to use the DOWNLOAD_PRINT_DOCUMENT using Signature 2 (Pre-defined report query and RTF or XSL-FO based report layout.). In this example, the data for the report is taken from a Report Query called 'ReportQueryAndXSL' stored in the current application's Shared Components > Report Queries. The report layout is taken from a value stored in a page item (P1_XSL).

BEGIN
    APEX_UTIL.DOWNLOAD_PRINT_DOCUMENT (
        p_file_name           => 'mydocument',
        p_content_disposition => 'attachment',
        p_application_id      => :APP_ID,
        p_report_query_name   => 'ReportQueryAndXSL',
        p_report_layout       => :P1_XSL,
        p_report_layout_type  => 'xsl-fo',
        p_document_format     => 'pdf');
END;