format_prefix_text_to_column

 
          format_prefix_text_to_column(string $column, string $prepended_text)  
This is one of the appearance customization methods supported in Smart Report Engine. It attaches any text you want as a prefix to all records in any column of your report. For example, adding an "$" to a price column.
# This method is exclusive to the commercial edition and is not supported in the community edition .

# Parameters

Parameter Description
$columnThe name of the column that you wish to customize.
$prepended_textThe string that you wish to insert in the defining of all records of your column.

# 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();
}