sort_by
sort_by
sort_by(string $column, int $order = 0)
Parameter | Description |
---|---|
$column | The column by which you want to sort the generated report. |
$order | This parameter can be 0 or 1. If you set it to 1 your generated report will be sorted in a descending order. Otherwise, it will be sorted in an ascending order. |
$report = new ReportOptions(Constants::SRE_PUBLIC_REPORT);
$report->select_tables(array("items", "items_sales"))
->add_relationship("items", "id", "items_sales", "item_id")
->set_grouping(array("items.country"))
->sort_by("items.iD")
->select_fields(array("items.id","items.product_code","items.country","items_sales.customer_name" ,"items.product_name","items.list_price","items.units_in_stock"));
$engine = new CustomEngine($report);
$report_path = $engine->create_report();