I want to send some predefined reports via email using dbms job. For this, i am trying to use APEX_UTIL.GET_PRINT_DOCUMENT function signature 2 which returns a document as BLOB using pre-defined report query and pre-defined report layout. I have created a report layout(in rtf) and report query (with report in pdf format) in Apex Shared components. Query works fine (returns pdf report) when I check it using Test Report button in report query.
However, When I call GET_PRINT_DOCUMENT(), it returns null.
I am using Apex 4.2.2 and i call it as below.
l_document := APEX_UTIL.GET_PRINT_DOCUMENT
Any idea what's the issue and how can i send a report via email?
And In another try, I used another report query and layout which gives xls report. In that case, GET_PRINT_DOCUMENT() returns an object but the excel file emailed is blank.