Add Filter to Report Using Hooks
Content
I find it odd that there isn't much documentation on how to achieve the same (or maybe my searching skills aren't that good) but searching through the discussions I was able to build some lines of code.
The Scenario
Using a pre_report_get, I want to filter a report (ID 176) on the Answer.Summary column. Here is what I've gathered so far from this thread:
<br /> // hooks.php<br /> $rnHooks['pre_report_get'][] = array(<br /> 'class' => 'filter_report',<br /> 'function' => 'report_run',<br /> 'filepath' => ''<br /> );<br /> <br /> // filter_report Class<br /> function report_run($hookData)<br /> {<br /> if($hookData['data']['reportId'] == '176') <br /> {<br /> $hookData['data']['filters']['custom1']->filters->fltr_id = answers.summary; <br /> $hookData['data']['filters']['custom1']->filters->oper_id =7; <br /> $hookData['data']['filters']['custom1']->filters->data = 'Garbage'; <br /> $hookData['data']['filters']['custom1']->filters->rnSearchType = 'custom';<br />
Tagged:
0