0
votes

I am exporting a PDF report from Oracle APEX using a Report Query defined in Shared Components. By default, the file name for the generated PDF is the Report Query name. Is there a way to customize the name? I need to include a timestamp in it, however I cannot find any solution. I am not using any external tool for report generation, and the layout is defined in XSL-FO. Thanks for your help.

2

2 Answers

1
votes

Create a PL/SQL process and use the following API:

APEX_UTIL.DOWNLOAD_PRINT_DOCUMENT (
        p_file_name           => 'myreport123',
        p_content_disposition => 'attachment',
        p_application_id      => :APP_ID,
        p_report_query_name   => 'report1',
        p_report_layout_name  => 'report1',
        p_report_layout_type  => 'rtf',
        p_document_format     => 'pdf');

The above code assumes that your Report Query Name and Report Layout Name are report1

Note that you can change p_file_name to whatever you like.

0
votes

If you are using XSLT 2.0 or XSLT 3.0, you can get the current time (not the modification time of the source document) using currentDateTime(). See https://www.w3.org/TR/xpath-functions/#func-current-dateTime

If you are still using XSLT 1.0, your XSLT processor might implement the EXSLT extensions for date and time. See http://exslt.org/date/index.html