Hi,
I need some help filtering the DataObjects returned from a Report. Basically I have a custom query using groupby and COUNT() to display the number of bookings made to individual Service Centrer, and now I would like to be able to filter these results using a start and end date. Have tried to set this up using a Report but if i try to submit the Form using any custom classes I get "Method 'doReport' not found in class 'Form'" and not sure what I could extend do include that function... maybe this would be better in the ModelAdmin but couldn't figure out how to do the groupby and MySQL COUNT there. Any help or pointers would be appreciated!
<?php
class BookingsReport extends SSReport {
protected $title = "Bookings report";
protected $description = "Booking requests submitted by email";
function getCMSFields() {
$fields = new FieldSet();
$fields->push(new CalendarDateField('StartDate', 'StartDate'));
$fields->push(new CalendarDateField('EndDate', 'EndDate'));
$fields->push(new FormAction('doReport', 'Run Report'));
$fields->push($this->ReportField);
return $fields;
}
function doReport() {
echo "1";
}