вторник, 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.




2 комментария:

  1. So how hard would it be to allow a page item or two to be used a the first line in the spreadsheet downloaded? I need a title or header row and date included on ALL excel files downloaded from APEX pages.

    Any suggestions?

    ОтветитьУдалить
  2. Buy Taito's Fusion Tinted Titanium (Tinted Tiaglass) Online at
    Get exclusive Tinted Titanium Tinted Tiaglass FREE titanium dive watch Trial - $8.00 OFF. FOR thunder titanium lights SALE! TINTED Tiaglass is a premium Tinted titanium plate flat irons Titanium titanium flat iron Stainless Steel (T-Tinted). Buy this product titanium white octane blueprint at an

    ОтветитьУдалить