Hi Koolreport support,
i'm using Kool Reports Pro + Dashboard.
I need to pass data between 4 dashboards.
I have 1 dashboard with a list of representatives, listing their totals sales. User can click on a table row to go to a second dashboard, which list the clients of those sales. Third Dashboard is the invoices, Fourth Dashboard is the Invoices details.
On the first Dashboard, i pass the Date of the Datepicker, the rep_name and rep_id to the second Dashboard, using this code in the Table fields button :
protected function fields()
{
return [
Text::create("rep_name")->label("Rep Name")->sortable(true),
Text::create("rep_id")->label("Rep ID"),
Currency::create("orderNet")->CAD()->symbol()->decimals(2)->label("Sales Amount")->footer("sum")->sortable(true),
Text::create("orderCount")->label("Orders")->sortable(true),
Text::create("webOrderCount")->label("Web Orders")->sortable(true),
Number::create("webPercent")->label("Web Orders %")->sortable(true)->decimals(0),
Button::create("viewDetails")
->type("warning")
->label("")
->textAlign("right")
->text("View Clients")
->onClick(function($value, $row){
return Client::dashboard("SalesByRepCustomer")->load([
"rep_id"=>$row["rep_id"],
"rep_name"=>$row["rep_name"],
"start_date"=>$this->widget()->sibling("SalesByRepDateRange")->value()[0],
"end_date"=>$this->widget()->sibling("SalesByRepDateRange")->value()[1]
]);
}),
];
}
Here's a screenshot of the first and second Dashboard.
My question is: how do I pass the SAME DATE I used on the datepicker of the first Dashboard to the second, to dashboard 3 and 4. This also needs to work backwards, when i go from 4 - 3 - 2 - 1.
In the Fields of Table, i tried to use : $this->dashboard()->params()["start_date"]) but it's not working.
Thanks for helping!