вторник, 27 января 2015 г.

"GPV Interactive Report to MSExcel" plugin: How to set Maximum Rows property for certain pages.


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.

get_xlsx_from_ir_ext( 
          p_maximum_rows    => null,
          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.




пятница, 7 ноября 2014 г.

APEX URL Parser/Builder




Syntax of APEX URL is not easy interpretable, there are many hard to read colon separated values. Peter has great article about this, additionally to Oracle Documentation.
But in APEX there are many places without cool wizard to easy build this complexes URL. To help other developers I build simple APEX URL Builder / Parser, which parse URL to component parts for separate analyze and modifications.  You can of course build your own URL using predefined substitution variables like &APP_ID., &&SESSION_ID. Etc.
APEX URL Builder / Parser

APEX URL PARSER BUILDER
 


четверг, 6 ноября 2014 г.

Export to Excel from Interactive Reports

Now it is possible to correct export results of Interactive reports to Excel, with correct displaying of strings, number and dates. Excel - export has never been so cool and simple. 



The "GPV Interactive Report to Excel" APEX plugin support now this main features:
•    Correct export of data types (String/Date/Number)
•    Filtering and Sorting
•    Control Break
•    Computations
•    Aggregations
•    Highlighting
•    Auto adjustable Column Width
•    Date/Number Formats
•    Custom downloaded file name (see FAQ)
•    Can be easy implemented for all Interactive reports in application (see FAQ) 

+  New!  Support of substituion variables into SQL-querie of Interactive Report.

This new feature allows you to use different WHERE - clauses with BIND-varables within. See my post that describe use-cases.

See this plugin on GitHub