format_image_column

 
          format_image_column(string $column)  
This is one of the appearance customization methods supported in Smart Report Engine. It displays any certain column(s) in your report as clickable image thumbnails. When clicking on one of these images a lightbox will popup whereby your visitor can view the clicked image with its actual size.
This method is meant to be helpful if you have a column in your MYSQL database for storing names or paths of some images and you want to display these actual images in your report instead.
# This method is exclusive to the commercial edition and is not supported in the community edition .

# Note

You should place the actual images either in an images sub-directory in your report’s directory (i.e /sre_reports/your-report-directory/images/) or you have to edit the generated configuration file of your report (can be found at /sre_reports/your-report/config.php) to add the path of your images directory in the ‘$images_path’ setting.

# Parameters

Parameter Description
$columnThe name of the column that you wish to show as images.

# 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"))
               ->select_fields(array("id", "country", "list_price", "product_name","photo","rating","discontinued"))
               ->set_grouping(array("country"))
               ->format_country_flag_column ("country")
               ->format_rating_column("rating")
               ->format_prefix_text_to_column("list_price", "$")
               ->format_check_box_column("discontinued")
               ->format_image_column("photo");
        $engine = new CustomEngine($report);
        $report_path = $engine->create_report();
   echo "Your report URL:" . $report_path;
} catch (Exception $ex) {
   echo 'Caught exception message:  '.  $ex->getMessage();
}