/**
* Build the aggregation {@link DataTable}
*/
protected final DataTable buildAggregationReport(F form) throws TypeMismatchException {
//Pull data out of form for per-group fetching
final AggregationInterval interval = form.getInterval();
final DateMidnight start = form.getStart();
final DateMidnight end = form.getEnd();
final DateTime startDateTime = start.toDateTime();
//Use a query end of the end date at 23:59:59
final DateTime endDateTime = end.plusDays(1).toDateTime().minusSeconds(1);
//Get the list of DateTimes used on the X axis in the report
final List<DateTime> reportTimes = this.intervalHelper.getIntervalStartDateTimesBetween(interval, startDateTime, endDateTime, maxIntervals);
final Map<D, SortedSet<T>> groupedAggregations = createColumnDiscriminatorMap(form);
//Determine the ValueType of the date/time column. Use the most specific column type possible
final ValueType dateTimeColumnType;
if (interval.isHasTimePart()) {
//If start/end are the same day just display the time
if (startDateTime.toDateMidnight().equals(endDateTime.toDateMidnight())) {
dateTimeColumnType = ValueType.TIMEOFDAY;
}
//interval has time data and start/end are on different days, show full date time