__construct

 
          __construct(ReportOptions  $report)  
This method is the class constructor, it's called when an instance of the 'CustomEngine' class is created, it requires an instance of 'ReportOptions' class to pass all needed report options.
# This method is available in both the community edition and the commercial edition .

# Parameters

Parameter Description
$reportAn instance of 'ReportOptions' class. It's needed to pass all needed report options to the 'CustomEngine' class which is responsible for building the report.

# Returns

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

# Code Example

 
           try{
$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();
echo "Your report URL:" . $report_path;
} catch (Exception $ex) {
   echo 'Caught exception message:  '.  $ex->getMessage();
}
            

# See Also