Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
Hi Zubin,
Yes you can! Please use:
$data = $this->dataStore('storename')->data();
The function data() will return the all raw data. If you need the meta data, use the function meta()
$metadata = $this->dataStore('storename')->meta();
Hope that helps.
P.S:Thank you for trying out our product. If you need any further assistance, please let us know
Regards,
Peter
Hi Antonio,
You need that methods when you want to get processed data from dataStore. Maybe you need them to build custom data display, for example different kind of charts than what are available.
If you did not see any data, there are two reasons:
Please let us know.
Hi, thanks for your answer. I'll give more details now:
this is what I'm doing in MyReport.php
function settings()
{
return array(
"assets" => array(
"path" => "../../assets",
"url" => base_url()."/assets",
),
"dataSources" => array(
"report_data" => array(
"class"=>"\koolreport\datasources\ArrayDataSource",
"dataFormat"=>"associate",
"machine_data"=>$this->params["machine_data"],
"measure_data"=>$this->params["measure_data"]
#"measure_data"=>$this->params["measure_data"]
)
)
);
}
protected function setup() {
$this->src('report_data')->pipe($this->dataStore("report_data")->data());
}
I know that there is data, because when, in .view.php file I do this:
$r =
$this->dataStore("report_data")
;
print_r($r);
I see data, like here:
koolreport\core\DataStore Object (
[dataset:protected] => Array
(
)
[params:protected] =>
[report:protected] => Horometerreport Object
(
[params:protected] => Array
(
[measure_data] => Array
(
[measure_id] => 67
[date] => 2018-01-01
[start_at] => 2018-01-01 10:54:26
[end_at] => 2018-01-01 10:54:56
[starter_horometer] => 554
[ending_horometer] => 6
...
But, if a write:
$r =
$this->dataStore("report_data")->data()
;
print_r($r);
nothing is returned
I'm sure that I'm doing something wrong, but I don't know what.
Regards
There is small mistake in your setup of ArrayDataSource, you should do this:
function setup()
{
return array(
"dataSources"=>array(
"machine_data"=>array(
"class"=>"\koolreport\datasources\ArrayDataSource",
"dataFormat"=>"associate",
"data"=>$this->params["machine_data"],
),
"measure_data"=>array(
"class"=>"\koolreport\datasources\ArrayDataSource",
"dataFormat"=>"associate",
"data"=>$this->params["measure_data"],
),
)
);
}
There should be a separated data sources for each array.
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo