The simplest way to use functionality of "GPV Interactive Report to MSExcel" plugin in all page in application is a creation of “On Load: After Header” application process.
get_xlsx_from_ir_ext(
p_maximum_rows => null,
p_jquery_selector => null,
p_download_type => 'E', -- E -> Excel XLSX
p_replace_xls => 'Y', --Y/N
p_custom_width => null
);
But in this case maximal count of exported rows - p_maximum_rows parameter must be set general for whole application. If this parameter is NULL - Maximum Row Count of currently used Interactive Report will be applied.
But typical task is to get users with special rights an ability to download unlimited data from Interactive Reports on certain pages.
In code above, parameter p_maximum_rows is the same for all pages in application. But you need to find easiest way to modify this parameter for certain page. Firs you need to create protected hidden items on this pages. This items should have specific names (P23_DOWNLOAD_MAX_ROWS for page 23) and contains count of maximal downloaded rows depending on user rights (10000000000 for unlimited). To fill this items you need create “After Header” calculation process.
For example:
This calculation process gives limit of 100000000 rows users with UNLIM_CONTACT_EXPORT role, and set default value for others.
Now you need modify your “On Load: After Header” application process to use this variable automatically when it exist on page. Use a little hack: use substitution string in item name.
p_maximum_rows =>
:P&APP_PAGE_ID._DOWNLOAD_MAX_ROWS,
p_jquery_selector => null,
p_download_type => 'E',
-- E -> Excel XLSX
p_replace_xls =>
'Y', --Y/N
p_custom_width => null );
Now, when current page is 23 and page item P23_DOWNLOAD_MAX_ROWS exist, it will be used. Otherwise will be used default value, Maximum Row Count of current Interactive Report.
