$options = ttReportHelper::getReportOptions($bean);
if (!$totals_only)
$items = ttReportHelper::getItems($options); // Individual entries.
-if ($totals_only || 'no_grouping' != $group_by1)
+if ($totals_only || ttReportHelper::grouping($options))
$subtotals = ttReportHelper::getSubtotals($options); // Subtotals for groups of items.
$totals = ttReportHelper::getTotals($options); // Totals for the entire report.