label

 
          label(string $column, string $label)  
This method gives a label to any given column in your report to make it friendly, using an alias rather than its original SQL name. If you want to give labels to many columns in your report, you will have to call this method many times as shown in the example below.
# This method is exclusive to the commercial edition and is not supported in the community edition .

# Note

If your report is based on multiple reports, you should pass the column name in the following formats:
.”. For example “items.country”.

# Parameters

Parameter Description
$columnThe column which you want to label.
$labelThe label which you want to use in your report for the column instead of its original SQL name.

# 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", "items_sales"))
       ->add_relationship("items", "id", "items_sales", "item_id")
       ->select_fields(array("items.id","items.product_code", "items.photo","items.country" ,"items.rating" , "items_sales.customer_name" ,"items.product_name","items.list_price","items.units_in_stock"))
       ->label("items.iD", "ID")
       ->label("items.country", "Made In")
       ->label("items.product_code", "code")
       ->label("items.photo", "Photo")
       ->label("items.rating", "Rating")
       ->label("items.product_name", "Product")
       ->label("items.units_in_stock", "stock units")
       ->label("items.list_price", "price")
       ->label("items_sales.customer_name", "customer");
 $engine = new CustomEngine($report);