set_grouping

 
          set_grouping(array $group_by_array)  
Using Smart Report Engine, you can generate reports with multiple grouping levels; for example, you could group your report by Country and then by City to get more informative results. This method defines the grouping levels of the report that you want to generate.
# This method is available in both the community edition and the commercial edition .

# Parameters

Parameter Description
$group_by_arrayThe array of the column(s) by which you want to group your generated report.

# Returns

This method returns the calling object, so it can be chained with other methods in the ‘ReportOptions’ class

# Code Example

 
           $report = new ReportOptions(SRE_PUBLIC_REPORT);
$report->select_tables(array("items"))
       ->set_grouping(array("country"))
       ->select_all_fields();
$engine = new CustomEngine($report);
$report_path = $engine->create_report();
if ($report_path) {
   echo "Your report URL:" . $report_path;
}