33.14 IMPORT_SAVED_REPORTS Procedure

This procedure imports saved reports into an app in the current workspace. Supports importing default or user-saved reports.

If calling outside of Oracle APEX, use apex_util.set_workspace to set the current workspace.

Syntax

APEX_IR.IMPORT_SAVED_REPORTS (
    p_export_content       IN CLOB,
    p_credential_static_id IN VARCHAR2,
    p_replace_report       IN BOOLEAN  DEFAULT TRUE,
    p_new_owner            IN VARCHAR2 DEFAULT apex_application.g_user,
    p_new_application_id   IN NUMBER   DEFAULT NULL );

Parameters

Parameter Description
p_export_content The signed and base64-encoded report export JSON.
p_credential_static_id The Key Pair authentication credential static ID. The same credential used to sign the export content is used to verify.
p_replace_report If TRUE (default), report is replaced if exists.
p_new_owner The case-sensitive new owner of the reports. Only non-default reports can be overwritten with p_new_owner.
p_new_application_id The new application ID of the reports. The reports are imported to the application containing valid interactive report regions.

Example

The following example imports reports using the uploaded export file and my_API_key_pair credential. The owner and application ID of the reports are overwritten by the entered page item values during the import.

DECLARE
    l_blob blob;
BEGIN
    SELECT blob_content
        INTO l_blob
        FROM apex_application_temp_files
    WHERE name = :P1_FILE;

    apex_ir.import_saved_reports (
        p_export_content       => apex_util.blob_to_clob( l_blob ),
        p_credential_static_id => 'my_API_key_pair',
        p_new_owner            => :P1_NEW_OWNER,
        p_new_application_id   => :P1_NEW_APP_ID );
END;