Is it possible to set a default value for a filter in report builder?
For example, on a page using an embedded report I'd like to set the date filter to the previous 12 months when landing on the page
I'm currently using this work around:
$report = reportbuilder_get_embedded_report($shortname, $reportdata, false, $sid) // Calculate todays date minus x months. $timestart = new DateTime(); $timestart->setTimezone(core_date::get_user_timezone_object()); $timestart->sub(new DateInterval('P12M')); $SESSION->reportbuilder[$report->get_uniqueid()] = array( 'base-completeddate' => array( 'after' => $timestart->getTimestamp(), 'after_applied' => 1, 'before' => 0, 'daysafter' => 0, 'daysbefore' => 0, 'notset' => 0 ) );