Przejdź do głównej treści

Odczyt parametrów raportu w customowym skrypcie


Co zrobić by odczytać parametry raportu

  1. Dodać w swoim skrypcie kod:
require_once(MOD_PATH.'Reports/beans/ReportBeanHolder.inc');
$report = new ReportBeanHolder($args['listName'], $args['rep_id']);
//fdebug2($report->getParams()); // ustawione filtry

Jako wynik wywołania metody

{{{{ $report->getParams(); }}}}

otrzymamy tablicę w postaci np.

Array
(
    [{ORDER_BY}] =>  (string => string)
    [{SEARCH}] => 1=1 (string => string)
    [{LIMIT}] => OFFSET 0 LIMIT 50 (string => string)
    [{GROUP_BY}] =>  (string => string)
    [{DATE_FROM}] => 1970-01-01 00:00:00 (string => string)
    [{DATE_TO}] => 3000-01-01 00:00:00 (string => string)
    [{USR_ID}] => 276,35,42,41,48,95,104,63,106,138,88,98,74,69,126,78,163,72,70,207,82,81,64,45,117,71,67,43,44,47,108,121,87,133,134,109,129,158,86,68,65,90,89,91,93,118,57,76,80,83,84,271,111,169,66,155,156,58,122,49,124,264,141,139,144,145,146,150,157,210,250,254,259,262,251,252 (string => string)
    [{LOGGED_USR_ID}] => 41 (string => string)
    [{LOGGED_USRNAM}] => admin (string => string)
    [{LOGGED_USR_SYMBOL}] => NULL (string => NULL)
    [{ENT_ID}] => 2 (string => string)
    [{CONFIG_ENT_ID}] => 2 (string => string)
    [{ENTITY_SYMBOL}] => chemical (string => string)
    [{ENTITY_NAME}] => Demo S.A. (string => string)
    [{SYMBOL}] => 1 (string => integer)
    [{FILTER_STRING}] => (4=4) AND TRUE (string => string)
    [{ACORID}] => 121 (string => string)
    [{TOVCID}] => 0 (string => integer)
    [{ADANID}] => 0 (string => integer)
    [{CONTID}] => 1 (string => string)
    [{CONTIDS}] => 1 (string => string)
    [{DOC_ID}] => 0 (string => integer)
    [{DOC_IDS}] => 0 (string => integer)
    [{DOCIDS}] => 0 (string => integer)
    [{PRC_ID}] => 0 (string => integer)
    [{PRC_IDS}] => 0 (string => integer)
    [{PRCIDS}] => 0 (string => integer)
    [{EVNTID}] => 0 (string => integer)
    [{EVNTIDS}] => 0 (string => integer)
    [{CAMPID}] => 0 (string => integer)
    [{CAMPIDS}] => 0 (string => integer)
    [{DEVCID}] => 0 (string => integer)
    [{DEVCIDS}] => 0 (string => integer)
    [{DEPOID}] => 0 (string => integer)
    [{DEPOIDS}] => 0 (string => integer)
    [{PTSTID}] => 0 (string => integer)
    [{PRTPID}] => 0 (string => integer)
    [{PROJID}] => 0 (string => integer)
    [list_details_rep_id] => NULL (string => NULL)
    [{list_details_rep_id}] => NULL (string => NULL)
    [{FILTER_TAB}] => fke.state_ = 9 AND (casen                when {LOGGED_USR_ID} in (select usr_id from users_link_group where grp_id in (194,2))n                then TRUEn                ELSE {LOGGED_USR_ID} = f1.data__::INT end)n                AND NOT fke.is_del (string => string)
    [{FILTER_TAB2}] => NOT d.is_del AND d.tpstid IN (271) (string => string)
    [LIST_NAME] => cModule_UcModule_U_PPATHe31985d8e28f6f3Li (string => string)
    [{LIST_NAME}] => cModule_UcModule_U_PPATHe31985d8e28f6f3Li (string => string)
    [{LIMIT_P}] => 0 (string => integer)
    [{LIMIT_RPP}] => 50 (string => integer)
)

Wszystkie zwrócone klucze są użyte jako tokeny w raporcie!!!

Załącznik

W załączniku cały testowy skrypt.

ReportBeanHolderTest.inc