label
label
label(string $column, string $label)
Parameter | Description |
---|---|
$column | The column which you want to label. |
$label | The label which you want to use in your report for the column instead of its original SQL name. |
$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);